diff --git a/src/utils/http.ts b/src/utils/http.ts index d46535a..afa1eaf 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -84,6 +84,41 @@ export const httpPost = ( header, }) } +/** + * PUT 请求 + */ +export const httpPut = ( + url: string, + data?: Record, + query?: Record, + header?: Record, +) => { + return http({ + url, + data, + query, + method: 'PUT', + header, + }) +} + +/** + * DELETE 请求(无请求体,仅 query) + */ +export const httpDelete = ( + url: string, + query?: Record, + header?: Record, +) => { + return http({ + url, + query, + method: 'DELETE', + header, + }) +} http.get = httpGet http.post = httpPost +http.put = httpPut +http.delete = httpDelete