检查更新的接口写入 env

Former-commit-id: cd231a4547c1b8487738c7251331adb946ea70ec
This commit is contained in:
liyang
2018-07-25 11:41:40 +08:00
parent f95fc7b90c
commit 59e8f6a8a8
3 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ util.logCapsule = function (title, info) {
* @param {Object} vm vue
*/
util.checkUpdate = function (vm) {
axios.get('https://api.github.com/repos/FairyEver/d2-admin/releases/latest')
if (!process.env.VUE_APP_RELEASES_API) {
return
}
axios.get(process.env.VUE_APP_RELEASES_API)
.then(res => {
let versionGet = res.tag_name
const update = semver.lt(version, versionGet)