1
This commit is contained in:
@@ -37,11 +37,6 @@ from app.services.team_manager_service import (
|
||||
router = APIRouter(prefix="/team", tags=["team"])
|
||||
|
||||
|
||||
def _build_invite_link(code: str) -> str:
|
||||
base = getattr(settings, "FRONTEND_URL", "") or getattr(settings, "BASE_URL", "")
|
||||
return f"{base}/join-team?code={code}"
|
||||
|
||||
|
||||
# ── 获取当前用户管理的团队 ──────────────────────────────
|
||||
@router.get("/managed")
|
||||
async def get_managed_team_info(
|
||||
@@ -135,7 +130,6 @@ async def create_invitation(
|
||||
"max_uses": invitation.max_uses,
|
||||
"use_count": invitation.use_count,
|
||||
"expires_at": invitation.expires_at,
|
||||
"invite_link": _build_invite_link(invitation.code),
|
||||
"created_at": invitation.created_at,
|
||||
}
|
||||
|
||||
@@ -158,7 +152,6 @@ async def list_invitations(
|
||||
"max_uses": inv.max_uses,
|
||||
"use_count": inv.use_count,
|
||||
"expires_at": inv.expires_at,
|
||||
"invite_link": _build_invite_link(inv.code),
|
||||
"created_at": inv.created_at,
|
||||
}
|
||||
for inv in invitations
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-DeA8rTqb.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-8kqorb_r.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D9_3MPsN.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -351,33 +351,41 @@ const TeamManagementPage: React.FC = () => {
|
||||
},
|
||||
];
|
||||
|
||||
const buildInviteLink = (code: string) => {
|
||||
const base = window.location.origin;
|
||||
return `${base}/join-team?code=${code}`;
|
||||
};
|
||||
|
||||
const invColumns = [
|
||||
{ title: '邀请码', dataIndex: 'code', width: 200, render: (v: string) => <Typography.Text copyable style={{ fontFamily: 'monospace' }}>{v}</Typography.Text> },
|
||||
{
|
||||
title: '邀请链接', dataIndex: 'inviteLink',
|
||||
render: (v: string) => (
|
||||
<Space style={{ width: '100%' }}>
|
||||
<Typography.Text
|
||||
style={{
|
||||
flex: 1,
|
||||
fontSize: 12,
|
||||
wordBreak: 'break-all',
|
||||
fontFamily: 'monospace',
|
||||
color: '#64748b',
|
||||
}}
|
||||
>
|
||||
{v}
|
||||
</Typography.Text>
|
||||
<Tooltip title="复制链接">
|
||||
<Button
|
||||
size="small"
|
||||
type="text"
|
||||
icon={<CopyOutlined />}
|
||||
onClick={() => copyInviteLink(v)}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
),
|
||||
title: '邀请链接', dataIndex: 'code',
|
||||
render: (v: string) => {
|
||||
const link = buildInviteLink(v);
|
||||
return (
|
||||
<Space style={{ width: '100%' }}>
|
||||
<Typography.Text
|
||||
style={{
|
||||
flex: 1,
|
||||
fontSize: 12,
|
||||
wordBreak: 'break-all',
|
||||
fontFamily: 'monospace',
|
||||
color: '#64748b',
|
||||
}}
|
||||
>
|
||||
{link}
|
||||
</Typography.Text>
|
||||
<Tooltip title="复制链接">
|
||||
<Button
|
||||
size="small"
|
||||
type="text"
|
||||
icon={<CopyOutlined />}
|
||||
onClick={() => copyInviteLink(link)}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
{ title: '状态', dataIndex: 'status', width: 80, render: (v: string) => <Tag color={v === 'active' ? 'green' : 'default'}>{v === 'active' ? '有效' : '已撤销'}</Tag> },
|
||||
{ title: '使用次数', key: 'uses', width: 100, render: (_: any, r: TeamInvitation) => `${r.useCount}${r.maxUses ? `/${r.maxUses}` : ''}` },
|
||||
|
||||
Reference in New Issue
Block a user