|
@@ -1,7 +1,13 @@
|
|
|
import Vue from 'vue'
|
|
|
import Vuex from 'vuex'
|
|
|
-import { login, queryFloor, queryfmapID } from '@/api/login.js'
|
|
|
-import { queryBrand } from '@/api/public.js'
|
|
|
+import {
|
|
|
+ login,
|
|
|
+ queryFloor,
|
|
|
+ queryfmapID
|
|
|
+} from '@/api/login.js'
|
|
|
+import {
|
|
|
+ queryBrand
|
|
|
+} from '@/api/public.js'
|
|
|
import axios from 'axios'
|
|
|
import router from '../router'
|
|
|
|
|
@@ -148,8 +154,12 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
actions: {
|
|
|
// 获取项目列表、userId
|
|
|
- async getUserInfo({ commit }, palyload) {
|
|
|
- await login({ returnTree: true }).then((res) => {
|
|
|
+ async getUserInfo({
|
|
|
+ commit
|
|
|
+ }, palyload) {
|
|
|
+ await login({
|
|
|
+ returnTree: true
|
|
|
+ }).then((res) => {
|
|
|
// 获取用户当前权限
|
|
|
if (res.result === 'success') {
|
|
|
commit('STOREACCESSLEVEL', res.level)
|
|
@@ -160,7 +170,9 @@ export default new Vuex.Store({
|
|
|
commit('SETPLAZENAME', data.plazaName)
|
|
|
localStorage.setItem('PLAZAID', data.plazaId)
|
|
|
commit('STOREPLAZAID', data.plazaId)
|
|
|
- router.push({ path: './home/homepage' })
|
|
|
+ router.push({
|
|
|
+ path: './home/homepage'
|
|
|
+ })
|
|
|
} else {
|
|
|
if (level === 0) {
|
|
|
if (res.treeData[0].ccode) {
|
|
@@ -168,9 +180,13 @@ export default new Vuex.Store({
|
|
|
commit('STOREPLAZAID', res.treeData[0].ccode)
|
|
|
commit('SETPLAZENAME', res.treeData[0].cname)
|
|
|
}
|
|
|
- router.push({ path: './home/homepage' })
|
|
|
+ router.push({
|
|
|
+ path: './home/homepage'
|
|
|
+ })
|
|
|
} else {
|
|
|
- router.push({ path: './group' })
|
|
|
+ router.push({
|
|
|
+ path: './group'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
// commit('SETISREQUESTtAUTH', false)
|
|
@@ -214,4 +230,4 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
},
|
|
|
modules: {},
|
|
|
-})
|
|
|
+})
|