|
@@ -443,6 +443,18 @@ public class TAdminController {
|
|
|
if (registerParam.getIfForeign().isEmpty()) {
|
|
|
return R.fail(ResponseCodesEnum.A0001, "是否国内外为空!");
|
|
|
}
|
|
|
+ String relationAdminId = "";
|
|
|
+ if(StringUtils.isNotEmpty(registerParam.getInviteCode())) {
|
|
|
+ // 验证邀请码
|
|
|
+ relationAdminId = String.valueOf(AdminUtils.decrypt(false, registerParam.getInviteCode()));
|
|
|
+ TAdmin admin = tAdminService.getById(relationAdminId);
|
|
|
+ if (admin == null) {
|
|
|
+ return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
|
|
|
+ }
|
|
|
+ if (admin.getType() != 1) {
|
|
|
+ return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
|
|
|
+ }
|
|
|
+ }
|
|
|
// 国内用户注册
|
|
|
if (registerParam.getIfForeign().equals("0")) {
|
|
|
// 判断 phoneOrEmail 是手机号还是邮箱
|
|
@@ -534,6 +546,10 @@ public class TAdminController {
|
|
|
if (registerParam.getIfForeign().equals("1")) {
|
|
|
admin.setPromoCodeOpen("0");
|
|
|
}
|
|
|
+ // 邀请码,即上级账号
|
|
|
+ if(StringUtils.isNotEmpty(relationAdminId)) {
|
|
|
+ admin.setRelationAdminId(relationAdminId);
|
|
|
+ }
|
|
|
admin.setCompanyType(registerParam.getCompanyType());
|
|
|
if (Pattern.matches(phoneReg, phoneOrEmail)) {
|
|
|
admin.setPhone(registerParam.getPhoneOrEmail());
|