fix(http): 更新接口请求方式及环境配置
- 修改.env文件,切换为zhisheng预发布环境变量 - 将outFpmArrangeOrder接口请求改为使用putJson,支持json格式请求体 - 在http.interceptor.js中新增putJson方法,封装带json请求头的PUT请求接口 - 统一接口请求方式,确保请求头为application/json,提高接口兼容性和稳定性
This commit is contained in:
@@ -140,7 +140,17 @@ const install = (Vue, vm) => {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 封装 post json 请求
|
||||
vm.$u.putJson = (url, data = {}, header = {}) => {
|
||||
console.log('header', header, url, vm.$u)
|
||||
header['content-type'] = 'application/json';
|
||||
return vm.$u.http.request({
|
||||
url,
|
||||
method: 'PUT',
|
||||
header,
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user