mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2026-03-25 07:47:22 +08:00
Compare commits
3 Commits
a37949f2af
...
9d48ca5f1c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d48ca5f1c | ||
|
|
b520db3ef4 | ||
|
|
f96c3c9e11 |
@@ -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" />
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user