feat: 用户徽章与等级体系,积分经济管理重构
- 新增徽章系统:badge 服务与 handler、管理端配置页、BadgeChip/LevelBadge 展示组件 - 新增等级模型:model/level 及前端 levels 元数据 - 管理端经济模块拆分为 points/badges/levels 独立页面,EconomySettings 迁入设置 - 积分、签到、评论等服务适配等级与徽章逻辑
This commit is contained in:
22
frontend/app/admin/levels/page.tsx
Normal file
22
frontend/app/admin/levels/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Metadata } from "next";
|
||||
import { cookies } from "next/headers";
|
||||
import LevelsAdmin from "./LevelsAdmin";
|
||||
import { authCookieHeader } from "@/lib/cookies";
|
||||
import { getMeCached } from "@/lib/serverData";
|
||||
import { isSuperOrOwner } from "@/lib/roles";
|
||||
import Forbidden from "../Forbidden";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "等级管理",
|
||||
};
|
||||
|
||||
// 等级管理仅超管/站长可用(与徽章管理同权限;后端路由另有守卫)
|
||||
export default async function AdminLevelsPage() {
|
||||
const cookie = authCookieHeader(await cookies());
|
||||
const me = await getMeCached(cookie || undefined);
|
||||
if (!me.user || !isSuperOrOwner(me.user.role)) {
|
||||
return <Forbidden text="等级管理仅超管/站长可操作。" />;
|
||||
}
|
||||
|
||||
return <LevelsAdmin />;
|
||||
}
|
||||
Reference in New Issue
Block a user