feat:任务开始界面-任务开始/暂停/结束功能
This commit is contained in:
+14
-5
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user