[에러패널] 901 ,902 error 코드 위치 변경
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import axios from "axios";
|
||||
|
||||
import Spotlight from "@enact/spotlight";
|
||||
|
||||
import { types } from "../actions/actionTypes";
|
||||
import {
|
||||
changeAppStatus,
|
||||
changeLocalSettings,
|
||||
setShowPopup,
|
||||
setSystemNotice,
|
||||
setSystemTermination,
|
||||
@@ -9,11 +14,11 @@ import {
|
||||
getAuthenticationCode,
|
||||
getReAuthenticationCode,
|
||||
} from "../actions/deviceActions";
|
||||
import { pushPanel } from "../actions/panelActions";
|
||||
import * as Config from "../utils/Config";
|
||||
import { ACTIVE_POPUP } from "../utils/Config";
|
||||
import * as HelperMethods from "../utils/helperMethods";
|
||||
import { getUrl, URLS } from "./apiConfig";
|
||||
import { pushPanel, resetPanels } from "../actions/panelActions";
|
||||
import * as Config from "../utils/Config";
|
||||
|
||||
let tokenRefreshing = false;
|
||||
const axiosQueue = [];
|
||||
@@ -25,7 +30,7 @@ export const setTokenRefreshing = (value) => {
|
||||
export const runDelayedAction = (dispatch, getState) => {
|
||||
console.log("runDelayedAction axiosQueue size", axiosQueue.length);
|
||||
while (axiosQueue.length > 0) {
|
||||
const requestConfig = axiosQueue.shift(); // queue에서 요청을 하나씩 shift
|
||||
const requestConfig = axiosQueue.pop(); // queue에서 요청을 하나씩 pop
|
||||
TAxios(
|
||||
dispatch,
|
||||
getState,
|
||||
@@ -105,6 +110,20 @@ export const TAxios = (
|
||||
dispatch(setSystemNotice());
|
||||
} else if (apiSysStatus === "900" && !systemTermination) {
|
||||
dispatch(setSystemTermination(isInitialLoad));
|
||||
dispatch(resetPanels());
|
||||
dispatch(
|
||||
pushPanel({
|
||||
name: Config.panel_names.ERROR_PANEL,
|
||||
})
|
||||
);
|
||||
} else if (apiSysStatus === "901" && !systemTermination) {
|
||||
dispatch(setSystemTermination(isInitialLoad));
|
||||
dispatch(resetPanels());
|
||||
dispatch(
|
||||
pushPanel({
|
||||
name: Config.panel_names.ERROR_PANEL,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (baseUrl === URLS.GET_AUTHENTICATION_CODE) {
|
||||
@@ -171,25 +190,6 @@ export const TAxios = (
|
||||
return;
|
||||
}
|
||||
|
||||
// 900 장애 발생
|
||||
if (res?.data?.retCode === 900) {
|
||||
dispatch(
|
||||
pushPanel({
|
||||
name: Config.panel_names.ERROR_PANEL,
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
// 901 서버 에러 발생
|
||||
if (res?.data?.retCode === 901) {
|
||||
dispatch(
|
||||
pushPanel({
|
||||
name: Config.panel_names.ERROR_PANEL,
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (onSuccess) onSuccess(res);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
Reference in New Issue
Block a user