示例#1
0
  public NutMap wx_init(String uri, HashMap<String, String> minfo) {
    NutMap mapwx = NutMap.NEW();

    try {
      String shareurl = wx_shareurl(uri, minfo);
      NutMap jscfg = wx_jsconfig(uri);

      mapwx.put("recommender", minfo.get("recommender"));
      mapwx.put("openid", minfo.get("openid"));
      mapwx.put("shareurl", shareurl);
      mapwx.put("jscfg", jscfg);
    } catch (Exception e) {
      System.out.println(e);
    }

    return mapwx;
  }
示例#2
0
  // 微信推荐链接等信息
  private String wx_shareurl(String uri, HashMap<String, String> minfo) throws Exception {
    NutMap rowx = NutMap.NEW();

    String redirecturl = ApiConfigKit.apiConfig.getServercontext() + "/oauth.action?info=";
    String realurl =
        "/author/login/wxlogin.action?recommender="
            + minfo.get("openid"); // minfo.get("openid")就是刚点进来链接的人;
    realurl = BlueDes.encrypt(realurl);

    redirecturl += realurl;

    String url =
        String.format(OAuthAccessTokenApi.oauthurl, ApiConfigKit.apiConfig.getAppId(), redirecturl);

    System.out.println("url:" + url);
    System.out.println("redirecturl:" + redirecturl);

    return url;
  }