From a5e336ea6a5d3c1d0e71437d47d360d1d85fd8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=A3=8A?= <468619417@qq.com> Date: Tue, 5 Dec 2023 14:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=8F=82=E6=95=B0-=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 1 + pages/index/index.vue | 7 ++++++- util/api.js | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) 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