问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 微信小程序 需求 getAnalysisDailyVisitTrend 工具 6.5.3 2.0.0
String grant_type = "client_credential";
String url = "https://api.weixin.qq.com/cgi-bin/token";
String param = "grant_type="+grant_type+"&appid="+appid+"&secret="+appSecret;
String access_token = HttpRequest.sendGet(url, param);
Map map = JSON.parseObject(access_token);
System.out.println("---"+map.get("access_token"));
String begin_date = new SimpleDateFormat("yyyyMMdd").format(new Date());
System.out.println("date===:"+begin_date);
Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
ca.setTime(new Date()); //设置时间为当前时间
ca.add(Calendar.DATE, -1);
Date lastMonth = ca.getTime();
String end_date = new SimpleDateFormat("yyyyMMdd").format(lastMonth);
System.out.println("end_date===:"+end_date);
String url1 = "https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token="+map.get("access_token");
String param1 = "&end_date=20170313&begin_date=20170313";
String JsonList = HttpRequest.sendPost(url1, param1);
System.out.println(JsonList);
报:{"errcode":61500,"errmsg":"date format error hint: [x9JRTA02761556]"}
本文网址:http://www.91bianli.com/kaifazhinan/75605.html