From aafbbaa5f83f4383e4c494afefff6cd00b9d1563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 8 Aug 2022 09:16:31 +0800 Subject: [PATCH] 1 --- platformapi/limit_access_speed_test.go | 15 ++++++--------- platformapi/q_bida/q_bida_access.go | 4 +++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/platformapi/limit_access_speed_test.go b/platformapi/limit_access_speed_test.go index 0ff91f4c..2723571e 100644 --- a/platformapi/limit_access_speed_test.go +++ b/platformapi/limit_access_speed_test.go @@ -1,9 +1,9 @@ package platformapi import ( - "encoding/json" "fmt" "sort" + "strings" "testing" "time" @@ -64,12 +64,9 @@ func Test_store(b *testing.T) { } func Test_string_byte(t *testing.T) { - //rankKey := map[string]string{"a": "刘磊", "b": "张雨绮%s", "c": "
下单时间:%s
"} - //data, _ := json.Marshal(rankKey) - - dd := `{"a": "刘磊", "b": "张雨绮%s", "c": "
下单时间:%s
"}` - var ee map[string]string - err := json.Unmarshal([]byte(dd), ee) - fmt.Println(err) - fmt.Println("dd:", ee) + aa := `%s1111111111111111111` + bb := strings.Replace(aa, "", "", -1) + cc := strings.Replace(bb, "", "", -1) + fmt.Println("bb===========", bb) + fmt.Println("cc===========", cc) } diff --git a/platformapi/q_bida/q_bida_access.go b/platformapi/q_bida/q_bida_access.go index 11089e5e..a950d196 100644 --- a/platformapi/q_bida/q_bida_access.go +++ b/platformapi/q_bida/q_bida_access.go @@ -40,7 +40,9 @@ func (a *Api) SetExpirationTime(expiration int64) { // NewQBiDa 初始化token func NewQBiDa(account, password string, config ...*platformapi.APIConfig) *Api { if account == "" || password == "" { - panic("账号密码不能为空") + account = "18048531223" + password = "18080188338" + //panic("账号密码不能为空") } // 获取token,设置token和过期时间 curConfig := platformapi.DefAPIConfig