You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
435 B
29 lines
435 B
2 years ago
|
package mw
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestCheck(t *testing.T) {
|
||
|
config.Config.Secret = "123456"
|
||
|
|
||
|
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)
|
||
|
|
||
|
}
|