| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 登录 |
| | |
| | | @GetMapping("uu/getQRCode") |
| | | public R uuLogin(@RequestParam("couponId") String couponId) { |
| | | try { |
| | | WxMaQrcodeService qrCodeService = wxMaConfiguration.getMaService("wx98d62711dfbd8425").getQrcodeService(); |
| | | byte[] bytes = qrCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | //i小懒 |
| | | WxMaQrcodeService wsCodeService = wxMaConfiguration.getMaService("wx98d62711dfbd8425").getQrcodeService(); |
| | | byte[] bytes = wsCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | return R.ok(String.format("data:image/png;base64,%s", Base64.encode(bytes))); |
| | | String res = String.format("data:image/png;base64,%s", Base64.encode(bytes)); |
| | | |
| | | //花城 |
| | | WxMaQrcodeService uuCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService(); |
| | | byte[] hcBytes = uuCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "/packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | String hcRes = String.format("data:image/png;base64,%s", Base64.encode(hcBytes)); |
| | | |
| | | Map<String,String> retMap = new HashMap<>(); |
| | | retMap.put("ixiaolan",res); |
| | | retMap.put("huacheng",hcRes); |
| | | return R.ok(retMap); |
| | | } catch (Exception e) { |
| | | log.error("generate QRCode failed:" + e.getMessage()); |
| | | return R.fail("generate QRCode failed"); |