小程序指定的跳转路径却不跳转
发布于 5 年前 作者 yan84 9361 次浏览 来自 问答

java 生成了小程序码,指定的跳转路径,却不跳转,还是到了home页面,这是为什么呢?

3 回复

那为什么又找得到home目录了  public static String createImgByIdMember(Long id_parent_member,String dir) {
     String result = null;
        // 获取token
        String appid = CommentUtil.APPID;
        String appsecret = CommentUtil.APPSECRET;
        String token = WXUtil.getAccess_token(appid, appsecret);
        // 生成小程序码接口url
        String url = “https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN”.replace(“ACCESS_TOKEN”,
                token);
        System.out.println(url+"::::url");
        // 二维码中信息
        Map<String, Object> map = new HashMap<String, Object>();
        map.put(“page”, “pages/home/home”);// 二维码中跳向的页面
        map.put(“scene”, id_parent_member);// 携带参数
        //JSON.toJSON(map);
        String json = JSON.toJSONString(map);
        System.out.println(json+"::::::");
        // 生成二维码
        try {
         
         result = CreateImgUtil.httpPostWithJSON(url, json, id_parent_member+"",dir);
         logger.info(result+":::图片");
            return result;
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

你的代码不就是跳到home吗……

找不到路径吧,开发工具可以导入二维码调试看看

回到顶部