Commit 83afc5db authored by 赵啸非's avatar 赵啸非

修改post提交对象包装

parent d79161e7
......@@ -81,20 +81,16 @@ instance.interceptors.response.use(response=>{
* @returns
*/
export function post(url, option, config = {}) {
/* const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)*/
//判断object是数组还是对象
if(Object.getPrototypeOf(option) === Object.prototype){
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
}else{
if(Object.getPrototypeOf(option) === Array.prototype){
return instance.post(url, option, config)
}
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment