fix: 软件管理下发/重启/回退超时60秒
This commit is contained in:
@@ -108,18 +108,14 @@ export async function sendNeSoftware(data: Record<string, any>) {
|
|||||||
const result = await request({
|
const result = await request({
|
||||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
timeout: 60 * 1000,
|
||||||
});
|
});
|
||||||
// 解析数据
|
// 解析数据
|
||||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
if (result.code === RESULT_CODE_SUCCESS) {
|
||||||
let rows = result.data.data.affectedRows;
|
delete result.data;
|
||||||
if (rows) {
|
return result;
|
||||||
delete result.data;
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,18 +127,14 @@ export async function runNeSoftware(data: Record<string, any>) {
|
|||||||
const result = await request({
|
const result = await request({
|
||||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
timeout: 60 * 1000,
|
||||||
});
|
});
|
||||||
// 解析数据
|
// 解析数据
|
||||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
if (result.code === RESULT_CODE_SUCCESS) {
|
||||||
let rows = result.data.data.affectedRows;
|
delete result.data;
|
||||||
if (rows) {
|
return result;
|
||||||
delete result.data;
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,18 +146,14 @@ export async function backNeSoftware(data: Record<string, any>) {
|
|||||||
const result = await request({
|
const result = await request({
|
||||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
|
timeout: 60 * 1000,
|
||||||
});
|
});
|
||||||
// 解析数据
|
// 解析数据
|
||||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
if (result.code === RESULT_CODE_SUCCESS) {
|
||||||
let rows = result.data.data.affectedRows;
|
delete result.data;
|
||||||
if (rows) {
|
return result;
|
||||||
delete result.data;
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user