路径规划打点完成 点击任务获取 路径轨迹
This commit is contained in:
@@ -408,15 +408,12 @@ export function addRoute(data) {
|
||||
const config = {
|
||||
url: '/iot/workRecord/add', // 修正为正确的添加接口
|
||||
method: 'post',
|
||||
data
|
||||
data,
|
||||
timeout: 60000,
|
||||
|
||||
};
|
||||
|
||||
// 如果是 FormData,不需要设置 Content-Type,axios 会自动设置
|
||||
if (!(data instanceof FormData)) {
|
||||
config.headers = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return request(config);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ api.interceptors.request.use(
|
||||
if (token && config.headers) {
|
||||
config.headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
if (!(config.data instanceof FormData)) {
|
||||
config.headers['Content-Type'] = 'application/json';
|
||||
} else {
|
||||
// FormData 删除json头,交给axios自动生成multipart
|
||||
delete config.headers['Content-Type'];
|
||||
}
|
||||
return config;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
|
||||
Reference in New Issue
Block a user