refactor(app): 重构应用并添加开发脚本

- 移除了登录路由
- 添加了 nodemon 开发脚本
- 引入了 nodemon 依赖
- 在 verifyThirdPartyToken 中添加了日志输出
This commit is contained in:
aixianling
2025-02-25 17:40:08 +08:00
parent 5d36226b02
commit b895f8f247
2 changed files with 5 additions and 10 deletions

7
app.js
View File

@@ -33,13 +33,6 @@ router.get("/public", (ctx) => {
ctx.body = "Public content";
});
// 登录路由
router.post("/login", (ctx) => {
const user = { id: 1, username: "admin" };
const token = jwt.sign(user, process.env.JWT_SECRET, { expiresIn: "1h" });
ctx.body = { token };
});
// 自定义中间件解析并验证第三方Token
app.use(async (ctx, next) => {
const authHeader = ctx.headers.authorization;