qx
2025-03-26 155a30a172e4cf04838dcf7c8bb73ce6b200e574
src/store/modules/user.js
@@ -7,7 +7,8 @@
    name: '',
    avatar: '',
    roles: [],
    permissions: []
    permissions: [],
    // routeId: null
  },
  mutations: {
@@ -25,7 +26,10 @@
    },
    SET_PERMISSIONS: (state, permissions) => {
      state.permissions = permissions
    }
    },
    // SET_ROUTE_ID(state, id) {
    //   state.routeId = id;
    // }
  },
  actions: {
@@ -37,9 +41,10 @@
      const uuid = userInfo.uuid
      const type = userInfo.type
      const mobile = userInfo.mobile
      const hospId = userInfo.hospId
      return new Promise((resolve, reject) => {
        if(userInfo.username.length === 12){
          getlogin(username, password, code, uuid,type,mobile).then(res => {
          getlogin(username, password, code, uuid,type,mobile,hospId).then(res => {
            setToken(res.token)
            commit('SET_TOKEN', res.token);
            resolve(res)
@@ -47,9 +52,10 @@
            reject(error)
          })
        }else{
          login(username, password, code, uuid,type,mobile).then(res => {
          login(username, password, code, uuid,type,mobile,hospId).then(res => {
            setToken(res.token)
            commit('SET_TOKEN', res.token)
            // commit('SET_ROUTE_ID', hospId)
            resolve(res)
          }).catch(error => {
            reject(error)
@@ -87,6 +93,7 @@
      commit('SET_TOKEN', '')
      commit('SET_ROLES', [])
      commit('SET_PERMISSIONS', [])
      // commit('SET_ROUTE_ID', [])
      removeToken()
      resolve()
    }).catch(error => {