1
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
package platformapi
|
package platformapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -64,12 +64,9 @@ func Test_store(b *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_string_byte(t *testing.T) {
|
func Test_string_byte(t *testing.T) {
|
||||||
//rankKey := map[string]string{"a": "刘磊", "b": "张雨绮%s", "c": "<center>下单时间:%s</center>"}
|
aa := `<b>%s</b><b>1111111111111111111</b>`
|
||||||
//data, _ := json.Marshal(rankKey)
|
bb := strings.Replace(aa, "<b>", "<hb>", -1)
|
||||||
|
cc := strings.Replace(bb, "</b>", "</hb>", -1)
|
||||||
dd := `{"a": "刘磊", "b": "张雨绮%s", "c": "<center>下单时间:%s</center>"}`
|
fmt.Println("bb===========", bb)
|
||||||
var ee map[string]string
|
fmt.Println("cc===========", cc)
|
||||||
err := json.Unmarshal([]byte(dd), ee)
|
|
||||||
fmt.Println(err)
|
|
||||||
fmt.Println("dd:", ee)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ func (a *Api) SetExpirationTime(expiration int64) {
|
|||||||
// NewQBiDa 初始化token
|
// NewQBiDa 初始化token
|
||||||
func NewQBiDa(account, password string, config ...*platformapi.APIConfig) *Api {
|
func NewQBiDa(account, password string, config ...*platformapi.APIConfig) *Api {
|
||||||
if account == "" || password == "" {
|
if account == "" || password == "" {
|
||||||
panic("账号密码不能为空")
|
account = "18048531223"
|
||||||
|
password = "18080188338"
|
||||||
|
//panic("账号密码不能为空")
|
||||||
}
|
}
|
||||||
// 获取token,设置token和过期时间
|
// 获取token,设置token和过期时间
|
||||||
curConfig := platformapi.DefAPIConfig
|
curConfig := platformapi.DefAPIConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user