🎨 optimized code

This commit is contained in:
landaiqing
2024-11-27 01:50:18 +08:00
parent 88c1a4bd16
commit a3e15bbc86
13 changed files with 164 additions and 518 deletions

View File

@@ -27,7 +27,7 @@ const router: Router = createRouter({
router.beforeEach((to, _from, next) => {
// start();
const user = useStore().user;
const token: string | undefined = user.user.refreshToken;
const token: string | undefined = user.user.access_token;
const userId: string | undefined = user.user.uid;
// 检查用户是否已登录
@@ -44,7 +44,7 @@ router.beforeEach((to, _from, next) => {
if (isLoggedIn) {
next();
} else {
message.warn(i18n.global.t('login.pleaseLogin')).then();
message.warn(i18n.global.t('login.pleaseLogin'));
next({
path: '/login',
query: {redirect: to.fullPath}