chore: request
- in post method reqConfig should override default headers
This commit is contained in:
@@ -73,7 +73,7 @@ export class Request {
|
|||||||
const { retRaw, upload, ...reqConfig } = option ?? {};
|
const { retRaw, upload, ...reqConfig } = option ?? {};
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.instance
|
this.instance
|
||||||
.post(url, data, { ...reqConfig, headers: { 'content-type': upload ? 'multipart/form-data' : 'application/json' } })
|
.post(url, data, { headers: { 'content-type': upload ? 'multipart/form-data' : 'application/json' }, ...reqConfig })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const resData = res.data;
|
const resData = res.data;
|
||||||
if (retRaw) {
|
if (retRaw) {
|
||||||
|
|||||||
Reference in New Issue
Block a user