File tree 3 files changed +9
-26
lines changed
3 files changed +9
-26
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ module.exports = function(mainWindow, backgroundWindow) {
30
30
updateItem = item
31
31
downloadsFullPath = downloadsPath + item . getFilename ( )
32
32
item . setSavePath ( downloadsFullPath )
33
+ console . log ( downloadsFullPath )
33
34
console . log ( 'getTotalBytes' , item . getTotalBytes ( ) )
34
35
item . on ( 'updated' , ( event , state ) => {
35
36
if ( state === 'interrupted' ) {
@@ -67,12 +68,11 @@ module.exports = function(mainWindow, backgroundWindow) {
67
68
item = null
68
69
} )
69
70
} )
71
+ console . log ( 'uodate.url' , arg . url )
70
72
if ( process . env . NODE_ENV === 'development' ) {
71
73
updateWindow . webContents . downloadURL ( arg . url )
72
- console . log ( arg . url )
73
- // updateWindow.webContents.downloadURL('https://jdc.jd.com/lab/xcel/xcel/XCel-darwin-x64.zip')
74
74
} else {
75
- // updateWindow.webContents.downloadURL()
75
+ updateWindow . webContents . downloadURL ( arg . url )
76
76
}
77
77
}
78
78
} )
Original file line number Diff line number Diff line change 159
159
if (statusCode === 200 ) {
160
160
let res = JSON .parse (response .body )
161
161
/**
162
- * - 1即小于,表示当前版本比服务器上的版本还要新
162
+ * 1即小于,表示当前版本比服务器上的版本还要新
163
163
* 0即等于,表示已是最新版
164
- * 1即大于,表示有更新版本
164
+ * - 1即大于,表示有更新版本
165
165
*/
166
166
let compareResult = compareVersions (appInfo .app_version , res .name )
167
+ console .log (' compareResult' , compareResult)
168
+ console .log (' appInfo.app_version' , appInfo .app_version )
169
+ console .log (' res.name' , res .name )
167
170
if (compareResult === - 1 ) {
168
171
// 由于 github 对于国内用户下载速度太慢,所以要切换至国内
169
172
let downloadUrl = getDownloadUrl (res .name )
173
+ console .log (downloadUrl)
170
174
if (downloadUrl === undefined ) {
171
175
downloadUrl = res .url
172
176
}
You can’t perform that action at this time.
0 commit comments