|
@@ -1,34 +1,35 @@
|
|
-import Vue from 'vue'
|
|
|
|
-import Vuex from 'vuex'
|
|
|
|
-import { login, queryFloor, queryfmapID } from '@/api/login.js'
|
|
|
|
-import { queryBrand } from '@/api/public.js'
|
|
|
|
-import axios from 'axios'
|
|
|
|
|
|
+import Vue from "vue"
|
|
|
|
+import Vuex from "vuex"
|
|
|
|
+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)
|
|
Vue.use(Vuex)
|
|
export default new Vuex.Store({
|
|
export default new Vuex.Store({
|
|
state: {
|
|
state: {
|
|
- ssoToken: 'admin:lengqiang',
|
|
|
|
- // ssoToken: null,
|
|
|
|
|
|
+ // ssoToken: 'admin:lengqiang',
|
|
|
|
+ ssoToken: null,
|
|
isPreview: false,
|
|
isPreview: false,
|
|
- lastRoute: '',
|
|
|
|
|
|
+ lastRoute: "",
|
|
isrequestAuth: true, // 是否请求登录校验接口
|
|
isrequestAuth: true, // 是否请求登录校验接口
|
|
permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
|
|
permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
|
|
plazas: [], //项目列表
|
|
plazas: [], //项目列表
|
|
userInfo: {
|
|
userInfo: {
|
|
- employeename: '', //用户名称:艾宇;
|
|
|
|
- orgCode: '',
|
|
|
|
- username: 'lengqiang', //账户名称
|
|
|
|
|
|
+ employeename: "", //用户名称:艾宇;
|
|
|
|
+ orgCode: "",
|
|
|
|
+ username: "lengqiang", //账户名称
|
|
},
|
|
},
|
|
- plazaId: '1000423', //项目Id
|
|
|
|
- projectName: '', //全局项目名称
|
|
|
|
|
|
+ plazaId: "1000423", //项目Id
|
|
|
|
+ projectName: "", //全局项目名称
|
|
floorsArr: [], //楼层数组
|
|
floorsArr: [], //楼层数组
|
|
floorSelect: [], //楼层下拉框
|
|
floorSelect: [], //楼层下拉框
|
|
- fmapID: '',
|
|
|
|
|
|
+ fmapID: "",
|
|
haveFengMap: false, //是否有蜂鸟地图的数据
|
|
haveFengMap: false, //是否有蜂鸟地图的数据
|
|
isMessage: true, //是否有发布的图
|
|
isMessage: true, //是否有发布的图
|
|
scpzTable: [], //土建系统图例展示
|
|
scpzTable: [], //土建系统图例展示
|
|
legendTable: [], //除土建系统图例展示
|
|
legendTable: [], //除土建系统图例展示
|
|
- remarksText: '', //备注
|
|
|
|
|
|
+ remarksText: "", //备注
|
|
bunkObj: {}, // 铺位名称
|
|
bunkObj: {}, // 铺位名称
|
|
currentFloor: {}, //当前选中的楼层信息
|
|
currentFloor: {}, //当前选中的楼层信息
|
|
},
|
|
},
|
|
@@ -111,20 +112,34 @@ export default new Vuex.Store({
|
|
actions: {
|
|
actions: {
|
|
// 获取项目列表、userId
|
|
// 获取项目列表、userId
|
|
async getUserInfo({ commit }, palyload) {
|
|
async getUserInfo({ commit }, palyload) {
|
|
- await login({ username: palyload }).then((res) => {
|
|
|
|
- if (res.result == 'success') {
|
|
|
|
- commit('SETISREQUESTtAUTH', true)
|
|
|
|
- commit('SETAUTHMSG', res)
|
|
|
|
|
|
+ await login({}).then((res) => {
|
|
|
|
+ if (res.result == "success") {
|
|
|
|
+ // token校验成功 拿到权限
|
|
|
|
+ //commit("SETISREQUESTtAUTH", true)
|
|
|
|
+ console.log("-----", palyload)
|
|
|
|
+ if (res.permissions.length == 0) {
|
|
|
|
+ //权限不足
|
|
|
|
+ console.log("权限不足!!")
|
|
|
|
+ router.push({ path: "/404", query: { result: "权限不足" } })
|
|
|
|
+ }
|
|
|
|
+ commit("SETAUTHMSG", res)
|
|
|
|
+ } else if (res.result == "no_auth") {
|
|
|
|
+ //登录失败
|
|
|
|
+ console.log("登录失败!!")
|
|
|
|
+ commit("SETISREQUESTtAUTH", false)
|
|
|
|
+ router.push({ path: "/404", query: { result: "登录失败" } })
|
|
} else {
|
|
} else {
|
|
- console.log('接口报错!!')
|
|
|
|
- commit('SETISREQUESTtAUTH', false)
|
|
|
|
|
|
+ //访问出错 500
|
|
|
|
+ console.log("访问出错!!")
|
|
|
|
+ commit("SETISREQUESTtAUTH", false)
|
|
|
|
+ router.push({ path: "/404", query: { result: "访问出错" } })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getFloors(context) {
|
|
getFloors(context) {
|
|
queryFloor({ plazaId: context.state.plazaId }).then((res) => {
|
|
queryFloor({ plazaId: context.state.plazaId }).then((res) => {
|
|
- if (res.result == 'success') {
|
|
|
|
- context.commit('SETFLOORS', res.data)
|
|
|
|
|
|
+ if (res.result == "success") {
|
|
|
|
+ context.commit("SETFLOORS", res.data)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -132,7 +147,7 @@ export default new Vuex.Store({
|
|
await queryfmapID({
|
|
await queryfmapID({
|
|
mapId: context.state.plazaId,
|
|
mapId: context.state.plazaId,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
|
|
|
|
|
|
+ context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
async getBrand(context) {
|
|
async getBrand(context) {
|
|
@@ -147,7 +162,7 @@ export default new Vuex.Store({
|
|
obj[i.bunkdesc] = i
|
|
obj[i.bunkdesc] = i
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- context.commit('SETBUNKOBJ', obj)
|
|
|
|
|
|
+ context.commit("SETBUNKOBJ", obj)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
},
|
|
},
|