Browse Source
Merge pull request #45 from flipped-aurora/gin-vue-admin_v2_dev-restruct-service
Fixed bug that can not create jwt black record
main
Grant
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
3 deletions
-
server/api/v1/sys_jwt_blacklist.go
-
server/api/v1/sys_user.go
-
server/service/jwt_black_list.go
|
@ -20,7 +20,7 @@ func JsonInBlacklist(c *gin.Context) { |
|
|
modelJwt := model.JwtBlacklist{ |
|
|
modelJwt := model.JwtBlacklist{ |
|
|
Jwt: token, |
|
|
Jwt: token, |
|
|
} |
|
|
} |
|
|
err := service.JsonInBlacklist(modelJwt) |
|
|
|
|
|
|
|
|
err := service.JsonInBlacklist(&modelJwt) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
response.FailWithMessage(fmt.Sprintf("jwt作废失败,%v", err), c) |
|
|
response.FailWithMessage(fmt.Sprintf("jwt作废失败,%v", err), c) |
|
|
} else { |
|
|
} else { |
|
|
|
@ -103,7 +103,7 @@ func tokenNext(c *gin.Context, user model.SysUser) { |
|
|
} else { |
|
|
} else { |
|
|
var blackJWT model.JwtBlacklist |
|
|
var blackJWT model.JwtBlacklist |
|
|
blackJWT.Jwt = jwtStr |
|
|
blackJWT.Jwt = jwtStr |
|
|
err3 := service.JsonInBlacklist(blackJWT) |
|
|
|
|
|
|
|
|
err3 := service.JsonInBlacklist(&blackJWT) |
|
|
if err3 != nil { |
|
|
if err3 != nil { |
|
|
response.FailWithMessage("jwt作废失败", c) |
|
|
response.FailWithMessage("jwt作废失败", c) |
|
|
} else { |
|
|
} else { |
|
|
|
@ -9,7 +9,7 @@ import ( |
|
|
// @description create jwt blacklist
|
|
|
// @description create jwt blacklist
|
|
|
// @auth (2020/04/05 20:22 )
|
|
|
// @auth (2020/04/05 20:22 )
|
|
|
// @return err error
|
|
|
// @return err error
|
|
|
func JsonInBlacklist(j model.JwtBlacklist) (err error) { |
|
|
|
|
|
|
|
|
func JsonInBlacklist(j *model.JwtBlacklist) (err error) { |
|
|
err = global.GVA_DB.Create(j).Error |
|
|
err = global.GVA_DB.Create(j).Error |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|