From 09c5667700fb6da21d29c41e51fa5482a4b40bc9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 24 十月 2025 11:22:22 +0800
Subject: [PATCH] 新公司部署相关配置修改
---
src/store/modules/user.js | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 2c6398f..1ef23e6 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,6 +2,7 @@
import { getToken, setToken, removeToken } from '@/utils/auth'
import { isHttp, isEmpty } from "@/utils/validate"
import defAva from '@/assets/images/profile.jpg'
+import {userListAll} from '@/api/publicApi/index.js'
const useUserStore = defineStore(
'user',
@@ -13,7 +14,8 @@
nickName: '',
avatar: '',
roles: [],
- permissions: []
+ permissions: [],
+ userList: []
}),
actions: {
// 鐧诲綍
@@ -70,6 +72,20 @@
reject(error)
})
})
+ },
+
+ // 鑾峰彇鐢ㄦ埛鍒楄〃锛堝鏋滃凡缂撳瓨鍒欑洿鎺ヨ繑鍥烇紝鍚﹀垯閲嶆柊鑾峰彇锛�
+ async getUserList () {
+ if (Array.isArray(this.userList) && this.userList.length > 0) {
+ return this.userList;
+ }
+ // 涓虹┖鏃堕噸鏂拌幏鍙�
+ return userListAll().then(res => {
+ this.userList = res.data;
+ return this.userList;
+ }).catch(error => {
+ throw error;
+ });
}
}
})
--
Gitblit v1.9.3