优化结构

This commit is contained in:
Yvan
2026-08-28 11:51:37 +08:00
parent 5b04998731
commit 33ba777137
25 changed files with 163 additions and 125 deletions
+5 -3
View File
@@ -14,7 +14,7 @@ import (
const (
CodeSuccess = httpx.CodeSuccess
CodeError = httpx.CodeError
CodePasswordChangeRequired = httpx.CodePasswordChangeRequired
CodePasswordChangeRequired = middleware.CodePasswordChangeRequired
)
type Response = httpx.Response
@@ -25,5 +25,7 @@ func OK(c *gin.Context) { httpx.OK(c) }
func OKWithData(c *gin.Context, data any) { httpx.OKWithData(c, data) }
func Fail(c *gin.Context, message string) { httpx.Fail(c, message) }
func NoAuth(c *gin.Context, message string) { httpx.NoAuth(c, message) }
func SetTokenCookie(c *gin.Context, value string, maxAge int) { httpx.SetTokenCookie(c, value, maxAge) }
func Claims(c *gin.Context) *system.AuthClaims { return middleware.Claims(c) }
func SetTokenCookie(c *gin.Context, value string, maxAge int) {
httpx.SetCookie(c, "x-token", value, maxAge)
}
func Claims(c *gin.Context) *system.AuthClaims { return middleware.Claims(c) }