diff --git a/src/api/model/system.js b/src/api/model/system.js index 6e10c6df..d444c81d 100644 --- a/src/api/model/system.js +++ b/src/api/model/system.js @@ -4,15 +4,6 @@ import data from './../../../src/utils/baseJson'; const baseInFo = data[data.current]; export default { - config:{ - base: { - url: `${config.API_URL}/system/base_config/`, - name: "账户信息", - req: async function(){ - return await http.get(this.url); - } - }, - }, // config:{ // base: { // url: `${config.API_URL}/system/base_config/`, @@ -413,7 +404,14 @@ export default { } } }, - baseInfo: { + config: { + base: { + url: `${config.API_URL}/system/base_config/`, + name: "账户信息", + req: async function(){ + return await http.get(this.url); + } + }, getInfo: { url: `${config.API_URL}/system/config/`, name: "获取系统信息", diff --git a/src/layout/index.vue b/src/layout/index.vue index bba289a5..05a158a7 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -235,9 +235,9 @@ return baseName; }, baseLogo(){ - let baseInFo = data[data.current]; - // let base_logo = this.$TOOL.data.get("BASE_INFO")!==null?this.$TOOL.data.get("BASE_INFO").base.base_logo:'img/logo.png'; - let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png'; + // let baseInFo = data[data.current]; + let base_logo = this.$TOOL.data.get("BASE_INFO")!==null?this.$TOOL.data.get("BASE_INFO").base.base_logo:'img/logo.png'; + // let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png'; return base_logo }, ismobile(){ diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 74aefc4d..f598ff94 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -46,9 +46,9 @@ H5访问 监控视频 -
+
diff --git a/src/views/ops/setting.vue b/src/views/ops/setting.vue index 6ddc7ec0..bc540ca1 100644 --- a/src/views/ops/setting.vue +++ b/src/views/ops/setting.vue @@ -7,10 +7,10 @@
-

{{ $store.state.global.baseName }}

+

{{ form.base_name }}

@@ -63,6 +63,7 @@ export default { }, data() { return { + form: {}, menu: [ { groupName: "系统配置", @@ -106,18 +107,16 @@ export default { }); }, mounted() { - this.getBaseInfo(); + this.getSysConfig(); }, methods: { openPage(item) { this.page = item.index; }, - getBaseInfo() { - this.$API.system.baseInfo.getInfo.req().then((res) => { - debugger; - console.log(res) - this.$TOOL.data.set("BASE_INFO", res) + getSysConfig() { + this.$API.system.config.getInfo.req().then(res=>{ + this.form = res.base }) }, }, diff --git a/src/views/ops/settings/androisAPK.vue b/src/views/ops/settings/androisAPK.vue index 48aa8aa6..d3219848 100644 --- a/src/views/ops/settings/androisAPK.vue +++ b/src/views/ops/settings/androisAPK.vue @@ -36,25 +36,22 @@ export default { apk_file:'', apk_remark:'', }, - configInfo:null, }; }, mounted(){ - this.getBaseInfo() + this.getSysConfig(); }, methods:{ - getBaseInfo() { - this.configInfo = this.$TOOL.data.get("BASE_INFO"); - this.form = this.$TOOL.data.get("BASE_INFO").apk + getSysConfig() { + this.$API.system.config.getInfo.req().then(res=>{ + this.form = res.apk + }) }, submitForm(){ this.saveLoading = true; let obj = {} - this.configInfo.apk = this.form; obj.apk = this.form; - this.$API.system.baseInfo.updateInfo.req(obj).then((res) => { - this.$message.success("保存成功") - this.$TOOL.data.set("BASE_INFO", this.configInfo) + this.$API.system.config.updateInfo.req(obj).then((res) => { this.saveLoading = false; }).catch(res=>{ this.saveLoading = false; diff --git a/src/views/ops/settings/smsSet.vue b/src/views/ops/settings/smsSet.vue index 66a9fcde..f7ebafe3 100644 --- a/src/views/ops/settings/smsSet.vue +++ b/src/views/ops/settings/smsSet.vue @@ -32,28 +32,24 @@ export default { xn_secret:'', }, saveLoading:false, - configInfo:null, }; }, mounted() { - this.getBaseInfo(); + this.getSysConfig(); }, methods: { openPage(item) { this.page = item.index; }, - getBaseInfo() { - this.configInfo = this.$TOOL.data.get("BASE_INFO"); - this.form = this.$TOOL.data.get("BASE_INFO").sms + getSysConfig() { + this.$API.system.config.getInfo.req().then(res=>{ + this.form = res.sms + }) }, submitForm(){ this.saveLoading = true; - let obj = {} - obj.sms = this.form; - this.configInfo.sms = this.form - this.$API.system.baseInfo.updateInfo.req(obj).then((res) => { + this.$API.system.config.updateInfo.req(this.form).then((res) => { this.$message.success("保存成功") - this.$TOOL.data.set("BASE_INFO", this.configInfo) this.saveLoading = false; }).catch(res=>{ this.saveLoading = false; diff --git a/src/views/ops/settings/sysSet.vue b/src/views/ops/settings/sysSet.vue index d543b534..29b18028 100644 --- a/src/views/ops/settings/sysSet.vue +++ b/src/views/ops/settings/sysSet.vue @@ -48,29 +48,27 @@ export default { base_name: "托克逊能源管理平台", base_name_short: "托克逊能管" }, - configInfo:null, }; }, mounted() { - this.getBaseInfo(); + this.getSysConfig(); }, methods: { openPage(item) { this.page = item.index; }, - getBaseInfo() { - this.configInfo = this.$TOOL.data.get("BASE_INFO"); - this.form = this.$TOOL.data.get("BASE_INFO").base + getSysConfig() { + this.$API.system.config.getInfo.req().then(res=>{ + this.form = res.base + }) }, submitForm(){ this.saveLoading = true; let obj = {} - this.configInfo.base = this.form; obj.base = this.form; - this.$API.system.baseInfo.updateInfo.req(obj).then((res) => { + this.$API.system.config.updateInfo.req(obj).then((res) => { this.$message.success("保存成功") - this.$TOOL.data.set("BASE_INFO", this.configInfo) this.saveLoading = false; }).catch(res=>{ this.saveLoading = false;