完善站点运营设置:分路由管理、登录可见评论、邮件模板内联与关闭注册 SSR。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { useState, useEffect } from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import { MessagesSquare } from "lucide-react";
|
||||
import { apiLogin, apiMe, apiGetSettings } from "@/lib/api";
|
||||
import { apiLogin, apiMe } from "@/lib/api";
|
||||
import { hasAuthCookieHint } from "@/lib/cookies";
|
||||
import { useAllowComments } from "@/components/CommentsPolicyProvider";
|
||||
import { useAllowMessages } from "@/components/MessagesPolicyProvider";
|
||||
@@ -18,17 +18,6 @@ function safeRedirect(to: string | null): string {
|
||||
}
|
||||
|
||||
function RegisterHint() {
|
||||
const [allow, setAllow] = useState(true);
|
||||
useEffect(() => {
|
||||
apiGetSettings()
|
||||
.then((s) => setAllow(s.allow_register))
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
if (!allow) {
|
||||
return (
|
||||
<p className="meta text-center mt-5">当前站点暂不开放注册</p>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<p className="meta text-center mt-5">
|
||||
还没有账号?
|
||||
@@ -133,6 +122,7 @@ export default function LoginPage() {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p className="text-center mt-4"><Link href="/reset-password">找回密码</Link></p>
|
||||
<RegisterHint />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user