调整微信工具封装

This commit is contained in:
TinyAnts
2022-09-14 11:30:06 +08:00
parent 0817050b1b
commit 11bf25156f
2 changed files with 22 additions and 7 deletions

View File

@@ -90,14 +90,8 @@ public class LoginServiceImpl implements ILoginService {
String gender = params.getOrDefault("gender", "0");
Integer client = Integer.parseInt(params.getOrDefault("client", "1"));
Map<String, String> config = ConfigUtil.get("mp_channel");
WxMaService wxMaService = new WxMaServiceImpl();
WxMaDefaultConfigImpl wxConfig = new WxMaDefaultConfigImpl();
wxConfig.setAppid(config.getOrDefault("appId", ""));
wxConfig.setSecret(config.getOrDefault("appSecret", ""));
wxMaService.setWxMaConfig(wxConfig);
try {
WxMaService wxMaService = WeChatUtil.mnp();
WxMaJscode2SessionResult sessionResult = wxMaService.getUserService().getSessionInfo(code);
String openId = sessionResult.getOpenid();
String uniId = sessionResult.getUnionid();