实现游戏人生背包url 返回
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user