优化中间件和管理员设置

This commit is contained in:
Your Name 2025-12-25 23:30:08 +08:00
parent 9076b4ab15
commit 08a1bd8007
3 changed files with 13 additions and 7 deletions

View File

@ -276,7 +276,7 @@ export function AdminSettingsClient() {
`/api/admin/users?page=${userPage}&limit=${userLimit}&search=${encodeURIComponent(userSearch)}`,
fetcher
);
// 获取部门列表(用于批量设置)
const { data: departmentsData } = useSWR<{ departments: string[] }>(
"/api/admin/users/batch-limit",
@ -2030,11 +2030,11 @@ export function AdminSettingsClient() {
value={navLinkForm.name}
onChange={(e) => setNavLinkForm({ ...navLinkForm, name: e.target.value })}
placeholder="链接名称"
/>
</div>
<div className="space-y-2">
/>
</div>
<div className="space-y-2">
<Label>URL</Label>
<Input
<Input
value={navLinkForm.url}
onChange={(e) => setNavLinkForm({ ...navLinkForm, url: e.target.value })}
placeholder="https://..."
@ -2091,7 +2091,7 @@ export function AdminSettingsClient() {
}}
>
<Edit className="h-4 w-4" />
</Button>
</Button>
<Button variant="destructive" size="sm" onClick={() => handleDeleteNavLink(link.id)}>
<Trash2 className="h-4 w-4" />
</Button>
@ -2330,7 +2330,7 @@ export function AdminSettingsClient() {
<TabsContent value="ai" className="mt-6 space-y-6">
<Card>
<CardHeader className="flex flex-row items-center justify-between">
<div>
<div>
<CardTitle>AI 提供商</CardTitle>
<CardDescription>配置 AI 服务提供商</CardDescription>
</div>

View File

@ -14,6 +14,11 @@ export async function middleware(request: NextRequest) {
return NextResponse.next();
}
// 允许访问公开的网站设置 API(登录页面需要)
if (pathname === "/api/site-settings") {
return NextResponse.next();
}
// 允许访问钉钉回调页面(public 文件夹中的文件)
if (pathname === "/dingtalk-callback.html") {
return NextResponse.next();

View File

@ -525,3 +525,4 @@ curl http://localhost:8002/health