-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (21 loc) · 747 Bytes
/
Copy pathapp.js
File metadata and controls
24 lines (21 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gulpError from './utils/gulpError';
const storage = require('./utils/storage');
const fuelMigration = require('./utils/migrate-fuel-consumption');
App({
onLaunch() {
// 执行多车辆数据迁移(只在首次运行时执行)
const result = storage.migrateToMultiVehicle();
if (result.success && !result.skipped) {
console.log('多车辆数据迁移成功', result);
}
// 执行油耗计算迁移(自动检测并执行一次)
fuelMigration.autoMigrate();
},
onShow() {
if (gulpError !== 'gulpErrorPlaceHolder') {
wx.redirectTo({
url: `/pages/gulp-error/index?gulpError=${gulpError}`,
});
}
},
});