fix: preserve xiaodian ios platform in asset queries
This commit is contained in:
@@ -147,10 +147,16 @@ func TestProductsAutomaticallyResolvesXiaodianRoleAndPaginates(t *testing.T) {
|
||||
if got := r.URL.Query().Get("_act_id"); got != "46195" {
|
||||
t.Errorf("_act_id = %q", got)
|
||||
}
|
||||
_, _ = w.Write([]byte(`var info = {"gameOpenId":"openid","roleId":1192083858,"roleName":"测试角色","type":"qq","area":1};`))
|
||||
_, _ = w.Write([]byte(`var info = {"gameOpenId":"openid","roleId":1192083858,"roleName":"测试角色","type":"qq","area":1,"platId":0};`))
|
||||
case "/role/":
|
||||
if got := r.URL.Query().Get("plat"); got != "0" {
|
||||
t.Errorf("plat = %q, want iOS platform 0", got)
|
||||
}
|
||||
switch r.URL.Query().Get("_jsvar") {
|
||||
case "banlanceInfo":
|
||||
if got := r.URL.Query().Get("_time"); len(got) != 13 {
|
||||
t.Errorf("_time = %q, want millisecond timestamp", got)
|
||||
}
|
||||
_, _ = w.Write([]byte(`var banlanceInfo={"balance":8800};`))
|
||||
case "jbInfos":
|
||||
_, _ = w.Write([]byte(`var jbInfos={"jb2":"36"};`))
|
||||
@@ -236,7 +242,7 @@ func TestProductsAutomaticallyResolvesXiaodianRoleAndPaginates(t *testing.T) {
|
||||
t.Fatalf("资产 = %#v", assets)
|
||||
}
|
||||
role, err := cli.XiaodianRole("acf_uid=uid; acf_stk=stk; acf_ltkid=ltkid")
|
||||
if err != nil || role.RoleName != "测试角色" || role.AreaID != 2 {
|
||||
if err != nil || role.RoleName != "测试角色" || role.AreaID != 2 || role.PlatID != 0 {
|
||||
t.Fatalf("角色 = %#v, err=%v", role, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user