Files
open-im-server/pkg/common/mw/check_test.go
T

28 lines
393 B
Go
Raw Normal View History

2023-06-30 09:45:02 +08:00
package mw
import (
"fmt"
"testing"
)
func TestCheck(t *testing.T) {
2023-06-30 23:04:28 +08:00
// config.Config.TokenPolicy.Secret = "123456"
2023-06-30 09:45:02 +08:00
args := []string{"1", "2", "3"}
key := genReqKey(args)
fmt.Println("key:", key)
err := verifyReqKey(args, key)
fmt.Println(err)
args = []string{"4", "5", "6"}
key = genReqKey(args)
fmt.Println("key:", key)
err = verifyReqKey(args, key)
fmt.Println(err)
}