Explorar o código

修正DELETE请求方法request时body参数无效的BUG

zbz %!s(int64=7) %!d(string=hai) anos
pai
achega
27a2353c93
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/utils/request.js

+ 1 - 1
src/utils/request.js

@@ -47,7 +47,7 @@ export default function request(url, options) {
     credentials: 'include',
   };
   const newOptions = { ...defaultOptions, ...options };
-  if (newOptions.method === 'POST' || newOptions.method === 'PUT') {
+  if (newOptions.method === 'POST' || newOptions.method === 'PUT' || newOptions.method === 'DELETE') {
     if (!(newOptions.body instanceof FormData)) {
       newOptions.headers = {
         Accept: 'application/json',