API 接口文档

通过 HTTP 调用,传入中转跳转地址,返回带微信二维码预览的分享链接。无需密钥,即调即用。

1. 接口地址

GET https://你的域名/app/app_xxx/api.html?url=中转地址

2. 请求参数

参数名类型必填说明
url string 必填 你的中转跳转地址,需 URL 编码(encodeURIComponent)。
例如:https://w.xykj.plus/wailian/index.html?jwid=103508

3. 返回结果

调用成功后返回 JSON,其中 data.share_url 即为生成的分享链接:

{
  "code": 0,
  "msg": "success",
  "data": {
    "share_url": "https://你的域名/app/app_xxx/qr.html#url=https%3A%2F%2F你的中转地址.com",
    "target_url": "https://你的中转地址.com"
  }
}

4. 返回字段说明

字段类型说明
codeint0 = 成功,400 = 参数错误
msgstring状态描述
data.share_urlstring生成的分享链接,直接拿去分享即可
data.target_urlstring原始中转地址

5. 调用示例

cURL

# 注意:curl 不执行 JS,需在浏览器中打开或参考下方直接构造方式
curl "https://你的域名/app/app_xxx/api.html?url=https%3A%2F%2Fexample.com%2Flanding"

JavaScript / Fetch

const targetUrl = "https://w.xykj.plus/wailian/index.html?jwid=103508";
const apiUrl = `https://你的域名/app/app_xxx/api.html?url=${encodeURIComponent(targetUrl)}`;

// 在浏览器新标签页打开即可看到返回的 JSON
window.open(apiUrl, "_blank");

Python

import urllib.parse

target = "https://w.xykj.plus/wailian/index.html?jwid=103508"
base = "https://你的域名/app/app_xxx/qr.html#url="
share_url = base + urllib.parse.quote(target, safe="")
print(share_url)

PHP

$target = "https://w.xykj.plus/wailian/index.html?jwid=103508";
$base = "https://你的域名/app/app_xxx/qr.html#url=";
$share_url = $base . urlencode($target);
echo $share_url;
提示:由于这是静态页面部署,API 页面在浏览器中打开时执行 JS 并返回 JSON。 如果你的后端需要直接拿到分享链接,可以直接按下方规则构造,无需调用 API:

分享链接 = https://你的域名/app/app_xxx/qr.html#url= + encodeURIComponent(中转地址)

6. 分享链接的效果

生成的分享链接(qr.html#url=...)具备以下行为:

场景表现
分享到抖音/微信/聊天软件卡片显示二维码预览图 + 标题「点我查看详情」
用户点击链接页面立即跳转到你填的中转地址
JS 被拦截显示「点击进入」手动按钮兜底

7. 错误码

code说明
0成功
400缺少 url 参数