From d282ac2fca3f3701e1296f9c6ac5b0018e17c37a Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 19 Oct 2023 17:37:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BD=AF=E4=BB=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=8B=E5=8F=91/=E9=87=8D=E5=90=AF/=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E8=B6=85=E6=97=B660=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configManage/softwareManage.ts | 42 +++++++++----------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/api/configManage/softwareManage.ts b/src/api/configManage/softwareManage.ts index f9440818..c5d1e238 100644 --- a/src/api/configManage/softwareManage.ts +++ b/src/api/configManage/softwareManage.ts @@ -108,18 +108,14 @@ export async function sendNeSoftware(data: Record) { const result = await request({ url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, method: 'post', + timeout: 60 * 1000, }); // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } + if (result.code === RESULT_CODE_SUCCESS) { + delete result.data; + return result; } - return result; + return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; } /** @@ -131,18 +127,14 @@ export async function runNeSoftware(data: Record) { const result = await request({ url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, method: 'put', + timeout: 60 * 1000, }); // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } + if (result.code === RESULT_CODE_SUCCESS) { + delete result.data; + return result; } - return result; + return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; } /** @@ -154,18 +146,14 @@ export async function backNeSoftware(data: Record) { const result = await request({ url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, method: 'patch', + timeout: 60 * 1000, }); // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } + if (result.code === RESULT_CODE_SUCCESS) { + delete result.data; + return result; } - return result; + return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; } /**