tianyi 1 month ago
parent
commit
63053674e0
  1. 58
      App.vue

58
App.vue

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

Loading…
Cancel
Save