1
This commit is contained in:
parent
cd80ae04ec
commit
1ad9880a14
@ -161,6 +161,18 @@ const COMMITTEE_PRESETS: Array<{
|
||||
"resource_manage",
|
||||
],
|
||||
},
|
||||
{
|
||||
role: "宣传委员",
|
||||
description: "负责公告发布、班级宣传与内容协同传播",
|
||||
permissions: [
|
||||
"class_view",
|
||||
"member_view",
|
||||
"announcement_manage",
|
||||
"timeline_manage",
|
||||
"vote_manage",
|
||||
"resource_manage",
|
||||
],
|
||||
},
|
||||
{
|
||||
role: "生活委员",
|
||||
description: "负责生活事务通知与班费相关管理",
|
||||
@ -327,6 +339,17 @@ export default function MembersPage() {
|
||||
toast.success("邀请码已复制");
|
||||
};
|
||||
|
||||
const handleCopyActivationLink = () => {
|
||||
if (!inviteCode) {
|
||||
toast.error("当前暂无可用邀请码");
|
||||
return;
|
||||
}
|
||||
|
||||
const activationLink = `${window.location.origin}/activate?code=${encodeURIComponent(inviteCode)}`;
|
||||
navigator.clipboard.writeText(activationLink);
|
||||
toast.success("激活链接已复制");
|
||||
};
|
||||
|
||||
const handleRegenerateCode = async () => {
|
||||
try {
|
||||
const res = await postAPI<InviteCodeResponse>(
|
||||
@ -632,13 +655,16 @@ export default function MembersPage() {
|
||||
<Button variant="outline" size="sm" onClick={handleCopyCode}>
|
||||
复制
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" onClick={handleCopyActivationLink}>
|
||||
复制激活链接
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" onClick={handleRegenerateCode}>
|
||||
重新生成
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mt-2 text-xs text-[#9a7b68]">
|
||||
将此激活码分享给成员,成员输入激活码和学号后即可激活账号
|
||||
可直接分享激活链接给成员,打开后会自动填入激活码;也可以单独分享邀请码供成员手动输入
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@ -19,6 +19,14 @@ export default function ActivatePage() {
|
||||
const [error, setError] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
useEffect(() => {
|
||||
const code = searchParams.get("code")?.trim();
|
||||
if (code) {
|
||||
setInviteCode(code.toUpperCase());
|
||||
}
|
||||
}, [searchParams]);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
@ -69,7 +77,7 @@ export default function ActivatePage() {
|
||||
完成账号激活,进入你的班级空间
|
||||
</h1>
|
||||
<p className="mt-5 max-w-xl text-base leading-8 text-[#775a4a]">
|
||||
成员导入后,只需使用激活码与学号确认身份,再补全邮箱和密码即可启用账号。
|
||||
成员导入后,只需使用激活码与学号确认身份,再补全邮箱和密码即可启用账号。若从邀请链接进入,激活码会自动填入。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user