1
This commit is contained in:
parent
a78458ace3
commit
55f53c1d82
@ -21,7 +21,10 @@ func (this *UserApi) Login(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
user := new(model.User)
|
user := new(model.User)
|
||||||
userVo := new(vo.User)
|
rspObj := struct {
|
||||||
|
vo.BaseVo
|
||||||
|
UserInfo vo.User `json:"user_info"`
|
||||||
|
}{}
|
||||||
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) {
|
!errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||||
@ -41,6 +44,6 @@ func (this *UserApi) Login(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userVo.FromModel(user)
|
rspObj.UserInfo.FromModel(user)
|
||||||
c.JSON(200, userVo)
|
c.JSON(200, rspObj)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
BaseVo
|
|
||||||
AccountId string `json:"account_id"`
|
AccountId string `json:"account_id"`
|
||||||
NickName string `json:"nickname"`
|
NickName string `json:"nickname"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user