This commit is contained in:
jiangyong27 2025-03-11 15:01:26 +08:00
parent 213ea50b47
commit 0b37523657
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ type Staff struct {
func NewStaff() *Staff { func NewStaff() *Staff {
return &Staff{} return &Staff{}
} }
func (s *Staff) Login(ctx *gin.Context) { func (s *Staff) Login(ctx *gin.Context) {
var req api.StaffLoginReq var req api.StaffLoginReq
session.CheckParamError(ctx.ShouldBindJSON(&req)) session.CheckParamError(ctx.ShouldBindJSON(&req))

View File

@ -26,7 +26,7 @@ func (s *StaffUser) Login(sess *session.AdminSession, req *api.StaffLoginReq) in
session.CheckDBError(err) session.CheckDBError(err)
session.CheckNilError(user, "企业用户不存在") session.CheckNilError(user, "企业用户不存在")
if user.Password != req.Password { if user.Password == "" || user.Password != req.Password {
panic("密码错误") panic("密码错误")
} }