From 3290680d32ed8bf13d1f89726e73f23d830211bd Mon Sep 17 00:00:00 2001 From: weloe <1345895607@qq.com> Date: Fri, 8 Sep 2023 21:14:40 +0800 Subject: [PATCH] fix: update Readme.md --- Readme.md | 4 ++-- enforcer_test.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index f38516b..5ed2f3d 100644 --- a/Readme.md +++ b/Readme.md @@ -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 ( diff --git a/enforcer_test.go b/enforcer_test.go index 722ce9c..29b4711 100644 --- a/enforcer_test.go +++ b/enforcer_test.go @@ -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) }