谷歌登录-根据openid是否是邮箱区分新旧版本
This commit is contained in:
@@ -141,7 +141,7 @@ public class EmailService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidEmail(String email) {
|
||||
public boolean isValidEmail(String email) {
|
||||
return !StringUtils.isEmpty(email) && email.matches(EMAIL_REGEX);
|
||||
}
|
||||
}
|
||||
|
@@ -145,7 +145,8 @@ public class AccountManageService {
|
||||
Account account = null;
|
||||
String thirdAccountEmail = null;
|
||||
|
||||
if (LoginTypeEnum.GOOGLE.getValue() == type) {
|
||||
// openid是邮箱,则是新版本
|
||||
if (LoginTypeEnum.GOOGLE.getValue() == type && emailService.isValidEmail(openid)) {
|
||||
GoogleOpenidRef ref = googleOpenidRefService.getRefByEmail(openid, idToken);
|
||||
if (null != ref) {
|
||||
openid = ref.getOpenId();
|
||||
|
Reference in New Issue
Block a user