refactor: 整体迁移控制面至MySQL + 替换UI框架为Element Plus

1. 移除naive-ui依赖,迁移前端至Element Plus
2. 重构后端数据库层,切换为MySQL替代SQLite
3. 调整项目部署架构,停止exe打包改为源码部署
4. 新增设备上报接口与相关数据库模型
5. 优化配置路径与SQL语法,替换为MySQL占位符格式
6. 调整站点名称与文案,统一为「37du 插件管理平台」
7. 新增SQLite到MySQL迁移脚本
This commit is contained in:
2026-09-16 15:58:45 +08:00
parent 4363116e31
commit 84d3e103ec
54 changed files with 5542 additions and 1890 deletions
+3 -3
View File
@@ -38,14 +38,14 @@ def admin_dingtalk_auth(d: schemas.DingTalkIn,
ding_uid = (d.dingtalk_uid or "").strip()
with _db() as conn:
row = conn.execute(
"SELECT account, is_admin, must_change_pwd, nickname, status FROM accounts WHERE account = ?",
"SELECT account, is_admin, must_change_pwd, nickname, status FROM accounts WHERE account = %s",
(account,)).fetchone()
if row:
# 已存在:顺带同步昵称(钉钉名),但不改密码/权限;原有 must_change_pwd 保留
if not row["status"]:
raise HTTPException(403, "账号已停用,请联系管理员")
if nickname and nickname != (row["nickname"] or ""):
conn.execute("UPDATE accounts SET nickname = ? WHERE account = ?",
conn.execute("UPDATE accounts SET nickname = %s WHERE account = %s",
(nickname, account))
conn.commit()
return {"ok": True, "account": account,
@@ -60,7 +60,7 @@ def admin_dingtalk_auth(d: schemas.DingTalkIn,
_hex, _salt = _hash_password(pwd)
conn.execute(
"INSERT INTO accounts(account, password_hash, salt, is_admin, dept, nickname, "
"dingtalk_uid, must_change_pwd) VALUES (?, ?, ?, 0, '', ?, ?, 1)",
"dingtalk_uid, must_change_pwd) VALUES (%s, %s, %s, 0, '', %s, %s, 1)",
(account, _hex, _salt, nickname, ding_uid))
conn.commit()
return {"ok": True, "account": account, "nickname": nickname,