Selaa lähdekoodia

fix 首次注册只能gmail邮箱

zoujiajian 3 vuotta sitten
vanhempi
sitoutus
cdac957963

+ 7 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -331,6 +331,13 @@ public class AuthorizationController {
         if (email == null || !Validator.isEmail(email)) {
             throw BusinessRuntimeException.getInstance("请输入正确邮箱");
         }
+        //首次注册只能gmail邮箱
+        if (!email.contains("@gmail")) {
+            User user = userService.getOne(Wrappers.lambdaQuery(User.class).eq(User::getEmail, email).last("limit 1"));
+            if (user == null) {
+                throw BusinessRuntimeException.getInstance("暂只支持使用谷歌邮箱注册");
+            }
+        }
         String code = mailService.sendLoginCodeEmailToPeople(digit, email);
         if (code == null) {
             throw BusinessRuntimeException.getInstance("获取邮箱验证码错误");