fix login result

This commit is contained in:
yxh 2023-10-20 21:40:43 +08:00
parent bd66e0d946
commit e2b44392a3
2 changed files with 2 additions and 3 deletions

View File

@ -77,7 +77,6 @@ func (c *loginController) Login(ctx context.Context, req *system.UserLoginReq) (
if g.Cfg().MustGet(ctx, "gfToken.multiLogin").Bool() {
key = gconv.String(user.Id) + "-" + gmd5.MustEncryptString(user.UserName) + gmd5.MustEncryptString(user.UserPassword+ip+userAgent)
}
user.UserPassword = ""
token, err = service.GfToken().GenerateToken(ctx, key, user)
if err != nil {
g.Log().Error(ctx, err)

View File

@ -17,8 +17,8 @@ type LoginUserRes struct {
Id uint64 `orm:"id,primary" json:"id"` //
UserName string `orm:"user_name,unique" json:"userName"` // 用户名
UserNickname string `orm:"user_nickname" json:"userNickname"` // 用户昵称
UserPassword string `orm:"user_password" json:"userPassword"` // 登录密码;cmf_password加密
UserSalt string `orm:"user_salt" json:"userSalt"` // 加密盐
UserPassword string `orm:"user_password" json:"-"` // 登录密码;cmf_password加密
UserSalt string `orm:"user_salt" json:"-"` // 加密盐
UserStatus uint `orm:"user_status" json:"userStatus"` // 用户状态;0:禁用,1:正常,2:未验证
IsAdmin int `orm:"is_admin" json:"isAdmin"` // 是否后台管理员 1 是 0 否
Avatar string `orm:"avatar" json:"avatar"` //头像