From c245790ef1e6861d9dd17664c90ec0fc1186ea28 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期五, 09 八月 2024 14:03:58 +0800
Subject: [PATCH] 菜单修改
---
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