From 1a090a490d8fc93224a0e3ad0fd7fe16c9fe63a8 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 21 一月 2025 19:01:11 +0800
Subject: [PATCH] 测试完成

---
 src/store/modules/user.js |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 09507cf..9c01098 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -5,7 +5,10 @@
   state: {
     token: getToken(),
     name: '',
+    Id: '',
     avatar: '',
+    belongWards:[],
+    belongDepts:[],
     roles: [],
     permissions: [],
     // 鏈嶅姟绫诲瀷
@@ -83,6 +86,11 @@
     SET_NAME: (state, name) => {
       state.name = name
     },
+    SET_Id: (state, Id) => {
+      state.Id = Id
+      console.log(state.Id,'user2');
+
+    },
     SET_AVATAR: (state, avatar) => {
       state.avatar = avatar
     },
@@ -94,6 +102,12 @@
     },
     SET_Serviceauthority: (state, Serviceauthority) => {
       state.Serviceauthority = Serviceauthority
+    },
+    SET_leavehospitaldistrictcodes: (state, belongWards) => {
+      state.belongWards = belongWards
+    },
+    SET_leaveldeptcodes: (state, belongDepts) => {
+      state.belongDepts = belongDepts
     }
   },
 
@@ -104,10 +118,12 @@
       const password = userInfo.password
       const code = userInfo.code
       const uuid = userInfo.uuid
+      const guid = userInfo.guid
       return new Promise((resolve, reject) => {
-        login(username, password, code, uuid).then(res => {
+        login(username, password, code, uuid,guid).then(res => {
           setToken(res.token)
           commit('SET_TOKEN', res.token)
+          localStorage.setItem('guid', guid);
           resolve()
         }).catch(error => {
           reject(error)
@@ -119,6 +135,7 @@
     GetInfo({ commit, state }) {
       return new Promise((resolve, reject) => {
         getInfo().then(res => {
+
           const user = res.user
           const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
           if (res.roles && res.roles.length > 0) { // 楠岃瘉杩斿洖鐨剅oles鏄惁鏄竴涓潪绌烘暟缁�
@@ -128,6 +145,10 @@
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_NAME', user.userName)
+          console.log(user.userId,'user1');
+          commit('SET_Id', user.userId)
+          commit('SET_leavehospitaldistrictcodes', user.belongWards)
+          commit('SET_leaveldeptcodes', user.belongDepts)
           commit('SET_AVATAR', avatar)
           resolve(res)
         }).catch(error => {

--
Gitblit v1.9.3