feat: 添加访问令牌管理功能并升级至 0.2.4

- 新增 Management Token(访问令牌)功能,支持创建、更新、删除和管理
- 前端添加访问令牌管理页面,支持普通用户和管理员
- 后端实现完整的令牌生命周期管理 API
- 添加数据库迁移脚本创建 management_tokens 表
- Nginx 配置添加 gzip 压缩,优化响应传输
- Dialog 组件添加 persistent 属性,防止意外关闭
- 为管理后台 API 添加详细的中文文档注释
- 简化多处类型注解,统一代码风格
This commit is contained in:
fawney19
2026-01-07 14:55:07 +08:00
parent f6a6410626
commit 0061fc04b7
59 changed files with 6265 additions and 648 deletions

View File

@@ -32,7 +32,10 @@
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<Label for="server-url" class="block text-sm font-medium">
<Label
for="server-url"
class="block text-sm font-medium"
>
服务器地址
</Label>
<Input
@@ -48,7 +51,10 @@
</div>
<div>
<Label for="bind-dn" class="block text-sm font-medium">
<Label
for="bind-dn"
class="block text-sm font-medium"
>
绑定 DN
</Label>
<Input
@@ -64,7 +70,10 @@
</div>
<div>
<Label for="bind-password" class="block text-sm font-medium">
<Label
for="bind-password"
class="block text-sm font-medium"
>
绑定密码
</Label>
<div class="relative mt-1">
@@ -80,10 +89,30 @@
v-if="hasPassword || ldapConfig.bind_password"
type="button"
class="absolute right-3 top-1/2 -translate-y-1/2 p-1 rounded-full text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50 transition-colors"
@click="handleClearPassword"
title="清除密码"
@click="handleClearPassword"
>
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
><line
x1="18"
y1="6"
x2="6"
y2="18"
/><line
x1="6"
y1="6"
x2="18"
y2="18"
/></svg>
</button>
</div>
<p class="mt-1 text-xs text-muted-foreground">
@@ -92,7 +121,10 @@
</div>
<div>
<Label for="base-dn" class="block text-sm font-medium">
<Label
for="base-dn"
class="block text-sm font-medium"
>
基础 DN
</Label>
<Input
@@ -108,7 +140,10 @@
</div>
<div>
<Label for="user-search-filter" class="block text-sm font-medium">
<Label
for="user-search-filter"
class="block text-sm font-medium"
>
用户搜索过滤器
</Label>
<Input
@@ -124,7 +159,10 @@
</div>
<div>
<Label for="username-attr" class="block text-sm font-medium">
<Label
for="username-attr"
class="block text-sm font-medium"
>
用户名属性
</Label>
<Input
@@ -140,7 +178,10 @@
</div>
<div>
<Label for="email-attr" class="block text-sm font-medium">
<Label
for="email-attr"
class="block text-sm font-medium"
>
邮箱属性
</Label>
<Input
@@ -153,7 +194,10 @@
</div>
<div>
<Label for="display-name-attr" class="block text-sm font-medium">
<Label
for="display-name-attr"
class="block text-sm font-medium"
>
显示名称属性
</Label>
<Input
@@ -166,7 +210,10 @@
</div>
<div>
<Label for="connect-timeout" class="block text-sm font-medium">
<Label
for="connect-timeout"
class="block text-sm font-medium"
>
连接超时 ()
</Label>
<Input