From 565d0532247e825294cd21940b7af93f74a4480d Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 11 Jan 2023 09:40:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue index f9c7e1af..8c4d5273 100644 --- a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue +++ b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue @@ -31,6 +31,7 @@ @@ -203,7 +203,7 @@ export default { } }, computed: { - ...mapState(['user']), + ...mapState(['user','sys']), isEdit() { return !!this.params.id diff --git a/ui/lib/js/modules.js b/ui/lib/js/modules.js index 8c854ddf..874c5fe1 100644 --- a/ui/lib/js/modules.js +++ b/ui/lib/js/modules.js @@ -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 } },