Commit 65eb89b7 authored by leiqingsong's avatar leiqingsong

修改接口执行顺序

parent 526414ca
......@@ -112,16 +112,20 @@ class bridgeToAppFun {
if (this.userAgent === "android") {
console.log("an");
version = window.android.getAppVersion();
return version;
} else {
console.log("ios获取版本号");
jsBridge.callhandler("getAppVersion", null, response => {
if (response) {
console.log("版本号,获取到的数据", response);
version = response;
}
return new Promise((resolve, reject) => {
jsBridge.callhandler("getAppVersion", null, response => {
if (response) {
console.log("版本号,获取到的数据", response);
resolve(response);
} else {
reject("ios获取版本号失败");
}
});
});
}
return version;
}
}
......
......@@ -123,7 +123,13 @@ export default {
},
async getAppVersion() {
console.log("设置里获取到的版本号", this.$bridgeToAppFun.getAppVersion());
this.version = "版本" + (await this.$bridgeToAppFun.getAppVersion());
if (this.$bridgeToAppFun.userAgent === "ios") {
this.$bridgeToAppFun.getAppVersion().then(res => {
this.version = "版本" + res;
});
} else {
this.version = "版本" + this.$bridgeToAppFun.getAppVersion();
}
},
getUser() {
const params = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment