更新新版本获取地址

This commit is contained in:
lyswhut
2023-08-30 13:01:27 +08:00
parent 903ca18b75
commit 358142c1cc
8 changed files with 92 additions and 40 deletions
+5 -2
View File
@@ -69,7 +69,7 @@ export default () => {
const handleGetVersionInfo = async(): Promise<NonNullable<typeof versionInfo['newVersion']>> => {
return (versionInfo.newVersion?.history && !versionInfo.reCheck
? Promise.resolve(versionInfo.newVersion)
: getVersionInfo().then(body => {
: getVersionInfo().then((body: any) => {
versionInfo.newVersion = body
return body
})
@@ -102,7 +102,10 @@ export default () => {
if (result.version == '0.0.0') {
versionInfo.isUnknown = true
versionInfo.status = 'error'
versionInfo.showModal = true
let ignoreFailTipTime = parseInt(localStorage.getItem('update__check_failed_tip') ?? '0')
if (Date.now() - ignoreFailTipTime > 7 * 86400000) {
versionInfo.showModal = true
}
return
}
versionInfo.isUnknown = false