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:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vision Tool — 免费图片识别</title>
|
||||
<title>Vision Tool — 在线图片识别</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,11 +12,12 @@
|
||||
<span class="logo">👁️</span>
|
||||
<div>
|
||||
<h1>Vision Tool</h1>
|
||||
<p>免费图片识别 · Agnes-2.0-Flash</p>
|
||||
<p>在线图片识别</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="account" id="accountArea">
|
||||
<!-- 登录状态由 JS 渲染 -->
|
||||
<button class="btn btn-ghost" id="themeBtn" title="切换白昼/黑夜">🌙</button>
|
||||
<!-- 解锁状态由 JS 渲染 -->
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -49,31 +50,19 @@
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 初始化管理员模态框 -->
|
||||
<div class="modal-mask" id="initModal" hidden>
|
||||
<div class="modal">
|
||||
<h2>初始化管理员</h2>
|
||||
<p class="modal-desc">首次使用,请创建管理员账号</p>
|
||||
<input type="text" id="initUsername" placeholder="用户名" class="modal-input">
|
||||
<input type="password" id="initPassword" placeholder="密码(至少 6 位)" class="modal-input">
|
||||
<input type="password" id="initPassword2" placeholder="确认密码" class="modal-input">
|
||||
<div class="modal-error" id="initError"></div>
|
||||
<button class="btn btn-primary btn-block" id="initBtn">创建管理员</button>
|
||||
<!-- 进入密钥解锁层 -->
|
||||
<div class="unlock-mask" id="unlockLayer">
|
||||
<div class="unlock-card">
|
||||
<div class="unlock-icon">🔐</div>
|
||||
<h2>Vision Tool</h2>
|
||||
<p class="unlock-desc">请输入进入密钥</p>
|
||||
<input type="password" id="unlockKey" class="unlock-input" placeholder="进入密钥" autofocus>
|
||||
<div class="modal-error" id="unlockError"></div>
|
||||
<button class="btn btn-primary btn-block" id="unlockBtn">进入</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 登录模态框 -->
|
||||
<div class="modal-mask" id="loginModal" hidden>
|
||||
<div class="modal">
|
||||
<h2>登录</h2>
|
||||
<input type="text" id="loginUsername" placeholder="用户名" class="modal-input">
|
||||
<input type="password" id="loginPassword" placeholder="密码" class="modal-input">
|
||||
<div class="modal-error" id="loginError"></div>
|
||||
<button class="btn btn-primary btn-block" id="loginBtn">登录</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">推理模型专心推理,图片理解交给免费小模型 · 识别接口支持 API 直接调用</footer>
|
||||
<footer class="footer">在线图片识别 · 识别接口支持 API 直接调用<br>© 青梧映星软件开发工作室 版权所有</footer>
|
||||
|
||||
<script src="/js/app.js"></script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user