mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
ver
This commit is contained in:
parent
837ce76895
commit
fbbd54a2b0
@ -84,12 +84,14 @@ function checkVersion() {
|
|||||||
if (rs.success) {
|
if (rs.success) {
|
||||||
verInfo.value = rs.result.version
|
verInfo.value = rs.result.version
|
||||||
// 有新版本时,左上角图标鼠标悬停显示提示(注:最新版本号的查询服务并不保证随时可用)
|
// 有新版本时,左上角图标鼠标悬停显示提示(注:最新版本号的查询服务并不保证随时可用)
|
||||||
$get(`https://glc.gotoeasy.top/glogcenter/current/version.json?v=${verInfo.value}`).then(rs => {
|
fetch(`https://glc.gotoeasy.top/glogcenter/current/version.json?v=${verInfo.value}`)
|
||||||
console.log(rs) // 结果类似 {version: 'v0.12.0'}
|
.then(response => response.json())
|
||||||
if (rs.version && verInfo.value <= rs.version) {
|
.then(data => { // 最新版本(服务不保证可用,可能查不到,仅查到有新版本时更新tip)
|
||||||
verInfo.value = `当前版本 ${verInfo.value} ,有新版本 ${rs.version} 可更新`
|
if (data.version && verInfo.value < data.version) {
|
||||||
}
|
verInfo.value = `当前版本 ${verInfo.value} ,有新版本 ${data.version} 可更新`
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
.catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user