|
|
|
|
@ -51,6 +51,20 @@ public class WechatController2 {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/no-auth/wechat/getSessionId")
|
|
|
|
|
public AjaxResult getSessionId(String code) {
|
|
|
|
|
JSONObject object = memberWechatService.getSessionId(code);
|
|
|
|
|
if (object != null) {
|
|
|
|
|
String openId = object.getString("openid");
|
|
|
|
|
String sessionId = object.getString("session_key");
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("openId", openId);
|
|
|
|
|
map.put("sessionId", sessionId);
|
|
|
|
|
return AjaxResult.successData(Base64Utils.encodeToString(JSON.toJSONString(map).getBytes()));
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/no-auth/wechat/getSessionId2")
|
|
|
|
|
public AjaxResult getSessionId2(String code) {
|
|
|
|
|
JSONObject object = memberWechatService.getSessionId(code);
|
|
|
|
|
if (object != null) {
|
|
|
|
|
String openId = object.getString("openid");
|
|
|
|
|
|