1
This commit is contained in:
parent
bce6eb9970
commit
822ffa83d0
@ -3,10 +3,12 @@ package user
|
|||||||
import (
|
import (
|
||||||
"q5"
|
"q5"
|
||||||
"f5"
|
"f5"
|
||||||
|
"errors"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
"main/common"
|
"main/common"
|
||||||
"main/model"
|
"main/model"
|
||||||
"main/vo"
|
"main/vo"
|
||||||
|
"gorm.io/gorm"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,7 +23,8 @@ func (this *UserApi) Login(c *gin.Context) {
|
|||||||
user := new(model.User)
|
user := new(model.User)
|
||||||
userVo := new(vo.User)
|
userVo := new(vo.User)
|
||||||
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(user.TableName()).Take(
|
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(user.TableName()).Take(
|
||||||
user, "account_id = ?", s.GetAccountId()); result.Error != nil {
|
user, "account_id = ?", s.GetAccountId()); result.Error != nil &&
|
||||||
|
!errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||||
f5.RspErr(c, 500, "server internal error")
|
f5.RspErr(c, 500, "server internal error")
|
||||||
return
|
return
|
||||||
} else if result.RowsAffected <= 0{
|
} else if result.RowsAffected <= 0{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user