File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,6 +280,8 @@ class Request {
280280
281281 const config = {
282282 method : "GET" ,
283+ credentials : "include" ,
284+ mode : "cors" ,
283285 headers : {
284286 ...this . defaultHeaders ,
285287 ...options . headers ,
@@ -299,6 +301,8 @@ class Request {
299301 async post ( url , data = { } , options = { } ) {
300302 let config = {
301303 method : "POST" ,
304+ credentials : "include" ,
305+ mode : "cors" ,
302306 headers : {
303307 ...this . defaultHeaders ,
304308 ...options . headers ,
@@ -311,6 +315,8 @@ class Request {
311315 if ( isFormData ) {
312316 config = {
313317 method : "POST" ,
318+ credentials : "include" ,
319+ mode : "cors" ,
314320 headers : {
315321 ...options . headers , // FormData不需要Content-Type
316322 } ,
@@ -330,6 +336,8 @@ class Request {
330336 async put ( url , data = null , options = { } ) {
331337 const config = {
332338 method : "PUT" ,
339+ credentials : "include" ,
340+ mode : "cors" ,
333341 headers : {
334342 ...this . defaultHeaders ,
335343 ...options . headers ,
You can’t perform that action at this time.
0 commit comments