vue-hash路由微信分享#以后被截断打开始终是首页
文章目录
公众号详情页需要单独做一个分享,分享出去以后发现#/以后的一些参数被截断了打开的始终是首页
解决方案:
let bid = window.localStorage.getItem("bid");
let self = this;
let auto_url = encodeURIComponent(`goods-detail?item_id=${self.item_id}`);
let link = encodeURI(
`${encodeURI(baseUrl)}?auto_url=${auto_url}&bid=${encodeURI(
bid + "#"
)}/goods-detail?item_id=${self.item_id}`
);`
参数用encodeURIComponent先进行编码,再使用encodeURI进行二次编码,安卓ios亲测有效
如果二次转发出现这种情况,一般都是签名失败,把debug打开可以看到调试信息
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论