|
@@ -30,7 +30,7 @@ axios.interceptors.request.use((config) => {
|
|
|
} else if (config.data && config.data[0].post === '1' && config.method === 'post') {
|
|
|
// 如果 data 的第一个元素 post 值为 '1',则进行自定义序列化
|
|
|
config.data = 'mode=' + Object.values(config.data[0]).join(',');
|
|
|
- } else if (config.method === 'post') {
|
|
|
+ } else if (config.method === 'post' && config.data) {
|
|
|
// 处理其他 post 请求的参数序列化
|
|
|
const encoded = {};
|
|
|
for (const key in config.data[0]) {
|