Skip to content

Commit 04e4437

Browse files
committed
v3.3
1 parent ae1298d commit 04e4437

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

resources/assets/component.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,27 @@ window.ComponentPlane = class {
10051005
element.innerText = '提交中...';
10061006
let form = this.MODEL_BODY_DOM.getElementsByTagName('form')[0];
10071007
let formdata = new FormData(form);
1008+
for (const pair of formdata.entries()) {
1009+
let key = pair[0];
1010+
let val = pair[1];
1011+
if(/\[.*\]/.test(key) && /\[.*\]/.test(val)){
1012+
val = JSON.parse(val);
1013+
if(Array.isArray(val) && val.length>0){
1014+
val.forEach((v)=>{
1015+
formdata.append(`${key}[]`,v);
1016+
});
1017+
}else {
1018+
formdata.append(`${key}`,'');
1019+
}
1020+
}
1021+
}
1022+
10081023
_component.request(this.XHR.url, this.XHR.method, formdata, (response) => {
10091024
if (typeof this.XHR.callback == 'function') {
10101025
this.XHR.callback(response);
10111026
return;
10121027
}
1028+
if(!response)return;
10131029
if (response.code === 0) {
10141030
window.location.reload();
10151031
} else {
@@ -1938,4 +1954,4 @@ window.ComponentCascadeLine = class {
19381954
this.dimensional_data[stack].splice(d, 1);
19391955
});
19401956
}
1941-
};
1957+
};

0 commit comments

Comments
 (0)