@@ -12,18 +12,18 @@ func JwtAuth() gin.HandlerFunc {
1212 //测试先关闭
1313 token := c .GetHeader ("api-token" )
1414 if token == "" {
15- response .Fail (c , 403 , "请先登录" )
15+ response .Fail (c , 403 , response . TranslateMsg ( c , "NeedLogin" ) )
1616 c .Abort ()
1717 return
1818 }
1919 uid , err := global .Jwt .ParseToken (token )
2020 if err != nil {
21- response .Fail (c , 403 , "请先登录" )
21+ response .Fail (c , 403 , response . TranslateMsg ( c , "NeedLogin" ) )
2222 c .Abort ()
2323 return
2424 }
2525 if uid == 0 {
26- response .Fail (c , 403 , "请先登录" )
26+ response .Fail (c , 403 , response . TranslateMsg ( c , "NeedLogin" ) )
2727 c .Abort ()
2828 return
2929 }
@@ -34,12 +34,12 @@ func JwtAuth() gin.HandlerFunc {
3434 // Username: "测试用户",
3535 //}
3636 if user .Id == 0 {
37- response .Fail (c , 403 , "请先登录" )
37+ response .Fail (c , 403 , response . TranslateMsg ( c , "NeedLogin" ) )
3838 c .Abort ()
3939 return
4040 }
4141 if ! service .AllService .UserService .CheckUserEnable (user ) {
42- response .Fail (c , 101 , "你已被禁用" )
42+ response .Fail (c , 101 , response . TranslateMsg ( c , "Banned" ) )
4343 c .Abort ()
4444 return
4545 }
0 commit comments