diff --git a/packages/fineui/src/base/single/input/file.js b/packages/fineui/src/base/single/input/file.js index c89a02e70..63278b6e0 100644 --- a/packages/fineui/src/base/single/input/file.js +++ b/packages/fineui/src/base/single/input/file.js @@ -242,14 +242,11 @@ const sendFile = (toString => { upload.onloadstart(); } } - const boundary = `AjaxUploadBoundary${new Date().getTime()}`; - xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); if (handler.file.getAsBinary) { + const boundary = `AjaxUploadBoundary${new Date().getTime()}`; + xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file)); } 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(); form.append("FileData", handler.file); xhr.send(form); diff --git a/packages/fineui/src/fix/fix.js b/packages/fineui/src/fix/fix.js index 387eb3984..ac7a8b839 100644 --- a/packages/fineui/src/fix/fix.js +++ b/packages/fineui/src/fix/fix.js @@ -929,7 +929,7 @@ function watch(model, expOrFn, cb, options) { return m; } : parsePath(exp); const v = getter.call(model, model); - if (v.__ob__) { + if (v && v.__ob__) { const dep = new Dep(); if (isGlobal) { (v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);