You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Navigation Component Deeplink解析含URL的查询参数时截断问题

问题与解决方案

问题场景

现有DeepLink:

https://example.com/?url=https://google.com/?search=apple&sourceid=chrome

当前解析结果(不符合预期):

domain = https://example.com
queryParams = {
    url = https://google.com/?search=apple
    sourceid = chrome
}

期望解析结果:

domain = https://example.com
queryParams = {
    url= https://google.com/?search=apple&sourceid=chrome
}

核心需求:让https://google.com/?search=apple&sourceid=chrome完整作为url参数的值,不被拆分出sourceid参数。


解决方法

  • 对嵌套URL做URL编码:把作为参数值的https://google.com/?search=apple&sourceid=chrome进行全URL编码,编码后里面的&会被转义为%26,外层解析器就不会将其识别为参数分隔符。
    编码后的DeepLink示例:
    https://example.com/?url=https%3A%2F%2Fgoogle.com%2F%3Fsearch%3Dapple%26sourceid%3Dchrome
    
  • 生成DeepLink时的注意事项:在拼接这类包含嵌套URL的DeepLink时,必须对作为参数值的URL进行编码处理,不能直接拼接原始URL,从根源上避免参数被误拆分。

内容的提问来源于stack exchange,提问作者mrzbn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 16:22:35