Commit d79161e7 authored by 赵啸非's avatar 赵啸非

修改post提交对象包装

parent 16fe4b51
...@@ -81,10 +81,20 @@ instance.interceptors.response.use(response=>{ ...@@ -81,10 +81,20 @@ instance.interceptors.response.use(response=>{
* @returns * @returns
*/ */
export function post(url, option, config = {}) { export function post(url, option, config = {}) {
const data = Object.assign({}, option, { /* const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'), // __mortals_token__: cookie.getItem('__mortals_token__'),
}) })
return instance.post(url, data, config) 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{
return instance.post(url, option, 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