实现游戏人生背包url 返回

This commit is contained in:
2025-06-23 17:53:35 +08:00
parent 7d167dcf52
commit 2c59949e87
8 changed files with 59 additions and 6 deletions

View File

@ -73,7 +73,7 @@ var URLMaps = struct {
},
Package: map[string]string{
"test": "https://test.igame.qq.com/tip/ingame-page/feature/add-game-life/igame-game-life-web/#/index/goods",
"prod": "https://igame.qq.com/tip/ingame-page/feature/add-game-life/igame-game-life-web/#/index/goods",
"prod": "https://igame.qq.com/tip/ingame-page/igame-game-life-web/index.html#/index/goods",
},
}
@ -195,7 +195,7 @@ func (s *gamelifeClient) GetUrl(ctx context.Context, popenID, appName, nickname
}
return fmt.Sprintf("%s?%s", rootURL, params), nil
}
func (s *gamelifeClient) GetGamelifePackageUrl(ctx context.Context, popenID, appName string, bindType int) (string, error) {
func (s *gamelifeClient) GetGamelifePackageUrl(ctx context.Context, popenID, gameCode string, gameId, bindType int) (string, error) {
// 从配置中获取 package URL 前缀
packageURL := s.packageURLMap[s.config.Mode]
@ -204,10 +204,15 @@ func (s *gamelifeClient) GetGamelifePackageUrl(ctx context.Context, popenID, app
if err != nil {
return "", err
}
params, err := s.buildQueryParams(ctx, popenID, cache, appName, "", bindType, true)
params, err := s.buildQueryParams(ctx, popenID, cache, gameCode, "", bindType, true)
if err != nil {
return "", err
}
if gameId != 0 {
params = fmt.Sprintf("%s&gid=%d", params, gameId)
}
return fmt.Sprintf("%s?%s", packageURL, params), nil
}