refactor: remove user logout api
This commit is contained in:
@@ -81,17 +81,6 @@ func (u *UserApi) UpdateMail(context *gin.Context) {
|
||||
response.Result(errCode, nil, context)
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
func (u *UserApi) Logout(context *gin.Context) {
|
||||
token := context.Request.Header.Get("token")
|
||||
if token == "" {
|
||||
response.Result(response.ErrCodeParamInvalid, nil, context)
|
||||
return
|
||||
}
|
||||
errCode := u.userService.Logout(token)
|
||||
response.Result(errCode, nil, context)
|
||||
}
|
||||
|
||||
// 注销账号
|
||||
func (u *UserApi) Delete(context *gin.Context) {
|
||||
var param models.UserDeleteParam
|
||||
|
||||
@@ -178,15 +178,6 @@ func (u *UserService) UpdateMail(param *models.UserMailParam) int {
|
||||
return response.ErrCodeSuccess
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
func (u *UserService) Logout(token string) int {
|
||||
err := global.Rdb.Del(ctx, token).Err()
|
||||
if err != nil {
|
||||
return response.ErrCodeFailed
|
||||
}
|
||||
return response.ErrCodeSuccess
|
||||
}
|
||||
|
||||
// 注销账号
|
||||
func (u *UserService) Delete(param models.UserDeleteParam) int {
|
||||
// 校验验证码是否正确
|
||||
|
||||
Reference in New Issue
Block a user