注销后自动退出登录

This commit is contained in:
yezian 2024-12-19 14:51:00 +08:00
parent 34f8fa19c1
commit 2bfe409e45
1 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { formatDeadline } from "@/utils/tools"; import { formatDeadline } from "@/utils/tools";
import requireAPI from "@/utils/requireAPI"; import requireAPI from "@/utils/requireAPI";
import { handleLogout } from "@/api/public";
export default function DeleteAccount() { export default function DeleteAccount() {
const [deadline, setDeadline] = useState(); const [deadline, setDeadline] = useState();
const router = useRouter(); const router = useRouter();
@ -49,6 +51,8 @@ export default function DeleteAccount() {
} }
checkAccountStatus(); checkAccountStatus();
showMobal.current?.close(); showMobal.current?.close();
await handleLogout();
router.replace("/login");
} catch (error) { } catch (error) {
// console.error(error); // console.error(error);
} }
@ -73,7 +77,8 @@ export default function DeleteAccount() {
const handleShowDialog = () => { const handleShowDialog = () => {
showMobal.current = Dialog.show({ showMobal.current = Dialog.show({
title: "您确认要注销此账号吗?", title: "您确认要注销此账号吗?",
content: "注销后无法恢复,请仔细阅读《注销必看须知》后确认。", content:
"提交注销后我们将在7个自然日后完全清除您的账号信息在此期间若您再次登陆则视为放弃注销。请仔细阅读《注销必看须知》后确认。",
bodyStyle: { bodyStyle: {
maxHeight: "none", maxHeight: "none",
width: "80vw", width: "80vw",
@ -144,7 +149,7 @@ export default function DeleteAccount() {
</p> </p>
<p className="text-white text-base font-medium mt-2">3注销时间</p> <p className="text-white text-base font-medium mt-2">3注销时间</p>
<p className="text-[#FFFFFFB2] text-base"> <p className="text-[#FFFFFFB2] text-base">
您发起注销账户申请后我们将在7个自然日后完全清除您的账号信息在此期间您可以随时在本页面撤销该申请 您发起注销账户申请后我们将在7个自然日后完全清除您的账号信息在此期间若您再次登陆则视为放弃注销
</p> </p>
<p className="text-white text-base font-medium mt-2">4其他</p> <p className="text-white text-base font-medium mt-2">4其他</p>
<p className="text-[#FFFFFFB2] text-base"> <p className="text-[#FFFFFFB2] text-base">