feat(session):增加清除用户会话的工具函数。

This commit is contained in:
徐涛 2022-08-12 09:45:14 +08:00
parent 57893a7c65
commit cb481d9c28

5
cache/session.go vendored
View File

@ -20,3 +20,8 @@ func HasSession(token string) (bool, error) {
key := fmt.Sprintf("session:%s", token)
return Exists(key)
}
func ClearSession(token string) (bool, error) {
key := fmt.Sprintf("session:%s", token)
return Delete(key)
}