Merge branch 'master' of ssh://121.36.71.250:58004/Tenlion/system-operator
This commit is contained in:
commit
b68a89e963
@ -1,5 +1,8 @@
|
|||||||
package cn.com.tenlion.operator.service.verify.code;
|
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.common.base.DefaultBaseService;
|
||||||
import ink.wgink.exceptions.ParamsException;
|
import ink.wgink.exceptions.ParamsException;
|
||||||
import ink.wgink.exceptions.base.SystemException;
|
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.pojo.vos.sms.SmsVO;
|
||||||
import ink.wgink.module.sms.service.sms.ISmsService;
|
import ink.wgink.module.sms.service.sms.ISmsService;
|
||||||
import ink.wgink.properties.sms.SmsProperties;
|
import ink.wgink.properties.sms.SmsProperties;
|
||||||
|
import ink.wgink.util.UUIDUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class VerifyCodeService extends DefaultBaseService {
|
public class VerifyCodeService extends DefaultBaseService {
|
||||||
|
|
||||||
@ -32,26 +39,14 @@ public class VerifyCodeService extends DefaultBaseService {
|
|||||||
String currentTimeStr = String.valueOf(System.currentTimeMillis());
|
String currentTimeStr = String.valueOf(System.currentTimeMillis());
|
||||||
String code = currentTimeStr.substring(currentTimeStr.length() - 6);
|
String code = currentTimeStr.substring(currentTimeStr.length() - 6);
|
||||||
LOG.info(">>>>> 向手机号:{},发送验证码:{}", phone, code);
|
LOG.info(">>>>> 向手机号:{},发送验证码:{}", phone, code);
|
||||||
|
Map<String, String> templateParams = new HashMap<>();
|
||||||
|
templateParams.put("code", code);
|
||||||
SmsVO smsVO = new SmsVO();
|
templateParams.put("time", "2");
|
||||||
smsVO.setPhone(phone);
|
JSONArray phoneArray = new JSONArray();
|
||||||
smsVO.setContent(code);
|
JSONObject phoneObject = new JSONObject();
|
||||||
try {
|
phoneObject.put("phone", phone);
|
||||||
if (smsProperties.getActive()) {
|
phoneArray.add(phoneObject);
|
||||||
ISmsSend smsSend = new TencentSmsSendImpl(smsProperties.getTencentSms());
|
TenlionSMS.sendMessage(UUIDUtil.getUUID(), "M00001", templateParams, phoneArray);
|
||||||
smsSend.code(phone, code);
|
verifyCodeManager.setVerificationCode(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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ app-token:
|
|||||||
has-role: true
|
has-role: true
|
||||||
|
|
||||||
wx-miniapp:
|
wx-miniapp:
|
||||||
activate: false
|
activate: true
|
||||||
appid: wxe17874894f7ff27b
|
appid: wxe17874894f7ff27b
|
||||||
appsecret: 0c2b1371e4fb32514030233da4ef094d
|
appsecret: 0c2b1371e4fb32514030233da4ef094d
|
||||||
wx-oauth2:
|
wx-oauth2:
|
||||||
|
@ -35,6 +35,10 @@
|
|||||||
<div class="logo"></div>
|
<div class="logo"></div>
|
||||||
<div class="title">喵著系统</div>
|
<div class="title">喵著系统</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="system" data-href="/aishop">
|
||||||
|
<div class="logo"></div>
|
||||||
|
<div class="title">商城</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||||
|
Loading…
Reference in New Issue
Block a user