fix: ignore get voice list 401
This commit is contained in:
@@ -29,7 +29,7 @@ const whiteList = [
|
|||||||
"sendMessageByBot",
|
"sendMessageByBot",
|
||||||
"getAgoraVoicingList"
|
"getAgoraVoicingList"
|
||||||
];
|
];
|
||||||
|
const whiteList401 = ["getAgoraVoicingList"];
|
||||||
const baseQuery = fetchBaseQuery({
|
const baseQuery = fetchBaseQuery({
|
||||||
baseUrl: BASE_URL,
|
baseUrl: BASE_URL,
|
||||||
prepareHeaders: (headers, { getState, endpoint }) => {
|
prepareHeaders: (headers, { getState, endpoint }) => {
|
||||||
@@ -89,6 +89,9 @@ const baseQueryWithTokenCheck = async (args: any, api: any, extraOptions: any) =
|
|||||||
break;
|
break;
|
||||||
case 401:
|
case 401:
|
||||||
{
|
{
|
||||||
|
if (whiteList401.includes(api.endpoint)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (api.endpoint !== "login") {
|
if (api.endpoint !== "login") {
|
||||||
api.dispatch(resetAuthData());
|
api.dispatch(resetAuthData());
|
||||||
location.href = "/#/login";
|
location.href = "/#/login";
|
||||||
|
|||||||
Reference in New Issue
Block a user