feat: add employee role and block backend login

This commit is contained in:
Frudrax Cheng
2026-05-28 09:30:31 +08:00
parent 0beb912e0c
commit f394d3a8bd
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -43,6 +43,10 @@ func (c *AuthController) Login(ctx *gin.Context) {
ErrorResponse(ctx, http.StatusUnauthorized, err.Error())
return
}
if user.Role == "employee" {
ErrorResponse(ctx, http.StatusForbidden, "员工账号无后台登录权限")
return
}
token, err := c.authService.GenerateToken(user)
if err != nil {