File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ const config = {
26
26
const _axios = axios . create ( config )
27
27
28
28
_axios . interceptors . request . use ( ( originConfig ) => {
29
+ // 有 API 请求重新计时
30
+ Vue . prototype . $_lin_jump ( )
31
+
29
32
const reqConfig = { ...originConfig }
30
33
31
34
// step1: 容错处理
@@ -55,15 +58,12 @@ _axios.interceptors.request.use((originConfig) => {
55
58
}
56
59
57
60
// 检测是否包含文件类型, 若包含则进行 formData 封装
58
- // 检查子项是否有 Object 类型, 若有则字符串化
59
61
let hasFile = false
60
62
Object . keys ( reqConfig . data ) . forEach ( ( key ) => {
61
63
if ( typeof reqConfig . data [ key ] === 'object' ) {
62
64
const item = reqConfig . data [ key ]
63
65
if ( item instanceof FileList || item instanceof File || item instanceof Blob ) {
64
66
hasFile = true
65
- } else if ( Object . prototype . toString . call ( item ) === '[object Object]' ) {
66
- reqConfig . data [ key ] = JSON . stringify ( reqConfig . data [ key ] )
67
67
}
68
68
}
69
69
} )
You can’t perform that action at this time.
0 commit comments