فهرست منبع

fix 系统邮箱

zoujiajian 1 سال پیش
والد
کامیت
9d086b7ca3

+ 2 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -398,4 +398,6 @@ public interface Constant {
 	 * 账号邮箱外部验证码
 	 */
 	List<Long> YH_EMAIL_VERIFY_OUTSIDE_CODE_GIDS = List.of(1l, 3l, 33l);
+
+	String YH_EMAIL_DOMAIN_SUFFIX = "@yinhe.ac.cn";
 }

+ 23 - 19
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -506,11 +506,13 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			renewalView = new RenewalView();
 			renewalView.setGoodsId(loginReq.getGoodsId());
 			renewalView.setAccount(loginReq.getAccount());
-			GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
-					.eq(GroupsTrips::getAccountId, loginReq.getAccountId())
-					.last("limit 1"));
-			if (groupsTrips != null) {
-				renewalView.setSkuId(groupsTrips.getSkuId());
+			if (loginReq.getAccountId() != null && loginReq.getAccountId() != 0l) {
+				GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
+						.eq(GroupsTrips::getAccountId, loginReq.getAccountId())
+						.last("limit 1"));
+				if (groupsTrips != null) {
+					renewalView.setSkuId(groupsTrips.getSkuId());
+				}
 			}
 			renewalView.setUserId(userId);
 			account = loginReq.getAccount();
@@ -832,12 +834,13 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			throw BusinessRuntimeException.getInstance("请输入对应账号");
 		}
 		if (loginReq.getMerchants()) {
-			Account dbAccount = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class)
-					.eq(Account::getAccount, account)
-					.eq(Account::getGoodsId, Constant.YH_EMAIL_VERIFY_OUTSIDE_CODE_GIDS.get(0))
-					.last("limit 1"));
-			if (dbAccount == null) {
-				throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
+			if (account.contains(Constant.YH_EMAIL_DOMAIN_SUFFIX)) {
+				SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
+						.eq(SysEmail::getEmail, account)
+						.last("limit 1"));
+				if (sysEmail == null) {
+					throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
+				}
 			}
 			GroupsRelation relation = new GroupsRelation();
 			relation.setId(0l);
@@ -867,15 +870,16 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			throw BusinessRuntimeException.getInstance("账号错误");
 		}
 		if (loginReq.getMerchants()) {
-			Account dbAccount = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class)
-					.eq(Account::getAccount, account)
-					.eq(Account::getGoodsId, Constant.YH_EMAIL_VERIFY_OUTSIDE_CODE_GIDS.get(0))
-					.last("limit 1"));
-			if (dbAccount == null) {
-				throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
+			if (account.contains(Constant.YH_EMAIL_DOMAIN_SUFFIX)) {
+				SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
+						.eq(SysEmail::getEmail, account)
+						.last("limit 1"));
+				if (sysEmail == null) {
+					throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
+				}
 			}
-			loginReq.setGoodsId(dbAccount.getGoodsId());
-			loginReq.setAccountId(dbAccount.getId());
+			loginReq.setGoodsId(1l);
+			loginReq.setAccountId(0l);
 		} else {
 			String password = loginReq.getPassword();
 			Integer num = loginReq.getNum();