فهرست منبع

update:新增验证码

yonge 3 سال پیش
والد
کامیت
652d0c4689

+ 10 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/TenantApply.java

@@ -31,6 +31,8 @@ public class TenantApply {
 	/** 回访记录 */
 	private String callBackLog;
 	
+	private String smsCode;
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -95,6 +97,14 @@ public class TenantApply {
 		return this.callBackLog;
 	}
 			
+	public String getSmsCode() {
+		return smsCode;
+	}
+
+	public void setSmsCode(String smsCode) {
+		this.smsCode = smsCode;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 10 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantApplyController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.service.IdGeneratorService;
 import com.keao.edu.user.entity.TenantApply;
 import com.keao.edu.user.service.TenantApplyService;
 
@@ -27,6 +28,9 @@ public class TenantApplyController extends BaseController {
 	@Autowired
 	private TenantApplyService tenantApplyService;
 
+	@Autowired
+	private IdGeneratorService smsCodeService;
+
 	@ApiOperation("分页查询")
 	@GetMapping(value = "/list")
 	@PreAuthorize("@pcs.hasPermissions('tenantApply/list')")
@@ -45,6 +49,12 @@ public class TenantApplyController extends BaseController {
 	@ApiOperation("新增")
 	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object add(TenantApply tenantApply) {
+		
+		boolean b = smsCodeService.verifyValidCode(tenantApply.getMobileNo(), tenantApply.getSmsCode());
+		if (!b) {
+			return failed("验证码不正确");
+		}
+		
 		tenantApply.setCreateTime(new Date());
 		tenantApplyService.insert(tenantApply);
 		return succeed();