From b0d06b5b0c10c569419205b0b419f80c2c11ce1f Mon Sep 17 00:00:00 2001 From: zhangzhen <525765282@qq.com> Date: Wed, 13 Aug 2025 17:36:18 +0800 Subject: [PATCH] 优化切换公司接口报错处理; --- src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js b/src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js index 0dc698c..c39c1c7 100644 --- a/src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js +++ b/src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js @@ -45,7 +45,17 @@ const SwitchCompanyAndLanguageEvent = props => { const dataReturn = (await commonServices.postValueService(token, conditions, dataUrl)).data; if (dataReturn.code === 1) { setState(pre => ({ ...pre, companyData: item })); - const { token, systemData, rxtx, commonConst, gdslogininfo: userinfo, auxiliaryQty, footer, logoImageInfo, isInitPassword } = { + const { + token, + systemData, + rxtx, + commonConst, + gdslogininfo: userinfo, + auxiliaryQty, + footer, + logoImageInfo, + isInitPassword, + } = { ...app, ...dataReturn.dataset.rows[0], }; @@ -83,6 +93,8 @@ const SwitchCompanyAndLanguageEvent = props => { commonUtils.clearFormStoreDropDownData(); window.xlyReload(); }, 1000); + } else { + props.dispatch({ type: "app/throwError", payload: dataReturn }); } setState(pre => ({ ...pre, companyLoading: false })); @@ -96,7 +108,17 @@ const SwitchCompanyAndLanguageEvent = props => { const dataReturn = (await commonServices.postValueService(token, { sLanguage: language === "中文" ? "sEnglish" : "sChinese" }, dataUrl)).data; if (dataReturn.code === 1) { setState(pre => ({ ...pre, language: language === "中文" ? "EN" : "中文" })); - const { token, systemData, rxtx, commonConst, gdslogininfo: userinfo, auxiliaryQty, footer, logoImageInfo, isInitPassword } = { + const { + token, + systemData, + rxtx, + commonConst, + gdslogininfo: userinfo, + auxiliaryQty, + footer, + logoImageInfo, + isInitPassword, + } = { ...app, ...dataReturn.dataset.rows[0], }; -- libgit2 0.22.2