login page

This commit is contained in:
landaiqing
2024-08-11 15:21:16 +08:00
parent 438965f2a2
commit ff6a4a5d09
54 changed files with 2731 additions and 170 deletions

View File

@@ -2,6 +2,7 @@
import {createI18n} from 'vue-i18n';
import zh from './language/zh.ts';
import en from './language/en.ts';
import {parse} from "zipson/lib";
const messages = {
en,
@@ -9,12 +10,14 @@ const messages = {
};
const language = (navigator.language || 'en').toLocaleLowerCase(); // 这是获取浏览器的语言
const i18n = createI18n({
const language: string = (navigator.language || 'en').toLocaleLowerCase(); // 获取浏览器的语言
const lang: string = localStorage.getItem("lang") as string;
const i18n: any = createI18n({
legacy: false,
compositionOnly: false,
globalInjection: true,
silentTranslationWarn: true,
locale: JSON.parse(localStorage.getItem("lang") as string).lang || language.split('-')[0] || 'zh', // 首先从缓存里拿,没有的话就用浏览器语言,
locale: parse(lang).lang || language.split('-')[0] || 'zh', // 首先从缓存里拿,没有的话就用浏览器语言,
silentFallbackWarn: true,
missingWarn: true,
fallbackWarn: false,

View File

@@ -1,6 +1,40 @@
// en.ts
export default {
login: {
test: 'login',
title: 'Schisandra Cloud Album',
accountLogin: 'account login',
account: 'account',
accountValidate: "please enter your phone/account/email",
password: 'password',
passwordValidate: "please enter password",
autoLogin: "auto login",
forgotPassword: "forgot password",
loginAndRegister: "login/Register",
qrLogin: "QR login",
phoneLogin: "phone login",
phone: "phone number",
phoneValidate: 'please enter a valid phone number',
captchaValidate: 'please enter captcha number',
phoneCaptcha: "captcha",
sendCaptcha: "send captcha",
login: "login",
register: "register",
reSendCaptcha: " re-send",
passwordRule: "The password must be 6~18 characters and must contain letters, numbers and special symbols!"
},
error: {
networkError: 'Network error, please try again later',
400: 'request error (400)',
401: 'request unauthorized (401)',
403: 'request forbidden (403)',
404: 'request not found (404)',
408: 'request timeout (408)',
500: 'server error (500)',
501: 'not implemented (501)',
502: 'bad gateway (502)',
503: 'service unavailable (503)',
504: 'gateway timeout (504)',
505: 'http version not supported (505)',
other: 'connect error',
}
};

View File

@@ -1,9 +1,41 @@
// zh.ts
export default {
login: {
test: '登录',
title: '五味子云存储',
accountLogin: '账号登录',
account: '账号',
accountValidate: '请输入手机号/账号/邮箱',
password: "密码",
passwordValidate: "请输入密码",
autoLogin: "自动登录",
forgotPassword: "忘记密码",
loginAndRegister: "登录",
qrLogin: "扫码登录",
phoneLogin: "短信登录",
phone: "手机号",
phoneValidate: '请输入正确的手机号',
captchaValidate: '请输入验证码',
phoneCaptcha: "验证码",
sendCaptcha: "发送验证码",
login: "登录",
register: "注册",
reSendCaptcha: "重新发送",
passwordRule: "密码要6~18位字符且必须包含字母、数字和特殊符号"
},
error: {
networkError: '网络连接失败!',
400: '请求错误(400)',
401: '未授权,请重新登录(401)',
403: '拒绝访问(403)',
404: '请求出错(404)',
408: '请求超时(408)',
500: '服务器错误(500)',
501: '服务未实现(501)',
502: '网关错误(502)',
503: '服务不可用(503)',
504: '网关超时(504)',
505: 'HTTP版本不受支持(505)',
other: '连接出错',
}
};