跳到正文

获取 SID ​

此JS脚本为获取支付参数sid接口,需要嵌入到用户下单网页中,并将获取到字符传入下单参数中。

请求地址 ​

/static/js/envProfiler.js

请求类型 ​

GET

请求参数 ​

无

响应参数 ​

TIP

此说明只包含业务响应参数, 请参照响应消息体中通用响应参数

属性类型是否必填说明
sidstring是用户浏览器信息id

示例 ​

成功:

json
{
  "sid":"ed9fddf82d2d47b9945a149035e196b70514s1HH0ba3a15wECQYGxx"
}

使用示例 ​

html
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Document</title>
</head>

<body>
    <!--生产环境请将请求地址修改为生产环境地址https://api.alsotransglobal.com-->
    <script src="https://stage-api.alsotransglobal.com/static/js/envProfiler.js"></script>
    <script>// 请选择其中一种方式使用
        /* 方案一 开始*/
        const getSid = async () => {
            try {
                const d = await getBrowserInfoSid();
                console.log(d);
            } catch (error) {
                console.log(error);
            }
        };
        getSid();
        /* 方案一 结束 */

        /* 方案二 开始*/
        getBrowserInfoSid().then((res) => {
            console.log(res);
        }).catch((err) => {
            console.log(err);
        });
        /* 方案二 结束*/
    </script>
</body>
</html>