From f9902f7a3b79d22bde9f199263ac36de26816470 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 08 五月 2026 14:46:10 +0800
Subject: [PATCH] 测试完成
---
src/store/modules/user.js | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index bd78301..031657f 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,4 +1,5 @@
import { login, logout, getInfo } from "@/api/login";
+import { getConfig, getConfigKey, listConfig } from "@/api/system/config";
import { getToken, setToken, removeToken } from "@/utils/auth";
const user = {
@@ -13,6 +14,7 @@
belongDepts: [],
roles: [],
permissions: [],
+ visitAgain: 1, //1寮�鍚�2涓嶅紑鍚啀娆¢殢璁�
satisfactionCategories: {},
// 鏈嶅姟绫诲瀷
Serviceauthority: [
@@ -91,6 +93,9 @@
},
SET_nickNAME: (state, name) => {
state.nickName = name;
+ },
+ SET_visitAgain: (state, visitAgain) => {
+ state.visitAgain = visitAgain;
},
SET_Id: (state, Id) => {
state.Id = Id;
@@ -250,7 +255,7 @@
},
// 鑾峰彇鐢ㄦ埛淇℃伅
- GetInfo({ commit, state }) {
+ GetInfo({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
getInfo()
.then((res) => {
@@ -271,17 +276,30 @@
commit("SET_Id", user.userId);
commit("SET_hisUserId", user.hisUserId);
commit("SET_satisfactionCategories", user.satisfactionCategories);
-
- // if (user.userName == "admin") {
- // commit("SET_leaveldeptcodes", []);
- // commit("SET_leavehospitaldistrictcodes", []);
- // } else {
- // commit("SET_leavehospitaldistrictcodes", user.belongWards);
- // commit("SET_leaveldeptcodes", user.belongDepts);
- // }
commit("SET_leavehospitaldistrictcodes", user.belongWards);
commit("SET_leaveldeptcodes", user.belongDepts);
commit("SET_AVATAR", avatar);
+ // 姝g‘璋冪敤鏂瑰紡锛氶�氳繃 dispatch
+ dispatch("GetConfig")
+ .then(() => {
+ resolve(res);
+ })
+ .catch((error) => {
+ reject(error);
+ });
+ })
+ .catch((error) => {
+ reject(error);
+ });
+ });
+ },
+ // 鑾峰彇鍙傛暟淇℃伅
+ GetConfig({ commit, state }) {
+ return new Promise((resolve, reject) => {
+ listConfig({ configName: "鍐嶆闅忚" })
+ .then((res) => {
+ if (res.rows && res.rows.length > 0)
+ commit("SET_visitAgain", res.rows[0].configValue);
resolve(res);
})
.catch((error) => {
@@ -289,7 +307,6 @@
});
});
},
-
// 閫�鍑虹郴缁�
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
--
Gitblit v1.9.3