请求头多语言参数-版本号显示

This commit is contained in:
2023-12-05 14:48:56 +08:00
parent bd32e62fc4
commit a5e336ea6a
3 changed files with 11 additions and 2 deletions

View File

@@ -19,3 +19,4 @@ const app = new Vue({
})
app.$mount()
export default app;

View File

@@ -96,7 +96,7 @@
></view>
</view>
<view class="version_box">
<view> V1.2.0</view>
<view> V{{newVersion}}</view>
</view>
</view>
</template>
@@ -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(',');

View File

@@ -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