张恒

修改自动更新部分

......@@ -23,13 +23,9 @@
"publish": [
{
"provider": "generic",
"url": "http://127.0.0.1:25565/"
"url": "http://127.0.0.1"
}
],
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"productName": "electron-vue-admin",
"appId": "org.simulatedgreg.electron-vue",
"directories": {
......@@ -57,7 +53,16 @@
"icon": "build/icons/icon.icns"
},
"win": {
"icon": "build/icons/icon.ico"
"icon": "build/icons/icon.ico",
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
]
},
"linux": {
"icon": "build/icons"
......
version: 6.0.13
version: 6.1.1
files:
- url: electron-vue-admin Setup 0.0.1.exe
sha512: 6higqp9mFJANIRdE59Cyl/3CgaWuHZU92EaRUfwTjXPi9b/OH/ndiLNhK8AgWB9JIz57xBwnmgXl+eT0xAjUGw==
......
var express = require('express')
var fs = require('fs')
const path = require('path')
var app = express()
app.use(express.static(path.join(__dirname, './client')))
var server = app.listen(25565, function () {
var host = server.address().address;
var port = server.address().port;
var host = server.address().address
var port = server.address().port
console.log('Example app listening at http://%s:%s', host, port);
});
\ No newline at end of file
console.log('服务启动', host, port)
})
......
......@@ -19,8 +19,10 @@ export default {
// 当更新发生错误的时候触发。
autoUpdater.on('error', (err) => {
console.log('更新出现错误')
console.log(err)
Message(mainWindow, -1, err)
console.log(err.message)
if (err.message.includes('sha512 checksum mismatch')) {
Message(mainWindow, -1, 'sha512校验失败')
}
})
// 当开始检查更新的时候触发
......@@ -53,7 +55,9 @@ export default {
})
// 执行自动更新检查
ipcMain.on('check-update', () => {
autoUpdater.checkForUpdates()
autoUpdater.checkForUpdates().catch(err => {
console.log('网络连接问题', err)
})
})
// 渲染进程执行更新操作
ipcMain.on('confirm-update', () => {
......
......@@ -116,8 +116,7 @@ export default {
switch (data.state) {
case -1:
const msgdata = {
title: "警告",
message: "更新检查失败!"
title: data.msg,
};
api.MessageBox(dialog, msgdata);
break;
......