Commit 669e5f3b78b8acbaed58f6384dd65e4e542c6cb7
1 parent
4177441a
切换公司优化报错处理;
Showing
1 changed file
with
26 additions
and
2 deletions
src/components/Common/PersonCenter/SwitchCompanyAndLanguage/index.js
| ... | ... | @@ -45,7 +45,17 @@ const SwitchCompanyAndLanguageEvent = props => { |
| 45 | 45 | const dataReturn = (await commonServices.postValueService(token, conditions, dataUrl)).data; |
| 46 | 46 | if (dataReturn.code === 1) { |
| 47 | 47 | setState(pre => ({ ...pre, companyData: item })); |
| 48 | - const { token, systemData, rxtx, commonConst, gdslogininfo: userinfo, auxiliaryQty, footer, logoImageInfo, isInitPassword } = { | |
| 48 | + const { | |
| 49 | + token, | |
| 50 | + systemData, | |
| 51 | + rxtx, | |
| 52 | + commonConst, | |
| 53 | + gdslogininfo: userinfo, | |
| 54 | + auxiliaryQty, | |
| 55 | + footer, | |
| 56 | + logoImageInfo, | |
| 57 | + isInitPassword, | |
| 58 | + } = { | |
| 49 | 59 | ...app, |
| 50 | 60 | ...dataReturn.dataset.rows[0], |
| 51 | 61 | }; |
| ... | ... | @@ -83,6 +93,8 @@ const SwitchCompanyAndLanguageEvent = props => { |
| 83 | 93 | commonUtils.clearFormStoreDropDownData(); |
| 84 | 94 | window.xlyReload(); |
| 85 | 95 | }, 1000); |
| 96 | + } else { | |
| 97 | + props.dispatch({ type: "app/throwError", payload: dataReturn }); | |
| 86 | 98 | } |
| 87 | 99 | |
| 88 | 100 | setState(pre => ({ ...pre, companyLoading: false })); |
| ... | ... | @@ -96,7 +108,17 @@ const SwitchCompanyAndLanguageEvent = props => { |
| 96 | 108 | const dataReturn = (await commonServices.postValueService(token, { sLanguage: language === "中文" ? "sEnglish" : "sChinese" }, dataUrl)).data; |
| 97 | 109 | if (dataReturn.code === 1) { |
| 98 | 110 | setState(pre => ({ ...pre, language: language === "中文" ? "EN" : "中文" })); |
| 99 | - const { token, systemData, rxtx, commonConst, gdslogininfo: userinfo, auxiliaryQty, footer, logoImageInfo, isInitPassword } = { | |
| 111 | + const { | |
| 112 | + token, | |
| 113 | + systemData, | |
| 114 | + rxtx, | |
| 115 | + commonConst, | |
| 116 | + gdslogininfo: userinfo, | |
| 117 | + auxiliaryQty, | |
| 118 | + footer, | |
| 119 | + logoImageInfo, | |
| 120 | + isInitPassword, | |
| 121 | + } = { | |
| 100 | 122 | ...app, |
| 101 | 123 | ...dataReturn.dataset.rows[0], |
| 102 | 124 | }; |
| ... | ... | @@ -134,6 +156,8 @@ const SwitchCompanyAndLanguageEvent = props => { |
| 134 | 156 | commonUtils.clearFormStoreDropDownData(); |
| 135 | 157 | window.xlyReload(); |
| 136 | 158 | }, 1000); |
| 159 | + } else { | |
| 160 | + props.dispatch({ type: "app/throwError", payload: dataReturn }); | |
| 137 | 161 | } |
| 138 | 162 | |
| 139 | 163 | setState(pre => ({ ...pre, btnLoading: false })); | ... | ... |