:recycle:重构了部分代码

This commit is contained in:
coward
2024-03-13 17:05:02 +08:00
parent 7716a15dbb
commit 7c48551989
15 changed files with 125 additions and 29 deletions

View File

@@ -56,15 +56,16 @@ func (user) Login(c *gin.Context) {
}
// 生成token
token, err := component.JWT().GenerateToken(user.Id)
token, expireTime, err := component.JWT().GenerateToken(user.Id)
if err != nil {
utils.GinResponse(c).FailedWithMsg("登陆失败")
return
}
utils.GinResponse(c).OKWithData(map[string]any{
"token": token,
"type": "Bearer",
"token": token,
"type": "Bearer",
"expireAt": expireTime.Unix(),
})
}