Commit c09d065a authored by 李健华's avatar 李健华

添加冻结msg返回

parent 3d94f0ff
...@@ -4,4 +4,6 @@ public class UserConstant { ...@@ -4,4 +4,6 @@ public class UserConstant {
public static final String USER_ERROR_OR_PASSWORD_ERROR = "帐号或密码错误"; public static final String USER_ERROR_OR_PASSWORD_ERROR = "帐号或密码错误";
public static final String USER_ERROR_OR_ENABLE_ERROR = "账号异常,请联系平台客服。"; public static final String USER_ERROR_OR_ENABLE_ERROR = "账号异常,请联系平台客服。";
public static final String USER_FREEZE_ERROR = "账号异常,已冻结。";
} }
...@@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR; import static cn.quantgroup.xyqb.constant.UserConstant.USER_FREEZE_ERROR;
/** /**
* @author :dongjianhua * @author :dongjianhua
...@@ -87,6 +87,10 @@ public class AppletServiceImpl implements IAppletService { ...@@ -87,6 +87,10 @@ public class AppletServiceImpl implements IAppletService {
if (null == user) { if (null == user) {
user = iUserRegisterService.register(appletParamEntry.getChannelId(), appletParamEntry.getMobile()); user = iUserRegisterService.register(appletParamEntry.getChannelId(), appletParamEntry.getMobile());
} }
if (!user.getEnable()) {
log.warn("已冻结 userId--{}", user.getId());
throw new AppletException(USER_FREEZE_ERROR, "0401");
}
iOauthLoginInfoService.addRegisterInfo(user, appletParamEntry); iOauthLoginInfoService.addRegisterInfo(user, appletParamEntry);
wechatUserInfo.setUserId(user.getId()); wechatUserInfo.setUserId(user.getId());
} }
...@@ -100,6 +104,12 @@ public class AppletServiceImpl implements IAppletService { ...@@ -100,6 +104,12 @@ public class AppletServiceImpl implements IAppletService {
if (null == user) { if (null == user) {
user = iUserRegisterService.register(appletParamEntry.getChannelId(), appletParamEntry.getMobile(), appletParamEntry.getTenantId()); user = iUserRegisterService.register(appletParamEntry.getChannelId(), appletParamEntry.getMobile(), appletParamEntry.getTenantId());
} }
if (!user.getEnable()) {
log.warn("已冻结 userId--{}", user.getId());
throw new AppletException(USER_FREEZE_ERROR, "0401");
}
iOauthLoginInfoService.addRegisterInfo(user, appletParamEntry); iOauthLoginInfoService.addRegisterInfo(user, appletParamEntry);
return user.getId(); return user.getId();
} }
...@@ -126,9 +136,15 @@ public class AppletServiceImpl implements IAppletService { ...@@ -126,9 +136,15 @@ public class AppletServiceImpl implements IAppletService {
} }
user = userService.findById(wechatUserInfo.getUserId()); user = userService.findById(wechatUserInfo.getUserId());
if (null == user || !user.getEnable()) { if (null == user || !user.getEnable()) {
log.warn("未找到此用户或冻结,appName:{} ,openId:{}", appName, openId); log.warn("未找到此用户,appName:{} ,openId:{}", appName, openId);
throw new AppletException(USER_ERROR_OR_ENABLE_ERROR,"0401"); throw new AppletException("未找到此用户", "0401");
}
if (!user.getEnable()) {
log.warn("已冻结,appName:{} ,openId:{}", appName, openId);
throw new AppletException(USER_FREEZE_ERROR, "0401");
} }
iOauthLoginInfoService.addLoginInfo(user, tenantId); iOauthLoginInfoService.addLoginInfo(user, tenantId);
if (unionId != null && !unionId.equals(wechatUserInfo.getUnionId()) ) { if (unionId != null && !unionId.equals(wechatUserInfo.getUnionId()) ) {
...@@ -143,9 +159,13 @@ public class AppletServiceImpl implements IAppletService { ...@@ -143,9 +159,13 @@ public class AppletServiceImpl implements IAppletService {
throw new AppletException("未找到此用户","0401"); throw new AppletException("未找到此用户","0401");
} }
user = userService.findById(userId); user = userService.findById(userId);
if (null == user || !user.getEnable()) { if (null == user) {
log.warn("未找到此用户或冻结,appName:{} ,openId:{}", appName, openId); log.warn("未找到此用户,appName:{} ,openId:{}", appName, openId);
throw new AppletException(USER_ERROR_OR_ENABLE_ERROR,"0401"); throw new AppletException("未找到此用户", "0401");
}
if (!user.getEnable()) {
log.warn("已冻结,appName:{} ,openId:{}", appName, openId);
throw new AppletException(USER_FREEZE_ERROR, "0401");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment