Wechat JSSDK sharing succeeded, but custom link is invalid

1. Problem description:
Wechat official account to share custom content. At the beginning of sharing, custom content can share the current url, but when you modify the link in sharing (the link domain name is the same as the JS security domain name corresponding to the current page), the current url. at the time of sharing will be redirected

.
  1. `
    title = shareDetail.getString("title");
    desc = shareDetail.getString("summary");
    // https://xxx.xxx.com/teaching/a?id=72 + &sharerOpenId=xxx
    StringBuilder sb = new StringBuilder();
    sb.append(shareDetail.getString("url")).append("&sharerOpenId=").append(sharerOpenId);
    url = sb.toString();
    imgUrl = shareDetail.getString("pic_url");`
    JSONObject shareInfo = new JSONObject();
    // 
    shareInfo.put("title", title);
    // 
    shareInfo.put("desc", desc);
    // JS, 
    shareInfo.put("link", url);
    // 
    shareInfo.put("imgUrl", imgUrl);
    // ,musicvideolinklink
    shareInfo.put("type", "link");
    // typemusicvideo
    shareInfo.put("dataUrl", "");
    responseData.put("shareInfo", shareInfo);
The
  1. code, such as the, title desc imgUrl above, is obtained normally. Link is a custom url that replaces the url, of the current page
.

4. The title desc imgUrl is normal when the result is shared, and link is the url
5 of the current page. Expect link to be stitched url: https://xxx.xxx.com/teaching/. + & sharerOpenId=xxx

the reason why the shareInfo.link, obtained by the front-end link cannot be found. Ask the gods for help.

Jun.12,2021
The

problem is found. Sure enough, it is still the problem of the front end getting the interface link. What the front end does not take shareInfo.link, is that the currently visited url, is almost annoyed to death, and many things have to be checked in person

.
Menu