|
@@ -7,6 +7,7 @@ package com.ylx.massage.utils;
|
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
+import com.mysql.cj.util.Base64Decoder;
|
|
import com.ylx.common.config.WechatAccountConfig;
|
|
import com.ylx.common.config.WechatAccountConfig;
|
|
import com.ylx.common.exception.ServiceException;
|
|
import com.ylx.common.exception.ServiceException;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -143,7 +144,7 @@ public class WeChatUtil {
|
|
* @param code 用户code
|
|
* @param code 用户code
|
|
* @return 返回包含微信AccessToken的Map
|
|
* @return 返回包含微信AccessToken的Map
|
|
*/
|
|
*/
|
|
- public Map<?, ?> getUrl(String token, String openId) {
|
|
|
|
|
|
+ public Map<?, ?> getUrl(String token, String openId){
|
|
|
|
|
|
String url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + token;
|
|
String url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + token;
|
|
|
|
|
|
@@ -152,7 +153,24 @@ public class WeChatUtil {
|
|
String rs = HttpUtil.post(url, param);
|
|
String rs = HttpUtil.post(url, param);
|
|
Map<?, ?> map = JSONObject.parseObject(rs, Map.class);
|
|
Map<?, ?> map = JSONObject.parseObject(rs, Map.class);
|
|
|
|
|
|
- log.info("获取二维码成功{}", map);
|
|
|
|
|
|
+// String ticket = map.get("ticket").toString();
|
|
|
|
+//
|
|
|
|
+// String encode = null;
|
|
|
|
+// try {
|
|
|
|
+// encode = URLEncoder.encode(ticket, "UTF-8");
|
|
|
|
+// } catch (UnsupportedEncodingException e) {
|
|
|
|
+// throw new RuntimeException(e);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// String url1 = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+ encode;
|
|
|
|
+//
|
|
|
|
+// String s = HttpUtil.get(url1);
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// Map<?, ?> rsmap = JSONObject.parseObject(s, Map.class);
|
|
|
|
+// return rsmap;
|
|
return map;
|
|
return map;
|
|
|
|
|
|
}
|
|
}
|