vuex模块化
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import http from "./http";
|
||||
import Vue from "vue";
|
||||
|
||||
/**
|
||||
* 用户登录信息
|
||||
*/
|
||||
export const user = {
|
||||
state: () => ({}),
|
||||
mutations: {
|
||||
@@ -16,13 +19,13 @@ export const user = {
|
||||
return http.post("/admin/user/detail-phone", null, config).then(res => {
|
||||
if (res?.code == 0) {
|
||||
commit('setUser', res.data)
|
||||
return Promise.all([dispatch('getGridInfo')])
|
||||
return Promise.all([dispatch('getGridInfo', config)])
|
||||
}
|
||||
})
|
||||
},
|
||||
getGridInfo({commit}) {
|
||||
getGridInfo({commit}, config) {
|
||||
//获取登录着网格员信息
|
||||
return http.post("/app/appgirdmemberinfo/checkLogOnUser").then(res => {
|
||||
return http.post("/app/appgirdmemberinfo/checkLogOnUser", null, config).then(res => {
|
||||
if (res?.data) {
|
||||
let {girdId, girdMemberId, girdName, checkType: girdCheckType, appGirdInfo: gridInfo} = res.data
|
||||
return commit("setUser", {girdId, girdMemberId, girdName, girdCheckType, gridInfo})
|
||||
|
||||
Reference in New Issue
Block a user