feat:任务开始界面-任务开始/暂停/结束功能

This commit is contained in:
2025-07-08 09:12:38 +08:00
parent bf2c474058
commit 07bf872149
5 changed files with 229 additions and 10 deletions
+14 -5
View File
@@ -34,11 +34,20 @@ const get = (url: string, params: {}) => {
.catch(handleError);
};
const post = (url: string, data: any) => {
console.log("开始POST请求", basic_url + url, "参数:", data);
return axiosInstance.post(url, data)
.then(validateResponse)
.catch(handleError);
const post = (url: string, data: any = null, config: any = {}) => {
console.log("开始POST请求", url, "参数:", data, "配置:", config);
if (config.params) {
// 如果传入 config.params,则作为 URL 参数
return axiosInstance.post(url, data, { params: config.params })
.then(validateResponse)
.catch(handleError);
} else {
// 默认 POST JSON
return axiosInstance.post(url, data)
.then(validateResponse)
.catch(handleError);
}
};
const put = (url: string, data: any) => {