fetch(add): 订单管理-企业设备
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m30s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m30s
This commit is contained in:
@@ -222,10 +222,11 @@ function handleErrorMessage(error: any, mode: ErrorMessageMode = 'message') {
|
||||
async function request<T = any>(config: ExtendedRequestConfig): Promise<T> {
|
||||
const processedConfig = processRequestConfig(config)
|
||||
|
||||
// 对 POST | PUT 请求特殊处理
|
||||
// 对 POST | PUT | PATCH 请求特殊处理
|
||||
if (
|
||||
processedConfig.method?.toUpperCase() === 'POST' ||
|
||||
processedConfig.method?.toUpperCase() === 'PUT'
|
||||
processedConfig.method?.toUpperCase() === 'PUT' ||
|
||||
processedConfig.method?.toUpperCase() === 'PATCH'
|
||||
) {
|
||||
// 如果已经有 data,则保留原有的 data
|
||||
if (processedConfig.params && !processedConfig.data) {
|
||||
@@ -258,6 +259,9 @@ const api = {
|
||||
put<T>(config: ExtendedRequestConfig): Promise<T> {
|
||||
return request({ ...config, method: 'PUT' }) // PUT 请求
|
||||
},
|
||||
patch<T>(config: ExtendedRequestConfig): Promise<T> {
|
||||
return request({ ...config, method: 'PATCH' }) // PATCH 请求
|
||||
},
|
||||
del<T>(config: ExtendedRequestConfig): Promise<T> {
|
||||
return request({ ...config, method: 'DELETE' }) // DELETE 请求
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user