Compare commits

...

3 Commits

3 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
<!doctype html>
<html lang="zh-cmn-Hans">
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.svg" />

View File

@@ -23,6 +23,8 @@ export const $t = i18n.global.t as App.I18n.$T;
export function setLocale(locale: App.I18n.LangType) {
i18n.global.locale.value = locale;
document?.querySelector('html')?.setAttribute('lang', locale);
}
export function getLocale(): App.I18n.LangType {

View File

@@ -19,7 +19,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const { toLogin, redirectFromLogin } = useRouterPush(false);
const { loading: loginLoading, startLoading, endLoading } = useLoading();
const token = ref(getToken());
const token = ref('');
const userInfo: Api.Auth.UserInfo = reactive({
userId: '',
@@ -159,9 +159,10 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
}
async function initUserInfo() {
const hasToken = getToken();
const maybeToken = getToken();
if (hasToken) {
if (maybeToken) {
token.value = maybeToken;
const pass = await getUserInfo();
if (!pass) {