From 79ec02eeb10db30cbdcd8fb46263d632ffc5eb62 Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Sun, 20 Jun 2021 21:28:25 +0800 Subject: [PATCH] fix: fix the bug of upload without global.urlparam.nodeAddr --- js/onlineide/leftmenu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/onlineide/leftmenu.js b/js/onlineide/leftmenu.js index 40f1541..23b1365 100644 --- a/js/onlineide/leftmenu.js +++ b/js/onlineide/leftmenu.js @@ -646,10 +646,11 @@ var uploadInternal = function () { var sign = sm2.doSignature(arg, global.sm2Key.privateKey, {hash: true, der: true}); console.log(sign) arg += "&sign=" + sign; + const url = `${global.urlparam && global.urlparam.nodeAddr ? + (location.href.startsWith('https') ? 'https://' : 'http://') + global.urlparam.nodeAddr : + '.'}/Upload?${arg}`; $.ajax({ - url: `${global.urlparam ? - (location.href.startsWith('https') ? 'https://' : 'http://') + global.urlparam.nodeAddr : - '.'}/Upload?${arg}`, + url: url, type: 'POST', data: fd, processData: false, // tell jQuery not to process the data