fix: 修复邀请页面引导路径问题

pull/49/head
moonrailgun 3 years ago
parent 86179443de
commit 8f0482f9a2

@ -75,8 +75,11 @@ const backToLoginPage = (() => {
return;
}
if (window.location.pathname.startsWith('/entry')) {
// 如果已经在入口页面则跳过
if (
window.location.pathname.startsWith('/entry') ||
window.location.pathname.startsWith('/invite')
) {
// 如果已经在入口页面或者邀请页面则跳过
return;
}

@ -1,4 +1,4 @@
import { Avatar } from '@/components/Avatar';
import { Avatar } from 'tailchat-design';
import { InviteCodeExpiredAt } from '@/components/InviteCodeExpiredAt';
import { LoadingSpinner } from '@/components/LoadingSpinner';
import { UserName } from '@/components/UserName';

@ -21,6 +21,10 @@ export const JoinBtn: React.FC<Props> = React.memo((props) => {
const history = useHistory();
const { loading, value: isTokenValid } = useAsync(async () => {
const token = await getUserJWT();
if (!token) {
return false;
}
const isTokenValid = await checkTokenValid(token);
return isTokenValid;
});

@ -55,6 +55,8 @@ export const builtinAuthWhitelist = [
'/user/createTemporaryUser',
'/user/resolveToken',
'/user/getUserInfo',
'/user/getUserInfoList',
'/user/checkTokenValid',
'/group/getGroupBasicInfo',
'/group/invite/findInviteByCode',
];

Loading…
Cancel
Save