fix: sysconfig修改

This commit is contained in:
caoqianming 2023-12-20 21:56:44 +08:00
parent 27282570e9
commit b1bd32cca0
7 changed files with 38 additions and 50 deletions

View File

@ -4,15 +4,6 @@ import data from './../../../src/utils/baseJson';
const baseInFo = data[data.current]; const baseInFo = data[data.current];
export default { export default {
config:{
base: {
url: `${config.API_URL}/system/base_config/`,
name: "账户信息",
req: async function(){
return await http.get(this.url);
}
},
},
// config:{ // config:{
// base: { // base: {
// url: `${config.API_URL}/system/base_config/`, // 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: { getInfo: {
url: `${config.API_URL}/system/config/`, url: `${config.API_URL}/system/config/`,
name: "获取系统信息", name: "获取系统信息",

View File

@ -235,9 +235,9 @@
return baseName; return baseName;
}, },
baseLogo(){ baseLogo(){
let baseInFo = data[data.current]; // 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 = 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 base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png';
return base_logo return base_logo
}, },
ismobile(){ ismobile(){

View File

@ -46,9 +46,9 @@
<el-button type="default" @click="h5Show">H5访问</el-button> <el-button type="default" @click="h5Show">H5访问</el-button>
<el-button type="primary" @click="MonitorOpen" style="background-color:orange;border-color:orange">监控视频</el-button> <el-button type="primary" @click="MonitorOpen" style="background-color:orange;border-color:orange">监控视频</el-button>
</div> </div>
<div class="login-oauth" v-else> <!-- <div class="login-oauth" v-else>
<el-button type="default" @click="faceLogin">刷脸登录</el-button> <el-button type="default" @click="faceLogin">刷脸登录</el-button>
</div> </div> -->
</div> </div>
</div> </div>
</div> </div>

View File

@ -7,10 +7,10 @@
<div class="user-info-top"> <div class="user-info-top">
<el-avatar <el-avatar
:size="100" :size="100"
:src="$store.state.global.baseLogo" :src="form.base_logo"
shape="square" shape="square"
></el-avatar> ></el-avatar>
<h3>{{ $store.state.global.baseName }}</h3> <h3>{{ form.base_name }}</h3>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -63,6 +63,7 @@ export default {
}, },
data() { data() {
return { return {
form: {},
menu: [ menu: [
{ {
groupName: "系统配置", groupName: "系统配置",
@ -106,18 +107,16 @@ export default {
}); });
}, },
mounted() { mounted() {
this.getBaseInfo(); this.getSysConfig();
}, },
methods: { methods: {
openPage(item) { openPage(item) {
this.page = item.index; this.page = item.index;
}, },
getBaseInfo() { getSysConfig() {
this.$API.system.baseInfo.getInfo.req().then((res) => { this.$API.system.config.getInfo.req().then(res=>{
debugger; this.form = res.base
console.log(res)
this.$TOOL.data.set("BASE_INFO", res)
}) })
}, },
}, },

View File

@ -36,25 +36,22 @@ export default {
apk_file:'', apk_file:'',
apk_remark:'', apk_remark:'',
}, },
configInfo:null,
}; };
}, },
mounted(){ mounted(){
this.getBaseInfo() this.getSysConfig();
}, },
methods:{ methods:{
getBaseInfo() { getSysConfig() {
this.configInfo = this.$TOOL.data.get("BASE_INFO"); this.$API.system.config.getInfo.req().then(res=>{
this.form = this.$TOOL.data.get("BASE_INFO").apk this.form = res.apk
})
}, },
submitForm(){ submitForm(){
this.saveLoading = true; this.saveLoading = true;
let obj = {} let obj = {}
this.configInfo.apk = this.form;
obj.apk = this.form; obj.apk = 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; this.saveLoading = false;
}).catch(res=>{ }).catch(res=>{
this.saveLoading = false; this.saveLoading = false;

View File

@ -32,28 +32,24 @@ export default {
xn_secret:'', xn_secret:'',
}, },
saveLoading:false, saveLoading:false,
configInfo:null,
}; };
}, },
mounted() { mounted() {
this.getBaseInfo(); this.getSysConfig();
}, },
methods: { methods: {
openPage(item) { openPage(item) {
this.page = item.index; this.page = item.index;
}, },
getBaseInfo() { getSysConfig() {
this.configInfo = this.$TOOL.data.get("BASE_INFO"); this.$API.system.config.getInfo.req().then(res=>{
this.form = this.$TOOL.data.get("BASE_INFO").sms this.form = res.sms
})
}, },
submitForm(){ submitForm(){
this.saveLoading = true; this.saveLoading = true;
let obj = {} this.$API.system.config.updateInfo.req(this.form).then((res) => {
obj.sms = this.form;
this.configInfo.sms = this.form
this.$API.system.baseInfo.updateInfo.req(obj).then((res) => {
this.$message.success("保存成功") this.$message.success("保存成功")
this.$TOOL.data.set("BASE_INFO", this.configInfo)
this.saveLoading = false; this.saveLoading = false;
}).catch(res=>{ }).catch(res=>{
this.saveLoading = false; this.saveLoading = false;

View File

@ -48,29 +48,27 @@ export default {
base_name: "托克逊能源管理平台", base_name: "托克逊能源管理平台",
base_name_short: "托克逊能管" base_name_short: "托克逊能管"
}, },
configInfo:null,
}; };
}, },
mounted() { mounted() {
this.getBaseInfo(); this.getSysConfig();
}, },
methods: { methods: {
openPage(item) { openPage(item) {
this.page = item.index; this.page = item.index;
}, },
getBaseInfo() { getSysConfig() {
this.configInfo = this.$TOOL.data.get("BASE_INFO"); this.$API.system.config.getInfo.req().then(res=>{
this.form = this.$TOOL.data.get("BASE_INFO").base this.form = res.base
})
}, },
submitForm(){ submitForm(){
this.saveLoading = true; this.saveLoading = true;
let obj = {} let obj = {}
this.configInfo.base = this.form;
obj.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.$message.success("保存成功")
this.$TOOL.data.set("BASE_INFO", this.configInfo)
this.saveLoading = false; this.saveLoading = false;
}).catch(res=>{ }).catch(res=>{
this.saveLoading = false; this.saveLoading = false;