feat: 认证简化为固定进入密钥 + 页面增强(API 文档/主题切换/版权署名)

- 移除管理员初始化/登录/JWT 流程,改为固定进入密钥(19735500),
  首次启动自动初始化到数据库 settings 表(可改库更新)
- analyze 接口支持可选密钥鉴权:X-Access-Key 请求头或 access_key 字段,
  带密钥强制校验(错误 401),不带密钥保持免鉴权
- 解锁后顶栏"复制 API 文档"按钮:以当前访问 URL 为基础地址动态生成
  Markdown 文档(免鉴权/带密钥两种 curl 示例,供智能体直接调用)
- 白昼/黑夜主题切换:CSS 变量驱动,localStorage 持久化,默认跟随系统
- 修复 hidden 属性被 display:flex 覆盖导致解锁层无法隐藏的问题
- 页面去除"免费/Agnes"文案,页脚署名青梧映星软件开发工作室
- build.bat/build.sh 简化为 Linux 交叉编译(CGO_ENABLED=0)
- 依赖精简:移除 golang-jwt/bcrypt,直接依赖仅 gin/sqlite/gorm/yaml

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-13 01:21:18 +08:00
parent a3bbf33358
commit f9cdeb5d64
20 changed files with 341 additions and 465 deletions

View File

@@ -1,6 +1,9 @@
/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 保证 hidden 属性始终生效(防止被 display:flex 等样式覆盖) */
[hidden] { display: none !important; }
:root {
--primary: #4f6ef7;
--primary-dark: #3a55d8;
@@ -11,6 +14,32 @@
--border: #e5e9f2;
--danger: #e5484d;
--radius: 12px;
/* 组件级颜色 */
--chip-bg: #eef1fe;
--dropzone-border: #c7d2fe;
--dropzone-bg: #fafbff;
--dropzone-hover: #eef1fe;
--result-bg: #f8f9fc;
--unlock-bg-1: #eef1fe;
--unlock-bg-2: #f4f6fb;
}
/* 黑夜模式 */
[data-theme="dark"] {
--primary: #6d8bff;
--primary-dark: #8aa4ff;
--bg: #0f1524;
--card: #1a2234;
--text: #e6e9f0;
--text-light: #9aa3b5;
--border: #2b3548;
--chip-bg: rgba(109, 139, 255, .18);
--dropzone-border: #3a4760;
--dropzone-bg: #141c2e;
--dropzone-hover: #1e2a42;
--result-bg: #121a2b;
--unlock-bg-1: #0f1524;
--unlock-bg-2: #1a2234;
}
body {
@@ -39,13 +68,16 @@ body {
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.account .user-chip {
background: #eef1fe;
color: var(--primary-dark);
background: var(--chip-bg);
color: var(--primary);
padding: 6px 12px;
border-radius: 999px;
font-weight: 600;
}
/* 顶栏常驻于解锁层之上,主题切换随时可用 */
.topbar { position: relative; z-index: 150; }
/* ===== 布局 ===== */
.container {
flex: 1;
@@ -68,15 +100,15 @@ body {
/* ===== 上传区 ===== */
.dropzone {
border: 2px dashed #c7d2fe;
border: 2px dashed var(--dropzone-border);
border-radius: var(--radius);
padding: 40px 20px;
text-align: center;
cursor: pointer;
transition: all .15s ease;
background: #fafbff;
background: var(--dropzone-bg);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #eef1fe; }
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--dropzone-hover); }
.dropzone-icon { font-size: 40px; }
.dropzone-title { margin-top: 10px; font-weight: 600; font-size: 15px; }
.dropzone-hint { margin-top: 6px; font-size: 12px; color: var(--text-light); }
@@ -147,7 +179,7 @@ body {
.result-head h2 { font-size: 16px; }
.result-body {
margin-top: 14px;
background: #f8f9fc;
background: var(--result-bg);
border: 1px solid var(--border);
border-radius: 10px;
padding: 16px;
@@ -171,35 +203,40 @@ body {
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ===== 模态框 ===== */
.modal-mask {
/* ===== 进入密钥解锁层 ===== */
.unlock-mask {
position: fixed;
inset: 0;
background: rgba(15, 20, 35, .45);
background: linear-gradient(135deg, var(--unlock-bg-1), var(--unlock-bg-2));
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.modal {
.unlock-card {
background: var(--card);
border-radius: 14px;
padding: 28px;
width: 380px;
box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
border: 1px solid var(--border);
border-radius: 16px;
padding: 36px 32px;
width: 360px;
text-align: center;
box-shadow: 0 20px 60px rgba(16, 24, 40, .12);
}
.modal h2 { font-size: 18px; }
.modal-desc { font-size: 13px; color: var(--text-light); margin: 6px 0 16px; }
.modal-input {
.unlock-icon { font-size: 42px; }
.unlock-card h2 { font-size: 20px; margin-top: 10px; }
.unlock-desc { font-size: 13px; color: var(--text-light); margin: 6px 0 18px; }
.unlock-input {
width: 100%;
padding: 11px 13px;
padding: 12px 14px;
margin-bottom: 10px;
border: 1px solid var(--border);
border-radius: 10px;
font-size: 14px;
font-size: 16px;
letter-spacing: 2px;
text-align: center;
outline: none;
}
.modal-input:focus { border-color: var(--primary); }
.unlock-input:focus { border-color: var(--primary); }
.modal-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 4px; }
/* ===== 页脚 ===== */