diff --git a/main.js b/main.js index beaec72..650453e 100644 --- a/main.js +++ b/main.js @@ -19,3 +19,4 @@ const app = new Vue({ }) app.$mount() +export default app; diff --git a/pages/index/index.vue b/pages/index/index.vue index df11b1b..8bb9837 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -96,7 +96,7 @@ > - V1.2.0 + V{{newVersion}} @@ -122,6 +122,7 @@ export default { }, machineId: "", store_obj: {}, + newVersion:'', }; }, onShow() { @@ -131,6 +132,9 @@ export default { uni.showLoading(); // #ifdef APP-PLUS + // console.log('eeeeee',uni.getSystemInfoSync().appWgtVersion); + this.newVersion = uni.getSystemInfoSync().appWgtVersion; + let imelSet = [] var Build = plus.android.importClass("android.os.Build"); var SystemProperties = plus.android.importClass("android.os.SystemProperties"); @@ -144,6 +148,7 @@ export default { plus.device.getInfo({ success: (e) => { + const imei = e.imei.split(","); imelSet.push(imei[0]) this.machineId = imelSet.join(','); diff --git a/util/api.js b/util/api.js index 875c4f5..f710ad3 100644 --- a/util/api.js +++ b/util/api.js @@ -1,10 +1,13 @@ import config from "@/common/config"; +import _this from "../main.js"; //1、首先创建一个工具包utils //2、创建一个api.js文件 //3、编写api.js内容: //创建一个常量 conset BASE_URL作为默认url地址 +// console.log('语言',_this.$i18n.locale); + export const myRequest = (option) => { //将封装好的函数导入出去 return new Promise((resolve, reject) => { @@ -14,7 +17,7 @@ export const myRequest = (option) => { method: option.method || "GET", //请求方法 header: option.header || { // 根据实际接口设计 key 取 token 或者 authorization - lang: "zh-CN", + lang: _this.$i18n.locale || "zh-CN", // #ifdef MP-WEIXIN app_type: "miniprogram", // #endif