You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
517 B
23 lines
517 B
4 months ago
|
package sys
|
||
|
|
||
|
import (
|
||
|
"service-api/global"
|
||
|
"service-api/model"
|
||
|
"service-api/model/response"
|
||
|
"service-api/service"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"go.uber.org/zap"
|
||
|
)
|
||
|
|
||
|
func JsonInBlacklist(c *gin.Context) {
|
||
|
token := c.Request.Header.Get("x-token")
|
||
|
jwt := model.JwtBlacklist{Jwt: token}
|
||
|
if err := service.JsonInBlacklist(jwt); err != nil {
|
||
|
global.MG_LOG.Error("jwt作废失败!", zap.Any("err", err))
|
||
|
response.FailWithMessage("jwt作废失败", c)
|
||
|
} else {
|
||
|
response.OkWithMessage("jwt作废成功", c)
|
||
|
}
|
||
|
}
|