|
@@ -1,22 +1,16 @@
|
|
|
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'
|
|
|
|
|
|
Vue.use(Vuex)
|
|
|
export default new Vuex.Store({
|
|
|
state: {
|
|
|
- // ssoToken: 'admin:liujiandong',
|
|
|
+ ssoToken: 'admin:liujiandong',
|
|
|
// ssoToken: '',
|
|
|
- ssoToken: null,
|
|
|
+ // ssoToken: null,
|
|
|
plazaName: '',
|
|
|
isPreview: false,
|
|
|
lastRoute: '',
|
|
@@ -70,7 +64,7 @@ export default new Vuex.Store({
|
|
|
planNum: (state) => state.planNum,
|
|
|
typeNum: (state) => state.typeNum,
|
|
|
isrequestAuth: (state) => state.isrequestAuth,
|
|
|
- permissions:(state)=>state.permissions
|
|
|
+ permissions: (state) => state.permissions,
|
|
|
},
|
|
|
mutations: {
|
|
|
SETPLAZENAME(state, data) {
|
|
@@ -167,20 +161,18 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
actions: {
|
|
|
// 获取项目列表、userId
|
|
|
- async getUserInfo({
|
|
|
- commit
|
|
|
- }, palyload) {
|
|
|
+ async getUserInfo({ commit }, palyload) {
|
|
|
await login({
|
|
|
- returnTree: true,
|
|
|
- })
|
|
|
+ returnTree: true,
|
|
|
+ })
|
|
|
.then((res) => {
|
|
|
// 获取用户当前权限
|
|
|
console.log(res.result)
|
|
|
if (res.result === 'success') {
|
|
|
commit('STOREACCESSLEVEL', res.level)
|
|
|
- commit('SETAUTHMSG',res)
|
|
|
- let level = res.level;
|
|
|
- console.log('window.opener',window.opener)
|
|
|
+ commit('SETAUTHMSG', res)
|
|
|
+ let level = res.level
|
|
|
+ console.log('window.opener', window.opener)
|
|
|
if (window.opener && window.opener.__fromGroupPage) {
|
|
|
let data = window.opener.__fromGroupPage
|
|
|
level = data.level
|
|
@@ -199,7 +191,7 @@ export default new Vuex.Store({
|
|
|
}
|
|
|
router.push({
|
|
|
path: './home/overview',
|
|
|
- query:{plazaId: res.treeData[0].ccode}
|
|
|
+ query: { plazaId: res.treeData[0].ccode },
|
|
|
})
|
|
|
} else {
|
|
|
router.push({
|
|
@@ -219,16 +211,14 @@ export default new Vuex.Store({
|
|
|
// commit('SETISREQUESTtAUTH', err)
|
|
|
})
|
|
|
},
|
|
|
- async getUserInfoNoPath({
|
|
|
- commit
|
|
|
- }, palyload) {
|
|
|
+ async getUserInfoNoPath({ commit }, palyload) {
|
|
|
await login({
|
|
|
- returnTree: true,
|
|
|
- })
|
|
|
+ returnTree: true,
|
|
|
+ })
|
|
|
.then((res) => {
|
|
|
if (res.result === 'success') {
|
|
|
// commit('STOREACCESSLEVEL', res.level)
|
|
|
- commit('SETAUTHMSG',res)
|
|
|
+ commit('SETAUTHMSG', res)
|
|
|
// localStorage.setItem('PLAZAID', res.treeData[0].ccode)
|
|
|
// commit('STOREPLAZAID', res.treeData[0].ccode)
|
|
|
// commit('SETPLAZENAME', res.treeData[0].cname)
|
|
@@ -277,4 +267,4 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
},
|
|
|
modules: {},
|
|
|
-})
|
|
|
+})
|