diff --git a/config.js b/config.js index c35fa06..bd3a73d 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ // 应用全局配置 module.exports = { - baseUrl: 'https://sy.hbcjy.com/prod-api', + //baseUrl: 'https://sy.hbcjy.com/prod-api', // baseUrl: 'http://127.0.0.1:48080', - // baseUrl: 'http://192.168.130.193:48080', + baseUrl: 'http://192.168.130.193:48080', baseApi: '/admin-api', // 应用信息 appInfo: { diff --git a/pages/index.vue b/pages/index.vue index ec6d87a..9eb45a1 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -7,8 +7,8 @@ - {{ BaseInfo.baseName }} - 负责人:{{ BaseInfo.baseLeader }} + {{ baseName }} + 负责人:{{ baseLeader }} @@ -178,15 +178,27 @@ baseId: this.$store.state.user.baseId, BaseInfo: null, ProductData: null, - ProductCode: null + ProductCode: null, + baseName: null, + baseLeader: null, } }, watch: { "$store.state.user.baseId"(newValue, oldVal) { - console.log("AAAA",newValue) - this.baseId=newValue + this.baseId = newValue this.getBaseData() - } + }, + "$store.state.user.baseName": { + handler(newVal) { + this.baseName = newVal + }, + }, + "$store.state.user.baseLeader": { + handler(newVal) { + this.baseLeader = newVal + }, + + }, }, onLoad: function() { this.getBaseData() @@ -195,13 +207,15 @@ }, methods: { // 获取基地数据 - async getBaseData() { + async getBaseData() { try { let params = { id: this.baseId } const res = await indexApi.getAllBaseInfo(params) this.BaseInfo = res.data + this.baseName = this.BaseInfo.baseName + this.baseLeader = this.BaseInfo.baseLeader } finally {} }, diff --git a/pages/login.vue b/pages/login.vue index a7fd5d2..8cc3ee6 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -1,9 +1,13 @@