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 = {
2626const _axios = axios . create ( config )
2727
2828_axios . interceptors . request . use ( ( originConfig ) => {
29+ // 有 API 请求重新计时
30+ Vue . prototype . $_lin_jump ( )
31+
2932 const reqConfig = { ...originConfig }
3033
3134 // step1: 容错处理
@@ -55,15 +58,12 @@ _axios.interceptors.request.use((originConfig) => {
5558 }
5659
5760 // 检测是否包含文件类型, 若包含则进行 formData 封装
58- // 检查子项是否有 Object 类型, 若有则字符串化
5961 let hasFile = false
6062 Object . keys ( reqConfig . data ) . forEach ( ( key ) => {
6163 if ( typeof reqConfig . data [ key ] === 'object' ) {
6264 const item = reqConfig . data [ key ]
6365 if ( item instanceof FileList || item instanceof File || item instanceof Blob ) {
6466 hasFile = true
65- } else if ( Object . prototype . toString . call ( item ) === '[object Object]' ) {
66- reqConfig . data [ key ] = JSON . stringify ( reqConfig . data [ key ] )
6767 }
6868 }
6969 } )
You can’t perform that action at this time.
0 commit comments