chore: updates
This commit is contained in:
@@ -35,8 +35,9 @@ const whiteList401 = ["getAgoraVoicingList", "getAgoraChannels"];
|
||||
const errorWhiteList = ["preCheckFileFromUrl", "getFavoriteDetails"];
|
||||
const baseQuery = fetchBaseQuery({
|
||||
baseUrl: BASE_URL,
|
||||
prepareHeaders: (headers, { getState, endpoint }) => {
|
||||
const { token } = (getState() as RootState).authData;
|
||||
prepareHeaders: (headers, { endpoint }) => {
|
||||
const { token } = getLocalAuthData();
|
||||
// const { token } = (getState() as RootState).authData;
|
||||
if (token && !whiteList.includes(endpoint)) {
|
||||
headers.set(tokenHeader, token);
|
||||
}
|
||||
@@ -80,7 +81,7 @@ const baseQueryWithTokenCheck = async (args: any, api: any, extraOptions: any) =
|
||||
result = await baseQuery(args, api, extraOptions);
|
||||
}
|
||||
if (result?.error) {
|
||||
console.error("api error", result.error, api.endpoint);
|
||||
console.error("api error", result.error, args, api.endpoint);
|
||||
if (errorWhiteList.includes(api.endpoint)) return result;
|
||||
switch (result.error.originalStatus || result.error.status) {
|
||||
case "FETCH_ERROR":
|
||||
|
||||
@@ -54,7 +54,7 @@ const serverSlice = createSlice({
|
||||
version,
|
||||
upgraded,
|
||||
name,
|
||||
logo,
|
||||
logo: state.logo || logo,
|
||||
description,
|
||||
inviteLink,
|
||||
show_user_online_status,
|
||||
|
||||
@@ -41,7 +41,7 @@ const Voice = () => {
|
||||
{ page_no: 0, page_size: 100 },
|
||||
{
|
||||
skip: !enabled || !navigator.onLine,
|
||||
pollingInterval: 5000
|
||||
pollingInterval: 10000
|
||||
}
|
||||
);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -106,6 +106,8 @@ export default function useStreaming() {
|
||||
if (dayjs().isAfter(new Date(expireTime - 20 * 1000))) {
|
||||
const resp = await renewToken({ token, refresh_token: refreshToken });
|
||||
if ("error" in resp) {
|
||||
// 停止循环
|
||||
stopStreaming();
|
||||
return;
|
||||
} else {
|
||||
_token = resp.data.token;
|
||||
|
||||
@@ -22,7 +22,7 @@ const defaultInput = {
|
||||
password: ""
|
||||
};
|
||||
export default function LoginPage() {
|
||||
const serverName = useAppSelector((store) => store.server.name);
|
||||
const { name: serverName, logo } = useAppSelector((store) => store.server);
|
||||
const { t } = useTranslation("auth");
|
||||
const { t: ct } = useTranslation();
|
||||
const { data: enableSMTP, isLoading: loadingSMTPStatus } = useGetSMTPStatusQuery();
|
||||
@@ -138,7 +138,7 @@ export default function LoginPage() {
|
||||
)}
|
||||
<div className="flex-center flex-col pb-6">
|
||||
<img
|
||||
src={`${BASE_URL}/resource/organization/logo`}
|
||||
src={logo || `${BASE_URL}/resource/organization/logo?t=${Date.now()}`}
|
||||
alt="logo"
|
||||
className="w-14 h-14 mb-3 md:mb-7 rounded-full"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user