123456789101112131415161718192021222324252627282930 |
- package system
- import (
- "gin-vue-admin/global"
- "gin-vue-admin/model/common/response"
- "gin-vue-admin/model/system"
- "github.com/gin-gonic/gin"
- "go.uber.org/zap"
- )
- type JwtApi struct {
- }
- func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
- token := c.Request.Header.Get("x-token")
- jwt := system.JwtBlacklist{Jwt: token}
- if err := jwtService.JsonInBlacklist(jwt); err != nil {
- global.GVA_LOG.Error("jwt作废失败!", zap.Any("err", err))
- response.FailWithMessage("jwt作废失败", c)
- } else {
- response.OkWithMessage("jwt作废成功", c)
- }
- }
|