fix: update Readme.md

This commit is contained in:
weloe
2023-09-08 21:14:40 +08:00
parent 71088365cf
commit 3290680d32
2 changed files with 5 additions and 2 deletions

View File

@@ -76,9 +76,9 @@ func Kickout(w http.ResponseWriter, req *http.Request) {
The same user can only log in once: `IsConcurrent = false && IsShare = false`
The same user logs in multiple times and shares a token: `IsConcurrent = true && IsShare = false`
The same user logs in multiple times and shares a token: `IsConcurrent = true && IsShare = true`
Multiple logins of the same user to multiple tokens: `IsConcurrent = true && IsShare = true`
Multiple logins of the same user to multiple tokens: `IsConcurrent = true && IsShare = false`
```go
import (

View File

@@ -294,6 +294,7 @@ func TestEnforcer_Kickout(t *testing.T) {
func TestEnforcerNotConcurrentNotShareLogin(t *testing.T) {
err, enforcer, ctx := NewTestNotConcurrentEnforcer(t)
t.Logf("concurrent: %v, share: %v", enforcer.config.IsConcurrent, enforcer.config.IsShare)
if err != nil {
t.Errorf("InitWithConfig() failed: %v", err)
}
@@ -315,6 +316,7 @@ func TestEnforcerNotConcurrentNotShareLogin(t *testing.T) {
func TestEnforcer_ConcurrentShare(t *testing.T) {
err, enforcer, ctx := NewTestEnforcer(t)
t.Logf("concurrent: %v, share: %v", enforcer.config.IsConcurrent, enforcer.config.IsShare)
if err != nil {
t.Errorf("InitWithConfig() failed: %v", err)
}
@@ -336,6 +338,7 @@ func TestEnforcer_ConcurrentShare(t *testing.T) {
}
func TestEnforcer_ConcurrentNotShareMultiLogin(t *testing.T) {
err, enforcer, ctx := NewTestConcurrentEnforcer(t)
t.Logf("concurrent: %v, share: %v", enforcer.config.IsConcurrent, enforcer.config.IsShare)
if err != nil {
t.Errorf("InitWithConfig() failed: %v", err)
}