From c4b92654f3804cb00e94fc81b08fb554d957b7c5 Mon Sep 17 00:00:00 2001 From: zhangxiao <898441624@qq.com> Date: 星期五, 09 八月 2024 16:39:25 +0800 Subject: [PATCH] fix: 修改bug --- src/store/modules/user/index.ts | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 0849edf..0a3e0d3 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -10,6 +10,7 @@ import { UserState } from './types'; import useAppStore from '../app'; + const useUserStore = defineStore('user', { state: (): UserState => ({ name: undefined, @@ -63,7 +64,7 @@ }, // Login - async login(loginForm: LoginData) { + async login(loginForm: LoginData):string { try { const res = await userLogin(loginForm); setToken(res.data.access_token); @@ -75,6 +76,11 @@ this.resources=res.data.resources; setUserInfo(JSON.stringify(userInfo)); setUserResources(JSON.stringify(this.resources)) + for (const r of this.resources) { + if (r.menuType == 0) { + return r.component + } + } } catch (err) { clearToken(); throw err; -- Gitblit v1.8.0