File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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) {
3030 updateItem = item
3131 downloadsFullPath = downloadsPath + item . getFilename ( )
3232 item . setSavePath ( downloadsFullPath )
33+ console . log ( downloadsFullPath )
3334 console . log ( 'getTotalBytes' , item . getTotalBytes ( ) )
3435 item . on ( 'updated' , ( event , state ) => {
3536 if ( state === 'interrupted' ) {
@@ -67,12 +68,11 @@ module.exports = function(mainWindow, backgroundWindow) {
6768 item = null
6869 } )
6970 } )
71+ console . log ( 'uodate.url' , arg . url )
7072 if ( process . env . NODE_ENV === 'development' ) {
7173 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')
7474 } else {
75- // updateWindow.webContents.downloadURL()
75+ updateWindow . webContents . downloadURL ( arg . url )
7676 }
7777 }
7878 } )
Original file line number Diff line number Diff line change 159159 if (statusCode === 200 ) {
160160 let res = JSON .parse (response .body )
161161 /**
162- * - 1即小于,表示当前版本比服务器上的版本还要新
162+ * 1即小于,表示当前版本比服务器上的版本还要新
163163 * 0即等于,表示已是最新版
164- * 1即大于,表示有更新版本
164+ * - 1即大于,表示有更新版本
165165 */
166166 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 )
167170 if (compareResult === - 1 ) {
168171 // 由于 github 对于国内用户下载速度太慢,所以要切换至国内
169172 let downloadUrl = getDownloadUrl (res .name )
173+ console .log (downloadUrl)
170174 if (downloadUrl === undefined ) {
171175 downloadUrl = res .url
172176 }
You can’t perform that action at this time.
0 commit comments