feat:完善功能
This commit is contained in:
@@ -106,19 +106,7 @@ const instance = axios.create({
|
||||
*/
|
||||
instance.interceptors.request.use(
|
||||
(config) => {
|
||||
// 规范写法 不可随意自定义
|
||||
let urlParams = {}
|
||||
if (config.params) {
|
||||
urlParams = {
|
||||
...config.params
|
||||
}
|
||||
}
|
||||
|
||||
config.url = config.url + '?' + qs.stringify(urlParams)
|
||||
if (
|
||||
config.data &&
|
||||
config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
)
|
||||
if (config.data && config.headers['Content-Type'] === 'application/json";charset=UTF-8')
|
||||
config.data = qs.stringify(config.data)
|
||||
return config
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user