main
parent
ef402d9cc8
commit
ec89bda2e0
|
|
@ -113,6 +113,11 @@ public class AppLoginController {
|
||||||
if (org.apache.commons.lang3.StringUtils.isBlank(registerForm.getProve()) && !emailStr.equals(appSchool.getEmail())) {
|
if (org.apache.commons.lang3.StringUtils.isBlank(registerForm.getProve()) && !emailStr.equals(appSchool.getEmail())) {
|
||||||
return R.fail(2001,"您提供的邮箱后缀与您的学校不符!请提供学习邮箱或人工审核。");
|
return R.fail(2001,"您提供的邮箱后缀与您的学校不符!请提供学习邮箱或人工审核。");
|
||||||
}
|
}
|
||||||
|
String phone = redisService.getCacheObject(registerForm.getPhoneNumber());
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(phone)) {
|
||||||
|
redisService.deleteObject(registerForm.getPhoneNumber());
|
||||||
|
registerForm.setPhoneNumber(phone);
|
||||||
|
}
|
||||||
AppRegister appRegister = setAppRegister(registerForm);
|
AppRegister appRegister = setAppRegister(registerForm);
|
||||||
//校验邮箱是否已注册
|
//校验邮箱是否已注册
|
||||||
AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ruoyi.app.utils.aliyun.sms.SendNoteUtil;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.redis.service.RedisService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
@ -29,6 +30,9 @@ public class PhoneCodeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAppRegisterService appRegisterService;
|
private IAppRegisterService appRegisterService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
@GetMapping(value = "/send")
|
@GetMapping(value = "/send")
|
||||||
@ApiOperation(value = "发送短信验证码", notes = "发送短信验证码", httpMethod = "GET")
|
@ApiOperation(value = "发送短信验证码", notes = "发送短信验证码", httpMethod = "GET")
|
||||||
public AjaxResult sendCode(@RequestParam("phoneNumber") String phoneNum , @RequestParam("type") Integer type){
|
public AjaxResult sendCode(@RequestParam("phoneNumber") String phoneNum , @RequestParam("type") Integer type){
|
||||||
|
|
@ -42,6 +46,10 @@ public class PhoneCodeController {
|
||||||
// if (appRegister != null && appRegister.getStatus() == 2) {
|
// if (appRegister != null && appRegister.getStatus() == 2) {
|
||||||
// return AjaxResult.error(201, "您的账号申请被驳回,驳回原因: " + appRegister.getRemark());
|
// return AjaxResult.error(201, "您的账号申请被驳回,驳回原因: " + appRegister.getRemark());
|
||||||
// }
|
// }
|
||||||
|
if (phoneNum.indexOf("+") != -1) {
|
||||||
|
String redisKey = phoneNum.substring(phoneNum.indexOf("+") + 1,phoneNum.length());
|
||||||
|
redisService.setCacheObject(redisKey,phoneNum);
|
||||||
|
}
|
||||||
send = sendNoteUtil.sendNoteMessgae(phoneNum);
|
send = sendNoteUtil.sendNoteMessgae(phoneNum);
|
||||||
}else {
|
}else {
|
||||||
send = sendNoteUtil.sendNoteMessgae(phoneNum);
|
send = sendNoteUtil.sendNoteMessgae(phoneNum);
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ public class SendNoteUtil {
|
||||||
String homeTem = "SMS_467520300";
|
String homeTem = "SMS_467520300";
|
||||||
String foreignTem = "SMS_468380559";
|
String foreignTem = "SMS_468380559";
|
||||||
if (!isChineseMobileNumber(PhoneNumber)) {
|
if (!isChineseMobileNumber(PhoneNumber)) {
|
||||||
|
PhoneNumber = PhoneNumber.replace("+","");
|
||||||
return sendMessageForeign(PhoneNumber);
|
return sendMessageForeign(PhoneNumber);
|
||||||
}
|
}
|
||||||
CommonRequest request = new CommonRequest();
|
CommonRequest request = new CommonRequest();
|
||||||
|
|
@ -236,11 +237,13 @@ public class SendNoteUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String phone = "1+4049014566";
|
/*String phone = "14696089013";
|
||||||
if (!isChineseMobileNumber(phone)) {
|
if (!isChineseMobileNumber(phone)) {
|
||||||
phone = phone.replace("+","");
|
//phone = phone.replace("+","");
|
||||||
System.out.println(sendMessageForeign(phone));
|
System.out.println(sendMessageForeign(phone));
|
||||||
}
|
}*/
|
||||||
|
String str = "1+1";
|
||||||
|
System.out.println(str.substring(str.indexOf("+") + 1,str.length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String sendMessageForeign(String phone){
|
private static String sendMessageForeign(String phone){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue