新增退出登陆,新增jwt中int64类型错误问题
This commit is contained in:
@@ -41,24 +41,25 @@ func (b *BasicService) Login(LoginRequest requests.Login) (basicResponse.Login,
|
||||
}
|
||||
|
||||
token := &utils.Token{
|
||||
UserId: adminUser.UserID,
|
||||
RoleId: adminUser.RoleID,
|
||||
DeptId: adminUser.DeptID,
|
||||
PostId: adminUser.PostID,
|
||||
UserId: strconv.FormatInt(adminUser.UserID, 10),
|
||||
RoleId: strconv.FormatInt(adminUser.RoleID, 10),
|
||||
DeptId: strconv.FormatInt(adminUser.DeptID, 10),
|
||||
PostId: strconv.FormatInt(adminUser.PostID, 10),
|
||||
}
|
||||
|
||||
// 生成jwt
|
||||
jwt, err := token.NewJWT()
|
||||
if err != nil {
|
||||
return basicResponse.Login{}, errors.New("登陆失败")
|
||||
}
|
||||
|
||||
// 生成jwt
|
||||
result := basicResponse.Login{
|
||||
UserId: strconv.FormatInt(adminUser.UserID, 10),
|
||||
NickName: adminUser.NickName,
|
||||
Avatar: adminUser.Avatar,
|
||||
Token: jwt,
|
||||
}
|
||||
|
||||
result.GetFullAvatar()
|
||||
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user