system notice check
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
changeAppStatus,
|
||||
changeLocalSettings,
|
||||
setShowPopup,
|
||||
setSystemNotice,
|
||||
setSystemTermination,
|
||||
} from "../actions/commonActions";
|
||||
import {
|
||||
getAuthenticationCode,
|
||||
@@ -90,6 +92,18 @@ export const TAxios = (
|
||||
axiosInstance
|
||||
.then((res) => {
|
||||
console.log("TAxios response", url, res);
|
||||
|
||||
const apiSysStatus = res.headers["api-sys-status"];
|
||||
const { systemNotice, systemTermination, appStatus } =
|
||||
getState().common;
|
||||
const isInitialLoad = !appStatus.loadingComplete;
|
||||
|
||||
if (apiSysStatus === "800" && !systemNotice) {
|
||||
dispatch(setSystemNotice());
|
||||
} else if (apiSysStatus === "900" && !systemTermination) {
|
||||
dispatch(setSystemTermination(isInitialLoad));
|
||||
}
|
||||
|
||||
if (baseUrl === URLS.GET_AUTHENTICATION_CODE) {
|
||||
if (res?.data?.retCode !== 0) {
|
||||
console.error("accessToken failed", res.data.retCode);
|
||||
|
||||
Reference in New Issue
Block a user