|
|
@@ -62,6 +62,15 @@ public class CustomAuthenticationSuccessHandler extends SimpleUrlAuthenticationS
|
|
|
public void onAuthenticationSuccess(final HttpServletRequest request, final HttpServletResponse response,
|
|
|
final Authentication authentication) throws ServletException, IOException {
|
|
|
User user = userService.findUserByUserUU(Long.parseLong(authentication.getName()));
|
|
|
+ if(CollectionUtils.isEmpty(user.getEnterprises())) {
|
|
|
+ response.setStatus(HttpStatus.BAD_REQUEST.value());
|
|
|
+ response.addHeader("Content-Type", "application/text; charset=utf-8");
|
|
|
+ PrintWriter printWriter = response.getWriter();
|
|
|
+ printWriter.append("您的账号未绑定企业或也被删除!");
|
|
|
+ printWriter.flush();
|
|
|
+ printWriter.close();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (user.getEnterprises().size() > 1) {// need to choose enterprise
|
|
|
if (!chooseEnterprise(request, response, user)) {
|
|
|
response.setStatus(HttpStatus.MULTI_STATUS.value());
|