This commit is contained in:
zhangwenjian committed 2020-04-13 00:30:58 +08:00
1 parent f25da5f1ee
commit 1df55e75e5
72 files changed
+1401 -1559

No files matched your search

+2 -2
View File
@@ -19,7 +19,7 @@ func (u *Login) GetUser() (user SysUser, role SysRole, e error) {
e = orm.Eloquent.Table("sys_user").Where("username = ? ", u.Username).Find(&user).Error
if e != nil {
if strings.Contains(e.Error(), "record not found") {
pkg.AssertErr(e, "账号或密码错误(代码204)", 500)
pkg.HasError(e, "账号或密码错误(代码204)", 500)
}
log.Print(e)
return
@@ -27,7 +27,7 @@ func (u *Login) GetUser() (user SysUser, role SysRole, e error) {
_, e = pkg.CompareHashAndPassword(user.Password, u.Password)
if e != nil {
if strings.Contains(e.Error(), "hashedPassword is not the hash of the given password") {
pkg.AssertErr(e, "账号或密码错误(代码201)", 500)
pkg.HasError(e, "账号或密码错误(代码201)", 500)
}
log.Print(e)
return