企微跳转到外部浏览器404
onContact() {
const encodeKeyword = encodeURI(this.entryParams.keyword);
const url =
this.entryParams.type === 1
? `${Config.inClue}/Spa${this.uniUrl}?cardId=${this.entryParams.entityId}#item-info` // 项目跳转
: `${Config.inClue}${this.uniUrl}${encodeKeyword}/cardId/${this.$route.query.contactId}.html`; // 单位跳转
wx.invoke(
"openDefaultBrowser",
{
url: `${url}`, // 在默认浏览器打开redirect_uri,并附加code参数;也可以直接指定要打开的url,此时不会附带上code参数。
},
function (res) {
if (res.err_msg != "openDefaultBrowser:ok") {
//错误处理
}
}
);
this.closePopup();
},
应用场景(调用企微api跳转外部浏览器,出现404跳转不成功)
点击企微第三方应用跳转到外部浏览器目标页面
原因分析
跳转链接中包含中文
解决方案
const encodeKeyword = encodeURI(this.entryParams.keyword);