feat: add banned feature and api IsLoginByToken()

This commit is contained in:
weloe
2023-05-24 22:10:07 +08:00
parent 82680c3ce4
commit 8bf577c030
7 changed files with 139 additions and 11 deletions

View File

@@ -144,6 +144,10 @@ func (e *Enforcer) spliceTokenKey(id string) string {
return e.config.TokenName + ":" + e.loginType + ":token:" + id
}
func (e *Enforcer) spliceBannedKey(id string, service string) string {
return e.config.TokenName + ":" + e.loginType + ":ban:" + service + ":" + id
}
func (e *Enforcer) SetJwtSecretKey(key string) {
e.config.JwtSecretKey = key
}