Commit f4dce490 authored by yangshuxing's avatar yangshuxing

bug修改

parent 11daef44
......@@ -135,15 +135,15 @@
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(param.keyword)">
and a.cmpt_name like concat('%',#{param.keyword},'%')
</if>
<if test="true">
and a.cmpt_status = 2
</if>
<if test="param.type == 1">
and now() >= c.openTime and c.deadLine >= now()
</if>
<if test="param.userId > 0">
and c.createUserId=#{param.userId}
and c.createUserId=#{param.userId} and a.cmpt_status = 2
</if>
<if test="param.userId lt 0">
and c.createUserId <![CDATA[ <> ]]> 427744 and a.cmpt_status = 2
</if>
</sql>
<update id="updateCmpt">
......
......@@ -34,15 +34,18 @@ public class WeixinInfoService {
public JSONObject getOpenIdAndSessionKey(String code, String partnerId) {
try {
Partner parnter= cmptMapper.getParnterByParnterId(partnerId);
log.info("appid:" + parnter.getAppId() + ",secret:" + parnter.getAppSecret());
CloseableHttpClient hp = createSSLClientDefault();
HttpGet hg = new HttpGet("https://api.weixin.qq.com/sns/jscode2session?appid=" +
parnter.getAppId() + "&secret=" + parnter.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code");
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" +
parnter.getAppId() + "&secret=" + parnter.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code";
HttpGet hg = new HttpGet(url);
log.info("请求路径:"+url);
CloseableHttpResponse response = hp.execute(hg);
HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity, "utf-8");
JSONObject json = JSON.parseObject(content);
log.info(content);
log.info("请求路径:"+url+",返回数据:"+content);
hp.close();
return json;
} catch (Exception e) {
......
......@@ -425,6 +425,7 @@ public class MicroApiController {
log.info("code:" + code + ",encryptedData:" + encryptedData + ",code:" + code);
log.info("请求方法:" + request.getMethod());
String partnerId = request.getParameter("partnerId");
log.info("请求参数:"+request.getQueryString());
JSONObject json = weixinInfoService.getOpenIdAndSessionKey(code, partnerId);
String openid = null;
String session_key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment