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;
|
||||
|
||||
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);
|
||||
}
|
||||
Map<String, String> 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);
|
||||
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
|
||||
|
||||
wx-miniapp:
|
||||
activate: false
|
||||
activate: true
|
||||
appid: wxe17874894f7ff27b
|
||||
appsecret: 0c2b1371e4fb32514030233da4ef094d
|
||||
wx-oauth2:
|
||||
|
@ -35,6 +35,10 @@
|
||||
<div class="logo"></div>
|
||||
<div class="title">喵著系统</div>
|
||||
</div>
|
||||
<div class="system" data-href="/aishop">
|
||||
<div class="logo"></div>
|
||||
<div class="title">商城</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user