tianyi 4 weeks ago
parent
commit
f95be17b57
  1. 53
      App.vue

53
App.vue

@ -69,38 +69,29 @@
const baseUrl = getApp().globalData.mainurl const baseUrl = getApp().globalData.mainurl
// //
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) { uni.request({
// version: widgetInfo.version, url: baseUrl + '/setting/app-update/latest',
// name: widgetInfo.name data: {},
uni.request({ success: (res) => {
url: baseUrl + '/setting/app-update/latest', var data = res.data.result;
data: {}, if (data.url) {
success: (res) => { uni.downloadFile({
url: data.url,
var data = res.data.result; success: (downloadResult) => {
// if(data.version == widgetInfo.version){ if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult.tempFilePath, {
force: false
if (data.url) { }, function() {
uni.downloadFile({ console.log('install success...');
url: data.url, plus.runtime.restart();
success: (downloadResult) => { }, function(e) {
if (downloadResult.statusCode === 200) { console.error('install fail...',e);
plus.runtime.install(downloadResult.tempFilePath, { });
force: false }
}, function() {
console.log('install success...');
plus.runtime.restart();
}, function(e) {
console.error('install fail...',e);
});
}
}
});
} }
// } });
} }
}); }
}); });
// #endif // #endif
this.globalData._i18n = this.$i18n //$i18n this.globalData._i18n = this.$i18n //$i18n

Loading…
Cancel
Save