main
parent
7feb5da469
commit
caf36ba73c
|
|
@ -20,6 +20,7 @@ import com.ruoyi.common.core.utils.JwtUtils;
|
|||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||
import com.ruoyi.common.core.utils.mail.AliMailUtil;
|
||||
import com.ruoyi.common.core.utils.mail.MailUtil;
|
||||
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.UUID;
|
||||
|
|
@ -66,6 +67,11 @@ public class AppLoginController {
|
|||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
public static void main(String[] args) {
|
||||
String str = "2@qq.com";
|
||||
System.out.println(IdUtils.fastUUID());
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
@ApiOperation(value = "注册", notes = "注册")
|
||||
public R<?> register(@RequestBody RegisterForm registerForm) {
|
||||
|
|
@ -77,31 +83,30 @@ public class AppLoginController {
|
|||
AppRegister register = appRegisterService.selectAppRegisterByphone(registerForm.getPhoneNumber());
|
||||
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
|
||||
|
||||
|
||||
//TODO
|
||||
AppSchool appSchool = schoolService.selectAppSchoolById(
|
||||
registerForm.getSchoolId()
|
||||
);
|
||||
Assert.isNull(appSchool, "学校不存在!");
|
||||
|
||||
// if (StringUtils.isNotEmpty(registerForm.getEmail())) {
|
||||
// //校验邮箱格式
|
||||
//// Assert.isTrue(MailUtil.validEmail(registerForm.getEmail()), "邮箱格式不正确") ;
|
||||
// AppRegister appRegister = setAppRegister(registerForm);
|
||||
// //校验邮箱是否已注册
|
||||
// AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
||||
// Assert.isNull(emailUser, "邮箱已注册");
|
||||
// redisService.setCacheMapValue(IdUtils.fastUUID(),registerForm.getEmail() , registerForm);
|
||||
// try {
|
||||
// String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
||||
// + "<p>请点击下面的网址确认您的注册:</p>"
|
||||
// + "<p>http://101.133.172.2:9204/app/activation/"+ IdUtils.fastUUID() + "/" + registerForm.getEmail() + "</p>"
|
||||
// + "</body></html>";
|
||||
//
|
||||
// MailUtil.send_mail(registerForm.getEmail(), EM);
|
||||
// } catch (MessagingException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// } else {
|
||||
String email = registerForm.getEmail();
|
||||
if (StringUtils.isNotEmpty(email) && appSchool.getEmail() != null && appSchool.getEmail().equals(email.substring(email.indexOf("@") + 1,email.length()))) {
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
//校验邮箱是否已注册
|
||||
AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
||||
Assert.isNull(emailUser, "邮箱已注册");
|
||||
redisService.setCacheMapValue(IdUtils.fastUUID(),registerForm.getEmail() , registerForm);
|
||||
try {
|
||||
String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
||||
+ "<p>请点击下面的网址确认您的注册:</p>"
|
||||
+ "<p>http://139.224.213.131:7008/app/activation/"+ IdUtils.fastUUID() + "/" + registerForm.getEmail() + "</p>"
|
||||
+ "</body></html>";
|
||||
|
||||
AliMailUtil.sendMail(EM,registerForm.getEmail());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (register != null && register.getStatus() != null) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue