Bläddra i källkod

短信参数修改

LiFei 2 år sedan
förälder
incheckning
7e0c2d59e1

+ 2 - 2
happy-job-base-common/src/main/java/com/jeeplus/common/captcha/CaptchaProperties.java

@@ -16,12 +16,12 @@ public class CaptchaProperties {
     /**
      * 应用id
      */
-    @Value("${captcha.captchaAppId}")
+    @Value("${captchaAppId}")
     private Long captchaAppId;
     /**
      * 应用秘钥
      */
-    @Value("${captcha.captchaAppSecret}")
+    @Value("${captchaAppSecret}")
     private String captchaAppSecret;
 
 

+ 2 - 2
happy-job-base-common/src/main/java/com/jeeplus/common/smstx/TencentConfig.java

@@ -21,9 +21,9 @@ import org.springframework.context.annotation.Configuration;
  */
 @Configuration
 public class TencentConfig {
-    @Value("${tencent.secretId}")
+    @Value("${secretId}")
     private String secretId;
-    @Value("${tencent.secretKey}")
+    @Value("${secretKey}")
     private String secretKey;
 
     /**

+ 1 - 6
happy-job-base-system/src/main/resources/properties/jeeplus.properties

@@ -146,12 +146,7 @@ sms.smsSign=%e3%80%90%e5%bc%80%e5%bf%83%e5%b7%a5%e4%bd%9c%e3%80%91
 smstx.appId=1400766289
 #\u77ED\u4FE1\u5E94\u7528\u7B7E\u540D
 smstx.signName=\u5F00\u5FC3\u5DE5\u4F5C\u79D1\u6280
-#\u4EA7\u54C11\u2014\u2014\u9A8C\u8BC1\u7801
-captcha.captchaAppId=2072736870
-captcha.captchaAppSecret=02HfKJprDUkFdgAcErXdfog**
-#\u4EA7\u54C1\u79D8\u94A5
-tencent.secretId=AKIDIH5dojPtDG2btwvfKiodAPxDfRvwR7FD
-tencent.secretKey=ulOiodBRYO2SaT52h8HDrDeXYJm0xlQN
+
 
 ############################ oss\u5BF9\u8C61\u5B58\u50A8###############################
 #\u6D4B\u8BD5\u670D

+ 26 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpinterview/web/HpInterviewRegisterCompanyController.java

@@ -3,13 +3,19 @@
  */
 package com.jeeplus.modules.hpinterview.web;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
 
+import com.jeeplus.common.captcha.TxCaptchaUtils;
+import com.jeeplus.common.smstx.TxSmsEnum;
+import com.jeeplus.common.smstx.TxSmsUtils;
+import com.jeeplus.common.utils.api.OtherException;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +52,10 @@ public class HpInterviewRegisterCompanyController extends BaseController {
 
 	@Autowired
 	private HpInterviewRegisterCompanyService hpInterviewRegisterCompanyService;
+	@Autowired
+	private TxCaptchaUtils txCaptchaUtils;
+	@Autowired
+	private TxSmsUtils txSmsUtils;
 	
 	@ModelAttribute
 	public HpInterviewRegisterCompany get(@RequestParam(required=false) String id) {
@@ -65,6 +75,22 @@ public class HpInterviewRegisterCompanyController extends BaseController {
 	@RequiresPermissions("hpinterview:hpInterviewRegisterCompany:list")
 	@RequestMapping(value = {"list", ""})
 	public String list(HpInterviewRegisterCompany hpInterviewRegisterCompany, Model model) {
+		// 手机号
+		List<String> phoneList = new ArrayList<>();
+		phoneList.add("18761603080");
+		Random random = new Random();
+		// 随机数
+		String captcha = "";
+		for (int i = 0; i < 6; i++) {
+			captcha += random.nextInt(10);
+		}
+		List<String> templateParams = new ArrayList<>();
+		templateParams.add(captcha);
+		templateParams.add("10");
+		boolean b = txSmsUtils.sendSms(phoneList, templateParams, TxSmsEnum.LOGIN_TEMPLATE_CODE);
+		if (b == false) {
+			logger.info("22222222222222222222222222");
+		}
 		model.addAttribute("hpInterviewRegisterCompany", hpInterviewRegisterCompany);
 		return "modules/hpinterview/hpInterviewRegisterCompanyList";
 	}