feat(安全): 实现JWT认证和HTTPS支持

- 添加JWT认证中间件保护API端点
- 在登录流程中使用bcrypt哈希密码和JWT令牌
- 配置HTTPS服务器使用自签名证书
- 更新前端API调用以包含认证令牌
This commit is contained in:
sudomarcma
2025-06-26 10:41:23 +08:00
parent 0ed8e4af30
commit e563f17283
10 changed files with 1357 additions and 69 deletions
+4
View File
@@ -13,12 +13,16 @@
"format": "prettier --write src/"
},
"dependencies": {
"@capacitor/cli": "^7.4.0",
"@capacitor/core": "^7.4.0",
"bcrypt": "^6.0.0",
"body-parser": "^2.2.0",
"cors": "^2.8.5",
"dotenv": "^16.5.0",
"express": "^5.1.0",
"html5-qrcode": "^2.3.8",
"json2csv": "^6.0.0-alpha.2",
"jsonwebtoken": "^9.0.2",
"mysql2": "^3.14.1",
"qrcode": "^1.5.4",
"uuid": "^11.1.0",