新增版本更新超时功能

This commit is contained in:
lyswhut
2019-09-04 00:31:34 +08:00
parent a035a2525a
commit 4cbbf2ac81
2 changed files with 22 additions and 1 deletions
+7 -1
View File
@@ -6,7 +6,13 @@ export default {
getVersionInfo() {
return new Promise((resolve, reject) => {
httpGet(`https://raw.githubusercontent.com/${author.name}/${name}/master/publish/version.json`, (err, resp, body) => {
if (err) return reject(err)
if (err) {
return resolve({
version: '0.0.0',
desc: '<h3>版本获取失败</h3><ul><li>更新信息获取失败,可能是无法访问Github导致的,请手动检查更新!</li><li>检查方法:去设置-关于洛雪音乐打开<strong>开源地址</strong>或<strong>网盘地址</strong>查看<strong>版本号</strong>与当前版本对比是否最新</li></ul>',
history: [],
})
}
resolve(body)
})
})