feat(admin): 完善站点设置、内容回收站与后台菜单分组
新增站点设置与内容管理(含已删除恢复/清除),用户页改用独有运营指标,并按概览/内容/成员与经济/站点重组侧栏。 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 } from "@/lib/api";
|
||||
import { apiLogin, apiMe, apiGetSettings } from "@/lib/api";
|
||||
import { hasAuthCookieHint } from "@/lib/cookies";
|
||||
|
||||
// 仅允许同源相对路径跳转,拦截 //host、/\\host 与绝对 URL 形式的开放重定向
|
||||
@@ -15,6 +15,28 @@ function safeRedirect(to: string | null): string {
|
||||
return to;
|
||||
}
|
||||
|
||||
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">
|
||||
还没有账号?
|
||||
<Link href="/register" className="ml-1 font-semibold" style={{ color: "var(--accent)" }}>
|
||||
立即注册
|
||||
</Link>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
export default function LoginPage() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
@@ -107,12 +129,7 @@ export default function LoginPage() {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p className="meta text-center mt-5">
|
||||
还没有账号?
|
||||
<Link href="/register" className="ml-1 font-semibold" style={{ color: "var(--accent)" }}>
|
||||
立即注册
|
||||
</Link>
|
||||
</p>
|
||||
<RegisterHint />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user