fix: fix the bug of upload without global.urlparam.nodeAddr

This commit is contained in:
Frank.R.Wu 2021-06-20 21:28:25 +08:00
parent 0b15e58938
commit 79ec02eeb1

View File

@ -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