diff --git a/src/main/java/cn/com/tenlion/operator/service/verify/code/VerifyCodeService.java b/src/main/java/cn/com/tenlion/operator/service/verify/code/VerifyCodeService.java index 62975a4..d573d4a 100644 --- a/src/main/java/cn/com/tenlion/operator/service/verify/code/VerifyCodeService.java +++ b/src/main/java/cn/com/tenlion/operator/service/verify/code/VerifyCodeService.java @@ -1,5 +1,8 @@ package cn.com.tenlion.operator.service.verify.code; +import cn.com.tenlion.operator.util.TenlionSMS; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.ParamsException; import ink.wgink.exceptions.base.SystemException; @@ -10,9 +13,13 @@ import ink.wgink.module.sms.manager.VerifyCodeManager; import ink.wgink.module.sms.pojo.vos.sms.SmsVO; import ink.wgink.module.sms.service.sms.ISmsService; import ink.wgink.properties.sms.SmsProperties; +import ink.wgink.util.UUIDUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; +import java.util.Map; + @Service public class VerifyCodeService extends DefaultBaseService { @@ -32,26 +39,14 @@ public class VerifyCodeService extends DefaultBaseService { String currentTimeStr = String.valueOf(System.currentTimeMillis()); String code = currentTimeStr.substring(currentTimeStr.length() - 6); LOG.info(">>>>> 向手机号:{},发送验证码:{}", phone, code); - - - SmsVO smsVO = new SmsVO(); - smsVO.setPhone(phone); - smsVO.setContent(code); - try { - if (smsProperties.getActive()) { - ISmsSend smsSend = new TencentSmsSendImpl(smsProperties.getTencentSms()); - smsSend.code(phone, code); - } - verifyCodeManager.setVerificationCode(phone, code); - smsVO.setSendStatus(1); - } catch (Exception e) { - LOG.error(e.getMessage()); - String errorMessage = e.getMessage(); - smsVO.setSendStatus(0); - smsVO.setErrorMessage(errorMessage); - throw new SystemException("短信发送失败"); - } finally { - smsService.save(smsVO); - } + Map templateParams = new HashMap<>(); + templateParams.put("code", code); + templateParams.put("time", "2"); + JSONArray phoneArray = new JSONArray(); + JSONObject phoneObject = new JSONObject(); + phoneObject.put("phone", phone); + phoneArray.add(phoneObject); + TenlionSMS.sendMessage(UUIDUtil.getUUID(), "M00001", templateParams, phoneArray); + verifyCodeManager.setVerificationCode(phone, code); } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 44b2650..2d7e52e 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -214,7 +214,7 @@ app-token: has-role: true wx-miniapp: - activate: false + activate: true appid: wxe17874894f7ff27b appsecret: 0c2b1371e4fb32514030233da4ef094d wx-oauth2: diff --git a/src/main/resources/templates/systemuser/system-select.html b/src/main/resources/templates/systemuser/system-select.html index 195e289..cf79af6 100644 --- a/src/main/resources/templates/systemuser/system-select.html +++ b/src/main/resources/templates/systemuser/system-select.html @@ -35,6 +35,10 @@
喵著系统
+
+ +
商城
+