Commit 695fa365 by sunchao

热部署调试

parent cb6ceaa0
<script> <script>
import initApp from "@/util/router.js"; import initApp from "@/util/router.js";
import {baseURL,apiURL,cffpURL} from "@/environments/environment";
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch'); console.log('App Launch');
// #ifdef APP-PLUS // #ifdef APP-PLUS
// uni.downloadFile({
// url: '/cffpUpdate/__UNI__ED34740.wgt',
// success: (downloadResult) => {
// if (downloadResult.statusCode === 200) {
// plus.runtime.install(downloadResult.tempFilePath, {
// force: true
// }, function() {
// console.log('install success...');
// plus.runtime.restart();
// }, function(e) {
// console.error('install fail...');
// });
// }
// }
// });
// #endif
// #ifdef APP-PLUS
uni.getSystemInfo({
success:(systemInfo)=> {
uni.request({
url: `${baseURL}/api/appVersion/checkIsUpdate`,
method:'POST',
data: {
appType: 1,
version: systemInfo.appVersion,
systemType:systemInfo.osName.toLowerCase() === 'ios' ? 2 : 1
},
success: (result) => {
const data = result.data.data['appVersionInfo'];
if (data.isForceUpdate && data.wgtUrl) {
uni.downloadFile({ uni.downloadFile({
url: '/cffpUpdate/__UNI__ED34740.wgt', url: `${baseURL}${data.wgtUrl}`,
success: (downloadResult) => { success: (downloadResult) => {
if (downloadResult.statusCode === 200) { if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult.tempFilePath, { plus.runtime.install(downloadResult.tempFilePath, {
...@@ -19,47 +50,19 @@ ...@@ -19,47 +50,19 @@
} }
} }
}); });
}
}
});
}
})
// #endif // #endif
// uni.getSystemInfo({
// success:(systemInfo)=> {
// uni.request({
// url: '/api/appVersion/checkIsUpdate',
// method:'POST',
// data: {
// appType: 1,
// version: systemInfo.appVersion,
// systemType:systemInfo.osName.toLowerCase() === 'ios' ? 2 : 1
// },
// success: (result) => {
// const data = result.data.data['appVersionInfo'];
// if (data.isForceUpdate && data.wgtUrl) {
// uni.downloadFile({
// url: data.wgtUrl,
// success: (downloadResult) => {
// if (downloadResult.statusCode === 200) {
// plus.runtime.install(downloadResult.tempFilePath, {
// force: true
// }, function() {
// console.log('install success...');
// plus.runtime.restart();
// }, function(e) {
// console.error('install fail...');
// });
// }
// }
// });
// }
// }
// });
// }
// })
initApp() initApp()
// this.checkArguments(); // this.checkArguments();
// plus.globalEvent.addEventListener('newintent', e => { // plus.globalEvent.addEventListener('newintent', e => {
//   this.checkArguments(); // 检测启动参数 //   this.checkArguments(); // 检测启动参数
//  }); //  });
}, },
onShow: function() { onShow: function() {3,
console.log('App Show') console.log('App Show')
}, },
onHide: function() { onHide: function() {
......
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