admin
2022-05-12 fa705507ba574c857b1667553737d23b1b7ff495
src/main/resources/code/service/app/src/main/java/com/ks/app/controller/client/api/SMSController.java
@@ -1,5 +1,6 @@
package com.ks.app.controller.client.api;
import com.github.qcloudsms.SmsSingleSenderResult;
import com.ks.app.entity.config.SystemConfigKey;
import com.ks.app.service.inter.config.SystemConfigService;
import com.ks.app.service.manager.VerifyCodeManager;
@@ -56,10 +57,14 @@
            String msg = systemConfigService.getValueCache(acceptData.getSystem(), SystemConfigKey.tencentVerifySMSTemplate);
            String appId = systemConfigService.getValueCache(acceptData.getSystem(), SystemConfigKey.tencentSMSAppId);
            String appKey = systemConfigService.getValueCache(acceptData.getSystem(), SystemConfigKey.tencentSMSAppKey);
            //  SmsSingleSenderResult result=
//            TencentSMSUtil.sendSingleMsg(Integer.parseInt(appId), appKey, phone, msg.replace("{验证码}", code));
            verifyCodeManager.sendSMSSuccess(acceptData.getSystem(), phone, code);
            return JsonUtil.loadTrueResult("");
            SmsSingleSenderResult result =
                    TencentSMSUtil.sendSingleMsg(Integer.parseInt(appId), appKey, phone, msg.replace("{验证码}", code));
            if (result.result == 0) {
                verifyCodeManager.sendSMSSuccess(acceptData.getSystem(), phone, code);
                return JsonUtil.loadTrueResult("");
            } else {
                return JsonUtil.loadFalseResult("验证码发送失败,请稍后再试");
            }
        } else {
            return JsonUtil.loadFalseResult("服务器繁忙,请稍后再试");
        }