This commit is contained in:
2026-07-07 11:46:08 +08:00
parent 3574a9f1cf
commit ac869d351f
5 changed files with 18 additions and 15 deletions
+3 -1
View File
@@ -227,7 +227,7 @@ async def get_join_info_public(
"""公开接口:验证邀请码并返回团队信息(无需登录)。"""
invitation = await team_invitation_service.get_invitation_by_code(db, code)
if not invitation:
return {"team_name": "", "team_id": "", "valid": False}
return {"team_name": "", "team_id": "", "valid": False, "already_in_team": False, "has_pending_request": False}
team = await db.execute(
select(Team.name).where(Team.id == invitation.team_id, Team.deleted_at.is_(None)).limit(1)
@@ -238,6 +238,8 @@ async def get_join_info_public(
"team_name": team_name,
"team_id": invitation.team_id,
"valid": True,
"already_in_team": False,
"has_pending_request": False,
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-CzboX826.js"></script>
<script type="module" crossorigin src="/assets/index-Bj5E6PSn.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D9_3MPsN.css">
</head>
<body>
+1 -1
View File
@@ -55,7 +55,7 @@ async function tryDecrypt(data: string): Promise<string | null> {
}
export async function apiRequest<T>(path: string, options: RequestOptions = {}): Promise<T> {
const { method = 'GET', body, auth = true, encryptBody = USE_ENCRYPTION, signal } = options;
const { method = 'GET', body, auth = true, encryptBody = USE_ENCRYPTION, signal, skipAuthRedirect } = options;
const headers: Record<string, string> = {
'Content-Type': 'application/json',
+3 -2
View File
@@ -6,7 +6,7 @@ import {
CheckCircleOutlined, TeamOutlined, LoginOutlined, UserAddOutlined,
} from '@ant-design/icons';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { getJoinTeamInfo, submitJoinRequest } from '../api';
import { getJoinTeamInfo, getJoinTeamInfoPublic, submitJoinRequest } from '../api';
import type { JoinTeamInfo } from '../types';
import { useAuthStore } from '../store/useAuthStore';
@@ -34,7 +34,8 @@ const JoinTeamPage: React.FC = () => {
if (authLoading) return;
setInfoLoading(true);
getJoinTeamInfo(code)
const fetchInfo = user ? getJoinTeamInfo(code) : getJoinTeamInfoPublic(code);
fetchInfo
.then((data) => {
setInfo(data);
if (data?.valid && user && !data.alreadyInTeam && !data.hasPendingRequest) {