Skip to content

Commit cdbe98c

Browse files
authored
Temp fix (#251)
* feat: 修改集合返回字段 * fix(axios.js): optimize request interceptor
1 parent dfb67e7 commit cdbe98c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lin/plugins/axios.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const config = {
2626
const _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
})

0 commit comments

Comments
 (0)