fix: ignore get voice list 401

This commit is contained in:
Tristan Yang
2023-04-20 10:35:03 +08:00
parent 9cb6adf835
commit 824f85b5a8
+4 -1
View File
@@ -29,7 +29,7 @@ const whiteList = [
"sendMessageByBot",
"getAgoraVoicingList"
];
const whiteList401 = ["getAgoraVoicingList"];
const baseQuery = fetchBaseQuery({
baseUrl: BASE_URL,
prepareHeaders: (headers, { getState, endpoint }) => {
@@ -89,6 +89,9 @@ const baseQueryWithTokenCheck = async (args: any, api: any, extraOptions: any) =
break;
case 401:
{
if (whiteList401.includes(api.endpoint)) {
return;
}
if (api.endpoint !== "login") {
api.dispatch(resetAuthData());
location.href = "/#/login";