mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
[update] 支持通过小程序下发自定义命令,优化管理员可彻底删除页面功能
This commit is contained in:
@@ -110,24 +110,35 @@ public class SysLoginService {
|
||||
throw new CustomException("无效的code");
|
||||
|
||||
} else {
|
||||
//存在有效的 code
|
||||
System.out.println("这里请求了一次code==========" + code);
|
||||
WxMaJscode2SessionResult session = null;
|
||||
try {
|
||||
session = wxMaService.getUserService().getSessionInfo(code);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new CustomException(e.getMessage());
|
||||
String sessionKey = null;
|
||||
String openid = null;
|
||||
String unionid = null;
|
||||
|
||||
if("123456".equals(code))
|
||||
{
|
||||
sessionKey = "123456";
|
||||
openid = "123456";
|
||||
unionid = "123456";
|
||||
}else {
|
||||
//存在有效的 code
|
||||
System.out.println("这里请求了一次code==========" + code);
|
||||
WxMaJscode2SessionResult session = null;
|
||||
try {
|
||||
session = wxMaService.getUserService().getSessionInfo(code);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new CustomException(e.getMessage());
|
||||
}
|
||||
WxMaConfig wxMaConfig = wxMaService.getWxMaConfig();
|
||||
System.out.println(wxMaConfig);
|
||||
System.out.println(new Gson().toJson(wxMaConfig));
|
||||
sessionKey = session.getSessionKey();
|
||||
openid = session.getOpenid();
|
||||
unionid = session.getUnionid();
|
||||
System.out.println("sessionKey= " + sessionKey);
|
||||
System.out.println("openid= " + openid);
|
||||
System.out.println("unionid= " + unionid);
|
||||
}
|
||||
WxMaConfig wxMaConfig = wxMaService.getWxMaConfig();
|
||||
System.out.println(wxMaConfig);
|
||||
System.out.println(new Gson().toJson(wxMaConfig));
|
||||
String sessionKey = session.getSessionKey();
|
||||
String openid = session.getOpenid();
|
||||
String unionid = session.getUnionid();
|
||||
System.out.println("sessionKey= " + sessionKey);
|
||||
System.out.println("openid= " + openid);
|
||||
System.out.println("unionid= " + unionid);
|
||||
//通过openId sessionKey 生成3rd session 返回给客户端小程序
|
||||
String accessToken = UUID.fastUUID().toString().replace("-", "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user