12345678910111213141516171819202122 |
- package system
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "lcfns/model/common/response"
- "lcfns/model/system"
- )
- type JwtApi struct{}
- func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
- token := c.Request.Header.Get("x-token")
- jwt := system.JwtBlacklist{Jwt: token}
- err := jwtService.JsonInBlacklist(jwt)
- if err != nil {
- logrus.Error("jwt作废失败!", err)
- response.FailWithMessage("jwt作废失败", c)
- return
- }
- response.OkWithMessage("jwt作废成功", c)
- }
|