Trust
Trust
  • 发布:2018-01-23 19:08
  • 更新:2018-11-05 16:50
  • 阅读:4003

【示例】wap2app应用中302等二次跳转的地址匹配

分类:wap2app

场景一

页面A -> 点击跳转 -> 302等地址 -> 目标地址

302地址: http://m.example.com/redirect?redirect_url=http://m.example.com/detail.html
目标地址:http://m.example.com/detail.html

为了防止出现白屏或者重复打开窗口的情况,需要在 sitemap.json -> pages 中,将302地址与目标地址匹配到一起。

{  
  "webviewId": "detail",  
  "matchUrls": [  
    {  
      "pathname": "/redirect",  
      "search": "R:redirect_url=.*\\/detail.html"  
    }, {  
      "pathname": "/detail.html"  
    }  
  ]  
}

Tips
快速获取matchUrls可用的匹配依据的值

0 关注 分享

要回复文章请先登录注册

[已删除]

[已删除]

回复 shanyingqing :
请问你匹配好了吗
2018-11-05 16:50
shanyingqing

shanyingqing

回复 Trust :
本来是要打开http://m.example.com/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member地址的,但通过302跳转到http://m.example.com/i=1&c=entry&m=ewei_shopv2&do=mobile&r=account.login?&backurl=/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member地址上,这个二次跳转后的地址怎么配置呢
2018-01-24 11:50
shanyingqing

shanyingqing

回复 Trust :
302二次跳转后的这个地址没用办法配置嘛 http://m.example.com/i=1&c=entry&m=ewei_shopv2&do=mobile&r=account.login?&backurl=/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member
2018-01-24 11:48
Trust

Trust (作者)

回复 shanyingqing :
原生的标题栏会自动读取 HTML 中 title 节点的值,如果希望是固定值,则在相应的节点配置。
2018-01-24 11:43
Trust

Trust (作者)

回复 shanyingqing :
参考示例以及文档,可以根据 pathname 以及 search 中的值进行匹配。
2018-01-24 11:42
shanyingqing

shanyingqing

原地址:http://m.example.com/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member
目标地址 http://m.example.com/i=1&c=entry&m=ewei_shopv2&do=mobile&r=account.login?&backurl=/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member
怎么匹配原地址和目标地址呢?
2018-01-24 11:36
shanyingqing

shanyingqing

如何定义跳转前导航标题名称和跳转后的导航标题名称
2018-01-24 10:47