feat(i18n): replace hardcoded messages with translated strings (#289)

This commit is contained in:
Plynksiy Nikita
2025-06-17 04:05:10 +03:00
committed by GitHub
parent 4b16ad29bb
commit f68ec8f3a1
12 changed files with 49 additions and 14 deletions

View File

@@ -13,13 +13,13 @@ func BackendUserAuth() gin.HandlerFunc {
//测试先关闭
token := c.GetHeader("api-token")
if token == "" {
response.Fail(c, 403, "请先登录")
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
c.Abort()
return
}
user, ut := service.AllService.UserService.InfoByAccessToken(token)
if user.Id == 0 {
response.Fail(c, 403, "请先登录")
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
c.Abort()
return
}