feat(session):增加清除用户会话的工具函数。
This commit is contained in:
parent
57893a7c65
commit
cb481d9c28
5
cache/session.go
vendored
5
cache/session.go
vendored
|
@ -20,3 +20,8 @@ func HasSession(token string) (bool, error) {
|
||||||
key := fmt.Sprintf("session:%s", token)
|
key := fmt.Sprintf("session:%s", token)
|
||||||
return Exists(key)
|
return Exists(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ClearSession(token string) (bool, error) {
|
||||||
|
key := fmt.Sprintf("session:%s", token)
|
||||||
|
return Delete(key)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user