feat: 版本更新
This commit is contained in:
@@ -14,13 +14,39 @@ import {
|
||||
import {
|
||||
debounce
|
||||
} from '@/utils/common'
|
||||
import { createHotUpdate, createLoadingProgress } from '@/utils/hotUpdate'
|
||||
import { gethotupdatelist } from '@/sheep/api/index/index'
|
||||
|
||||
|
||||
|
||||
export function createApp() {
|
||||
|
||||
const hotUpdate = createHotUpdate({
|
||||
progress: createLoadingProgress(),
|
||||
apkMode: 'download',
|
||||
getLatest: gethotupdatelist,
|
||||
})
|
||||
|
||||
uni.__globalHotUpdateCheck = (options = {}) => {
|
||||
const force = !!options?.force
|
||||
if (!force && uni.__hotUpdateCheckedOnce) return
|
||||
uni.__hotUpdateCheckedOnce = true
|
||||
return hotUpdate.checkUpdate({ allowSkipPrompt: true })
|
||||
}
|
||||
|
||||
const app = createSSRApp(App);
|
||||
|
||||
app.mixin({
|
||||
onShow() {
|
||||
if (typeof uni.__globalHotUpdateCheck === 'function') {
|
||||
uni.__globalHotUpdateCheck({ force: true, source: 'pageShow' })
|
||||
}
|
||||
},
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (typeof uni.__globalHotUpdateCheck === 'function') uni.__globalHotUpdateCheck({ source: 'boot' })
|
||||
}, 0)
|
||||
|
||||
setupPinia(app);
|
||||
app.config.globalProperties.$url = 'https://sycbuck.oss-cn-hangzhou.aliyuncs.com/app/'
|
||||
app.config.globalProperties.$ygUrl = 'https://swzhyg.oss-cn-hangzhou.aliyuncs.com/static/'
|
||||
@@ -32,4 +58,4 @@ export function createApp() {
|
||||
return {
|
||||
app,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user