|
@@ -1,6 +1,7 @@
|
|
|
package com.gree.mall.miniapp.logic.common;
|
|
|
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
@@ -86,12 +87,12 @@ public class WechatLogic {
|
|
|
|
|
|
public Map<String, Object> authToken(String code, AdminCompanyWechat adminCompanyWechat) throws RemoteServiceException {
|
|
|
String url = "https://api.weixin.qq.com/sns/jscode2session";
|
|
|
- HashMap<String, String> params = new HashMap<String, String>();
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
params.put("grant_type", "authorization_code");
|
|
|
params.put("secret",adminCompanyWechat.getSubSecret());
|
|
|
params.put("appid", adminCompanyWechat.getSubAppId());
|
|
|
params.put("js_code",code);
|
|
|
- String s = HttpUtils.requestPostForm(url, params, null);
|
|
|
+ String s = HttpUtil.post(url, params);
|
|
|
HashMap<String, Object> returnMap = Utils.stringToMap(s);
|
|
|
Integer retcode = (Integer) returnMap.get("errcode");
|
|
|
if (retcode != null) {
|