fix: 扫码轮询改用网站接受的回调名

This commit is contained in:
Nixevol
2026-10-16 16:31:16 +08:00
parent bf308aee92
commit 89b3160a21
3 changed files with 42 additions and 2 deletions
+11 -1
View File
@@ -1,6 +1,16 @@
package unicom
import "testing"
import (
"strings"
"testing"
)
func TestJSONPCallbackName(t *testing.T) {
name := jsonpCallback()
if !strings.HasPrefix(name, "jQuery") || !strings.Contains(name, "_") {
t.Fatal(name)
}
}
func TestParseJSONP(t *testing.T) {
quoted, err := parseJSONP(`cb({"resultCode":"false","ckCode":"2"});`)