Преглед изворни кода

pdf文件上传报错的问题

xiaohaizhao пре 1 година
родитељ
комит
c004a2178f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      components/My_upload/index.js

+ 1 - 1
components/My_upload/index.js

@@ -81,7 +81,7 @@ Component({
                 method: "PUT",
                 data: data,
                 header: {
-                    'content-type': 'application/octet-stream'
+                    'content-type': res.filetype == 'pdf' ? "application/pdf" : 'application/octet-stream'
                 },
                 success(a) {
                     _Http.basic({