添加桥接
This commit is contained in:
parent
5b980e8ed1
commit
e921b7912c
@ -670,6 +670,7 @@ func buildLaunchURL(game gamedomain.LaunchableGame, session gamedomain.LaunchSes
|
||||
if strings.EqualFold(game.AdapterType, gamedomain.AdapterBaishunV1) {
|
||||
// 百顺前端规范以 NativeBridge.getConfig 为准;这里把同一份配置也拼到 URL,方便 Flutter/H5 壳层读取。
|
||||
config := baishunConfigFromPlatform(game)
|
||||
query.Set("bridge_keys", "appChannel,appId,code,gameMode,gsp,language,roomId,sceneMode")
|
||||
query.Set("appChannel", config.AppChannel)
|
||||
if config.AppID > 0 {
|
||||
query.Set("appId", strconv.FormatInt(config.AppID, 10))
|
||||
@ -685,9 +686,7 @@ func buildLaunchURL(game gamedomain.LaunchableGame, session gamedomain.LaunchSes
|
||||
if config.CurrencyIcon != "" {
|
||||
query.Set("currencyIcon", config.CurrencyIcon)
|
||||
}
|
||||
if config.GSP > 0 {
|
||||
query.Set("gsp", strconv.FormatInt(config.GSP, 10))
|
||||
}
|
||||
query.Set("gsp", strconv.FormatInt(config.GSP, 10))
|
||||
parsed.RawQuery = query.Encode()
|
||||
return parsed.String(), nil
|
||||
}
|
||||
|
||||
@ -323,6 +323,7 @@ func TestLaunchGameBuildsBaishunURL(t *testing.T) {
|
||||
"gameMode": "3",
|
||||
"language": "2",
|
||||
"sceneMode": "1",
|
||||
"bridge_keys": "appChannel,appId,code,gameMode,gsp,language,roomId,sceneMode",
|
||||
"currencyIcon": "https://cdn.example/coin.png",
|
||||
"gsp": "101",
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user