This commit is contained in:
2026-07-07 13:21:06 +08:00
7 changed files with 35 additions and 24 deletions
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-8kqorb_r.js"></script>
<script type="module" crossorigin src="/assets/index-DUQKfJjB.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 -3
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) {
@@ -122,7 +123,6 @@ const JoinTeamPage: React.FC = () => {
extra={
<Space>
<Button type="primary" onClick={() => navigate('/projects')}></Button>
<Button onClick={() => navigate('/team-management')}></Button>
</Space>
}
/>
+15 -6
View File
@@ -5,7 +5,7 @@ import {
import { DatePicker } from 'antd';
import dayjs from 'dayjs';
import {
CopyOutlined, DownloadOutlined, PlusOutlined, ReloadOutlined, UserOutlined, HistoryOutlined, WalletOutlined, BellOutlined,
CopyOutlined, DownloadOutlined, PlusOutlined, ReloadOutlined, UserOutlined, HistoryOutlined, WalletOutlined, BellOutlined, ClockCircleOutlined,
} from '@ant-design/icons';
const { RangePicker } = DatePicker;
@@ -134,8 +134,7 @@ const TeamManagementPage: React.FC = () => {
try {
const values = await invForm.validateFields();
setInvSaving(true);
const expiresAt = values.expiresAt ? new Date(values.expiresAt).toISOString() : null;
await createTeamInvitation(values.maxUses || null, expiresAt);
await createTeamInvitation(values.maxUses || null, null);
message.success('邀请码已生成');
setInvModal(false);
invForm.resetFields();
@@ -698,9 +697,19 @@ const TeamManagementPage: React.FC = () => {
<Form.Item name="maxUses" label="最大使用次数">
<InputNumber style={{ width: '100%' }} min={1} placeholder="留空表示不限" size="large" />
</Form.Item>
<Form.Item name="expiresAt" label="过期时间">
<Input type="datetime-local" style={{ width: '100%' }} placeholder="默认24小时后过期" size="large" />
</Form.Item>
<div style={{
padding: '12px 16px',
background: '#eef2ff',
borderRadius: 8,
fontSize: 13,
color: '#4f46e5',
display: 'flex',
alignItems: 'center',
gap: 8,
}}>
<ClockCircleOutlined />
<span> <strong>24 </strong> </span>
</div>
</Form>
</Modal>
</div>