|
@@ -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"
|
|
|
|
|
@@ -111,7 +117,9 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
actions: {
|
|
|
// 获取项目列表、userId
|
|
|
- async getUserInfo({ commit }, palyload) {
|
|
|
+ async getUserInfo({
|
|
|
+ commit
|
|
|
+ }, palyload) {
|
|
|
await login({}).then((res) => {
|
|
|
if (res.result == "success") {
|
|
|
// token校验成功 拿到权限
|
|
@@ -120,24 +128,41 @@ export default new Vuex.Store({
|
|
|
if (res.permissions.length == 0) {
|
|
|
//权限不足
|
|
|
console.log("权限不足!!")
|
|
|
- router.push({ path: "/404", query: { result: "权限不足" } })
|
|
|
+ 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: "登录失败" } })
|
|
|
+ router.push({
|
|
|
+ path: "/404",
|
|
|
+ query: {
|
|
|
+ result: "登录失败"
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
//访问出错 500
|
|
|
console.log("访问出错!!")
|
|
|
commit("SETISREQUESTtAUTH", false)
|
|
|
- router.push({ path: "/404", query: { result: "访问出错" } })
|
|
|
+ router.push({
|
|
|
+ path: "/404",
|
|
|
+ query: {
|
|
|
+ result: "访问出错"
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
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)
|
|
|
}
|
|
@@ -154,7 +179,9 @@ export default new Vuex.Store({
|
|
|
let data = {
|
|
|
plazaId: context.state.plazaId,
|
|
|
}
|
|
|
- await queryBrand({ data }).then((res) => {
|
|
|
+ await queryBrand({
|
|
|
+ data
|
|
|
+ }).then((res) => {
|
|
|
let obj = {}
|
|
|
if (res.data.data) {
|
|
|
let Data = res.data.data
|
|
@@ -167,4 +194,4 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
},
|
|
|
modules: {},
|
|
|
-})
|
|
|
+})
|