update at 2026-02-10 14:10:20
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { buildRuntimeConfig } = require('./config/server')
|
||||
const { bootstrapRoute, checkRouteOnShow } = require('./utils/mp/route-manager')
|
||||
|
||||
const runtimeConfig = buildRuntimeConfig()
|
||||
|
||||
@@ -8,5 +9,20 @@ App({
|
||||
apiTimeoutMs: 30000,
|
||||
fonts: null,
|
||||
defaultConfig: null,
|
||||
routeReadyPromise: null,
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
this.globalData.routeReadyPromise = bootstrapRoute(this)
|
||||
.catch((error) => {
|
||||
console.warn('[app] 路由初始化失败,使用当前配置继续运行:', error)
|
||||
return null
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
checkRouteOnShow(this).catch((error) => {
|
||||
console.warn('[app] 回前台路由检查失败:', error)
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user