Browse Source

Merge pull request #264651 in DEC/fineui from release/11.0 to bugfix/11.0

* commit '9d5e6f0c5a3de55e81736bac9f4d01340e21f205':
  BI-143459 fix: 修复请求头boundary与formData中WebKitFormBoundary不一致问题
  BI-143696 fix: 对象.**容错
  BI-143459 fix: 修复请求头boundary与formData中WebKitFormBoundary不一致问题
research/test
superman 9 months ago
parent
commit
ae8f5a80bb
  1. 5
      packages/fineui/src/base/single/input/file.js
  2. 2
      packages/fineui/src/fix/fix.js

5
packages/fineui/src/base/single/input/file.js

@ -242,14 +242,11 @@ const sendFile = (toString => {
upload.onloadstart(); upload.onloadstart();
} }
} }
if (handler.file.getAsBinary) {
const boundary = `AjaxUploadBoundary${new Date().getTime()}`; const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
if (handler.file.getAsBinary) {
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file)); xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file));
} else { } else {
xhr.setRequestHeader("Content-Type", "multipart/form-data");
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
const form = new FormData(); const form = new FormData();
form.append("FileData", handler.file); form.append("FileData", handler.file);
xhr.send(form); xhr.send(form);

2
packages/fineui/src/fix/fix.js

@ -929,7 +929,7 @@ function watch(model, expOrFn, cb, options) {
return m; return m;
} : parsePath(exp); } : parsePath(exp);
const v = getter.call(model, model); const v = getter.call(model, model);
if (v.__ob__) { if (v && v.__ob__) {
const dep = new Dep(); const dep = new Dep();
if (isGlobal) { if (isGlobal) {
(v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep); (v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);

Loading…
Cancel
Save