From 841959a666acf5837acd88af5e20610a40bee023 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 5 Apr 2021 15:58:41 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4diam'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/HighDiscountAgentRelController.java | 3 ++- .../main/java/com/cweb/controller/HighDiscountController.java | 3 ++- .../java/com/cweb/controller/HighUserDiscountController.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index 1e62ad7f..ae436423 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.bweb.config.SysConst; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hai.common.Base64Util; import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; @@ -109,7 +110,7 @@ public class HighDiscountAgentRelController { //参数 Map map = new HashMap<>(); map.put("type", QrCodeType.AGENT_QR_CODE); - map.put("code", AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString())); + map.put("code", AESEncodeUtil.aesEncrypt(Base64Util.encode(highDiscountAgentRel.getId().toString()))); QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl); highDiscountAgentRel.setQrCode(qrCodeImg); highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java index 06658914..d942eb95 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java @@ -1,5 +1,6 @@ package com.cweb.controller; +import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; @@ -46,7 +47,7 @@ public class HighDiscountController { try { String relId; try { - relId = AESEncodeUtil.aesDecrypt(code); + relId = AESEncodeUtil.aesDecrypt(Base64Util.decode(code)); } catch (Exception e) { log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误"); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java index e6fbcd4b..e76a665e 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java @@ -71,7 +71,7 @@ public class HighUserDiscountController { } // 领取 highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), discountAgentId); - return ResponseMsgUtil.success("操作成功"); + return ResponseMsgUtil.success("领取成功"); } catch (Exception e) { log.error("HighDiscountController -> receiveDiscount() error!",e);