BUG 26
This commit is contained in:
		| @@ -5,7 +5,10 @@ import Vue from "vue" | ||||
| export const sys = { | ||||
|   state: () => ({ | ||||
|     info: {}, | ||||
|     theme: {} | ||||
|     theme: {}, | ||||
|     location: {}, | ||||
|     areaId: "", | ||||
|     areaName: "" | ||||
|   }), | ||||
|   mutations: { | ||||
|     setSysInfo(state, info) { | ||||
| @@ -13,17 +16,26 @@ export const sys = { | ||||
|     }, | ||||
|     setTheme(state, theme) { | ||||
|       state.theme = theme | ||||
|     }, | ||||
|     setLocation(state, location) { | ||||
|       state.location = location | ||||
|     }, | ||||
|     setArea(state, area) { | ||||
|       state.areaId = area.areaId | ||||
|       state.areaName = area.areaName | ||||
|     } | ||||
|   }, | ||||
|   actions: { | ||||
|     getSystem({commit}, info) { | ||||
|       return http.post("/app/appdvcpconfig/getSystemInfo", null, {withoutToken: true}).then(res => { | ||||
|         if (res?.data) { | ||||
|           let {systemInfo, colorScheme, enableGreyFilter} = res.data | ||||
|           let {systemInfo, colorScheme, enableGreyFilter, location, areaId, areaName} = res.data | ||||
|           systemInfo = JSON.parse(systemInfo || null) || {} | ||||
|           colorScheme = JSON.parse(colorScheme || null) || {} | ||||
|           commit("setSysInfo", {...info, ...systemInfo}) | ||||
|           commit("setTheme", {colorScheme, enableGreyFilter}) | ||||
|           commit("setLocation", location) | ||||
|           commit("setArea", {areaId, areaName}) | ||||
|           return res.data | ||||
|         } else return Promise.reject() | ||||
|       }).catch(() => commit("setSysInfo", info)) | ||||
| @@ -53,7 +65,7 @@ export const user = { | ||||
|     setUserExtra(state, extra = {}) { | ||||
|       Object.keys(extra).map(e => Vue.set(state, e, extra[e])) | ||||
|     }, | ||||
|     setRoutes(state,routes){ | ||||
|     setRoutes(state, routes) { | ||||
|       state.routes = routes | ||||
|     } | ||||
|   }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user