perf(auth): 降低会话校验请求与重复查库

This commit is contained in:
yml
2026-11-20 19:18:25 +08:00
parent 9242f44281
commit ec6f79f196
10 changed files with 208 additions and 30 deletions
+5
View File
@@ -217,6 +217,11 @@ func (h *Handler) Logout(c *gin.Context) {
response.OK(c, gin.H{"logged_out": true})
}
// Session 返回当前 access token 仍有效。数据库校验由 requireAuth 完成,这里不重复查询。
func (h *Handler) Session(c *gin.Context) {
response.OK(c, gin.H{"active": true})
}
func (h *Handler) PasswordLogin(c *gin.Context) {
var req PasswordLoginRequest
if err := c.ShouldBindJSON(&req); err != nil {