mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
example fecher headers fix
This commit is contained in:
parent
bd5b6dd840
commit
cc4ae79210
@ -92,7 +92,10 @@ export default function(schema) {
|
||||
router.push(to);
|
||||
}
|
||||
},
|
||||
fetcher: ({url, method, data, config}) => {
|
||||
fetcher: ({url, method, data, config, headers}) => {
|
||||
config = config || {};
|
||||
config.headers = headers || {};
|
||||
|
||||
if (data && data instanceof FormData) {
|
||||
// config.headers = config.headers || {};
|
||||
// config.headers['Content-Type'] = 'multipart/form-data';
|
||||
@ -103,8 +106,6 @@ export default function(schema) {
|
||||
!(data instanceof ArrayBuffer)
|
||||
) {
|
||||
data = JSON.stringify(data);
|
||||
config = config || {};
|
||||
config.headers = config.headers || {};
|
||||
config.headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user