6
0

Compare commits

...

2 Commits

Author SHA1 Message Date
liguanjie
f56cdad6d0 【passport】角色查询优化 2025-08-12 17:10:23 +08:00
huangqz
f296d38583 game_info 新增是否需要实名字段 2025-08-07 17:49:59 +08:00
3 changed files with 15 additions and 9 deletions

View File

@ -151,6 +151,7 @@ type GameInfoData struct {
UpdatedAt string `json:"updated_at"`
UpdatedRealname string `json:"updated_realname"`
UpdatedUsername string `json:"updated_username"`
IsAuth int `json:"is_auth"`
}
func CreateGetGameInfoByIdReq(gameId, noCache int) *GetGameInfoReq {

View File

@ -25,7 +25,10 @@ func TestGetUserRoleList(t *testing.T) {
if err != nil {
t.Error(err)
}
req := CreateGetUserRoleListRequest(63610626, 2850)
// 不限定角色
//req := CreateGetUserRoleListRequest(221016372, 7874, 0, "")
// 限定角色
req := CreateGetUserRoleListRequest(221016372, 7874, 265500390, "勇闯关东")
resp, err := client.GetUserRoleList(req)
if err != nil {
t.Error(err)

View File

@ -85,7 +85,7 @@ func GetSign() (ts int64, sign string) {
}
// CreateGetUserRoleListRequest 获取玩家角色列表
func CreateGetUserRoleListRequest(uid int, gameId int) (req *GetUserRoleListRequest) {
func CreateGetUserRoleListRequest(uid int, gameId int, roleId int, roleServer string) (req *GetUserRoleListRequest) {
ts, sign := GetSign()
req = &GetUserRoleListRequest{
@ -93,13 +93,15 @@ func CreateGetUserRoleListRequest(uid int, gameId int) (req *GetUserRoleListRequ
}
req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
req.FormParams = map[string]string{
"act": "info",
"do": "user_role",
"method": "get",
"uid": fmt.Sprintf("%d", uid),
"game_id": fmt.Sprintf("%d", gameId),
"time": fmt.Sprintf("%v", ts),
"sign": sign,
"act": "info",
"do": "user_role",
"method": "get",
"uid": fmt.Sprintf("%d", uid),
"game_id": fmt.Sprintf("%d", gameId),
"role_id": fmt.Sprintf("%d", roleId),
"role_server": roleServer,
"time": fmt.Sprintf("%v", ts),
"sign": sign,
}
req.Method = requests.POST