https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxe49a1a5a54***&secret=39fbbc3aeb7e3f8198b6d235****
上边 生成token接口可以正常调用
这个接口 generatescheme 不传入jump_wxa信息,只是url拼接token 可正常生成一下数据
{
"errcode": 0,
"errmsg": "ok",
"openlink": "weixin://dl/business/?t=8sg7zkhUnKg"
}
但是需求需要传参数,所以接口调用加入 jump_wxa信息,但是加入这个信息 就报错47001了
{
"path": "pages/index/index",
"query":'StartCity=上海&EndCity=北京'
"env_version":"release"
}
就报错
{
"errcode": "47001",
"errmsg":'data format error rid: 629c312b-7f078d4e-35e7a234'
}
path 是线上版本存在的页面路径吗
manager.requestSerializer = [AFHTTPRequestSerializer serializer]; 和生成的scheme
manager.requestSerializer = [AFJSONRequestSerializer serializer];
配置的不一样
type: 'post',
url: 'https://api.weixin.qq.com/wxa/generatescheme?access_token='+token,
contentType: 'application/json;charset=UTF-8',
success: function (res) {
window.location.href = res.openlink //跳转微信小程序
},
error: function (res) {
console.log(res)
}
})
我是这样写的,如果添加 jump_wxa 就获取不到跳转链接了
Url
https://api.weixin.qq.com/wxa/generatescheme?access_token=57_fwQOsHaYkhgzoR4FW2b4HLiVpXWs5XGps0k1JmJzCWFL9Sy5Ey2gFZbQU41og8PAK3XIMeNW0NATdMUNsPct79QxP-55ImYZ4qoktYwB48O0duCGQLAVivsOkU_W7hm4SRdMP_3yB5CP2MDfKIIiACAZXX&
参数
{
"jump_wxa" = {
"env_version" = release;
path = "pages/index/index";
query = "depCity:\U5317\U4eac,arrCity:\U4e0a\U6d77";
};
}
返回结果
{
errcode = 47001;
errmsg = "data format error rid: 629c5695-6b9f79e7-0acef31b";
}