|
@@ -1,7 +1,13 @@
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
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 axios from 'axios'
|
|
import router from '../router'
|
|
import router from '../router'
|
|
|
|
|
|
@@ -10,7 +16,7 @@ export default new Vuex.Store({
|
|
state: {
|
|
state: {
|
|
// ssoToken: 'admin:chuyushu',
|
|
// ssoToken: 'admin:chuyushu',
|
|
// ssoToken: '',
|
|
// ssoToken: '',
|
|
- // ssoToken: null,
|
|
|
|
|
|
+ ssoToken: null,
|
|
plazaName: '',
|
|
plazaName: '',
|
|
isPreview: false,
|
|
isPreview: false,
|
|
lastRoute: '',
|
|
lastRoute: '',
|
|
@@ -63,7 +69,7 @@ export default new Vuex.Store({
|
|
isGetmap: (state) => state.isGetmap,
|
|
isGetmap: (state) => state.isGetmap,
|
|
planNum: (state) => state.planNum,
|
|
planNum: (state) => state.planNum,
|
|
typeNum: (state) => state.typeNum,
|
|
typeNum: (state) => state.typeNum,
|
|
- isrequestAuth:(state)=> state.isrequestAuth
|
|
|
|
|
|
+ isrequestAuth: (state) => state.isrequestAuth
|
|
},
|
|
},
|
|
mutations: {
|
|
mutations: {
|
|
SETPLAZENAME(state, data) {
|
|
SETPLAZENAME(state, data) {
|
|
@@ -160,14 +166,18 @@ export default new Vuex.Store({
|
|
},
|
|
},
|
|
actions: {
|
|
actions: {
|
|
// 获取项目列表、userId
|
|
// 获取项目列表、userId
|
|
- async getUserInfo({ commit }, palyload) {
|
|
|
|
|
|
+ async getUserInfo({
|
|
|
|
+ commit
|
|
|
|
+ }, palyload) {
|
|
|
|
+ console.log('getUserInfo',1)
|
|
await login({
|
|
await login({
|
|
- returnTree: true,
|
|
|
|
- })
|
|
|
|
|
|
+ returnTree: true,
|
|
|
|
+ })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// 获取用户当前权限
|
|
// 获取用户当前权限
|
|
console.log(res.result)
|
|
console.log(res.result)
|
|
if (res.result === 'success') {
|
|
if (res.result === 'success') {
|
|
|
|
+ console.log('getUserInfo',2)
|
|
commit('STOREACCESSLEVEL', res.level)
|
|
commit('STOREACCESSLEVEL', res.level)
|
|
let level = res.level
|
|
let level = res.level
|
|
if (window.opener) {
|
|
if (window.opener) {
|
|
@@ -198,6 +208,7 @@ export default new Vuex.Store({
|
|
// commit('SETISREQUESTtAUTH', false)
|
|
// commit('SETISREQUESTtAUTH', false)
|
|
// commit('SETISREQUESTtAUTH', false)
|
|
// commit('SETISREQUESTtAUTH', false)
|
|
} else {
|
|
} else {
|
|
|
|
+ console.log('getuserfo error',res)
|
|
router.push({
|
|
router.push({
|
|
path: '/404',
|
|
path: '/404',
|
|
})
|
|
})
|
|
@@ -205,11 +216,13 @@ export default new Vuex.Store({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
- router.push({
|
|
|
|
- path: '/404',
|
|
|
|
- })
|
|
|
|
|
|
+ console.log('getuserfo catch',err)
|
|
|
|
+ // router.push({
|
|
|
|
+ // path: '/404',
|
|
|
|
+ // })
|
|
commit('SETISREQUESTtAUTH', err)
|
|
commit('SETISREQUESTtAUTH', err)
|
|
})
|
|
})
|
|
|
|
+ console.log('getUserInfo',3)
|
|
},
|
|
},
|
|
getFloors(context) {
|
|
getFloors(context) {
|
|
queryFloor({
|
|
queryFloor({
|
|
@@ -246,4 +259,4 @@ export default new Vuex.Store({
|
|
},
|
|
},
|
|
},
|
|
},
|
|
modules: {},
|
|
modules: {},
|
|
-})
|
|
|
|
|
|
+})
|