|
|
@ -100,6 +100,7 @@ public class WeiXinController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/api/getLoginQrCode")
|
|
|
|
@GetMapping("/api/getLoginQrCode")
|
|
|
|
public JsonResult<?> getLoginQrCode() throws WxErrorException {
|
|
|
|
public JsonResult<?> getLoginQrCode() throws WxErrorException {
|
|
|
|
|
|
|
|
try {
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
String snowflakeNextIdStr = IdUtil.getSnowflakeNextIdStr();
|
|
|
|
String snowflakeNextIdStr = IdUtil.getSnowflakeNextIdStr();
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket("login" + snowflakeNextIdStr, 2592000);
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket("login" + snowflakeNextIdStr, 2592000);
|
|
|
@ -108,6 +109,9 @@ public class WeiXinController {
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("userId", snowflakeNextIdStr);
|
|
|
|
map.put("userId", snowflakeNextIdStr);
|
|
|
|
return JsonResult.success(map);
|
|
|
|
return JsonResult.success(map);
|
|
|
|
|
|
|
|
} catch (WxErrorException e) {
|
|
|
|
|
|
|
|
return JsonResult.failMessage("加载二维码失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -118,6 +122,7 @@ public class WeiXinController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/api/getQrCode")
|
|
|
|
@GetMapping("/api/getQrCode")
|
|
|
|
public JsonResult<?> getQrCode(@SCoreUser CoreUser coreUser) throws WxErrorException {
|
|
|
|
public JsonResult<?> getQrCode(@SCoreUser CoreUser coreUser) throws WxErrorException {
|
|
|
|
|
|
|
|
try {
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket(coreUser.getId() + "", 2592000);
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket(coreUser.getId() + "", 2592000);
|
|
|
|
String imgUrl = qrcodeService.qrCodePictureUrl(wxMpQrCodeTicket.getTicket());
|
|
|
|
String imgUrl = qrcodeService.qrCodePictureUrl(wxMpQrCodeTicket.getTicket());
|
|
|
@ -125,6 +130,9 @@ public class WeiXinController {
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("userId", coreUser.getId());
|
|
|
|
map.put("userId", coreUser.getId());
|
|
|
|
return JsonResult.success(map);
|
|
|
|
return JsonResult.success(map);
|
|
|
|
|
|
|
|
} catch (WxErrorException e) {
|
|
|
|
|
|
|
|
return JsonResult.failMessage("加载二维码失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,6 +153,7 @@ public class WeiXinController {
|
|
|
|
return JsonResult.success("查询不到用户");
|
|
|
|
return JsonResult.success("查询不到用户");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
WxMpQrcodeService qrcodeService = weixinService.getQrcodeService();
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket(coreUser.getId() + "", 2592000);
|
|
|
|
WxMpQrCodeTicket wxMpQrCodeTicket = qrcodeService.qrCodeCreateTmpTicket(coreUser.getId() + "", 2592000);
|
|
|
|
String imgUrl = qrcodeService.qrCodePictureUrl(wxMpQrCodeTicket.getTicket());
|
|
|
|
String imgUrl = qrcodeService.qrCodePictureUrl(wxMpQrCodeTicket.getTicket());
|
|
|
@ -152,6 +161,9 @@ public class WeiXinController {
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("imgUrl", imgUrl);
|
|
|
|
map.put("userId", coreUser.getId());
|
|
|
|
map.put("userId", coreUser.getId());
|
|
|
|
return JsonResult.success(map);
|
|
|
|
return JsonResult.success(map);
|
|
|
|
|
|
|
|
} catch (WxErrorException e) {
|
|
|
|
|
|
|
|
return JsonResult.failMessage("加载二维码失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|