提交修改
This commit is contained in:
parent
55c5cd7335
commit
95f0f8b769
@ -121,20 +121,16 @@ public class WeChatUtils {
|
||||
|
||||
String url = linkUrl + accessToken;
|
||||
cn.hutool.json.JSONObject body = cn.hutool.json.JSONUtil.createObj();
|
||||
body.putOpt("path", path);
|
||||
|
||||
body.putOpt("query", query);
|
||||
|
||||
body.putOpt("path", path); // 通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页
|
||||
body.putOpt("query", query); // 通过 URL Link 进入小程序时的query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%
|
||||
//链接过期类型:0时间戳 1间隔天数
|
||||
body.putOpt("expire_type", 1);
|
||||
body.putOpt("expire_type", 1); // 默认值0.小程序 URL Link 失效类型,失效时间:0,失效间隔天数:1
|
||||
|
||||
//指定失效天数,最多30
|
||||
days = (days == null || days > 30) ? 30 : days;
|
||||
body.putOpt("expire_interval", days); // 到期失效的URL Link的失效间隔天数。生成的到期失效URL Link在该间隔时间到达前有效。最长间隔天数为30天。expire_type 为 1 必填
|
||||
|
||||
body.putOpt("expire_interval", days);
|
||||
|
||||
//小程序版本,正式版为 "release",体验版为"trial",开发版为"develop"
|
||||
body.putOpt("env_version", "trial");
|
||||
body.putOpt("env_version", "trial"); // 默认值"release"。要打开的小程序版本。正式版为 "release",体验版为"trial",开发版为"develop",仅在微信外打开时生效。
|
||||
String result = HttpUtil.post(url, body.toJSONString(2));
|
||||
log.info("jumpAppletShortUrl params:{}, result:{}", JSON.toJSONString(body), result);
|
||||
return result;
|
||||
@ -155,16 +151,16 @@ public class WeChatUtils {
|
||||
String url = schemeUrl + getAccessTokenDTO().getAccessToken();
|
||||
cn.hutool.json.JSONObject body = cn.hutool.json.JSONUtil.createObj();
|
||||
cn.hutool.json.JSONObject jumpWxa = cn.hutool.json.JSONUtil.createObj();
|
||||
jumpWxa.putOpt("path", path);
|
||||
jumpWxa.putOpt("query", query);
|
||||
jumpWxa.putOpt("env_version", "release");
|
||||
body.putOpt("jump_wxa", jumpWxa);
|
||||
jumpWxa.putOpt("path", path); // 通过 scheme 码进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query。path 为空时会跳转小程序主页。
|
||||
jumpWxa.putOpt("query", query); // 通过 scheme 码进入小程序时的 query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%`
|
||||
jumpWxa.putOpt("env_version", "release"); // 默认值"release"。要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop",仅在微信外打开时生效。
|
||||
body.putOpt("jump_wxa", jumpWxa); // 跳转到的目标小程序信息。
|
||||
//链接过期类型:0时间戳 1间隔天数
|
||||
body.putOpt("expire_type", 1);
|
||||
body.putOpt("expire_type", 1); // 默认值0,到期失效的 scheme 码失效类型,失效时间:0,失效间隔天数:1
|
||||
body.putOpt("is_expire", true);
|
||||
//指定失效天数,最多30
|
||||
days = (days == null || days > 30) ? 30 : days;
|
||||
body.putOpt("expire_interval", days);
|
||||
body.putOpt("expire_interval", days); // 到期失效的 scheme 码的失效间隔天数。生成的到期失效 scheme 码在该间隔时间到达前有效。最长间隔天数为30天。is_expire 为 true 且 expire_type 为 1 时必填
|
||||
String post = HttpUtil.post(url, body.toJSONString(2));
|
||||
|
||||
log.info("jumpAppletSchemeUrl params:{}, result:{}", JSON.toJSONString(body), post);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user