@RequestMapping(method = { RequestMethod.POST, RequestMethod.GET })
    public String login(LoginReqDTO loginReqDTO, String redirect, HttpServletRequest request,
                        HttpServletResponse response, ModelMap model) {
        if (request.getMethod().equals("GET")) {
            return UrlConstant.LOGIN_URL;
        }

        // 验证用户的合法性
        model.addAttribute("loginReqDTO", loginReqDTO);
        String errorDesc = check(loginReqDTO);
        if (!StringUtils.isBlank(errorDesc)) {
            model.addAttribute("errorDesc", errorDesc);
            return UrlConstant.LOGIN_URL;
        }

        UCloudResult<UserDTO> result = userManageService.verifyAndGetUser(loginReqDTO.getAccount(),
                loginReqDTO.getPassword(), RoleEnum.getRoleByStatus(loginReqDTO.getRole()));
        if (result.isSuccess() && result.getModel() != null) {
            request.getSession(true).setAttribute(SessionConstant.USER_ACCOUNT, result.getModel().getAccount());
            if (StringUtils.isBlank(redirect)) {
                return goDefaultPage(result.getModel().getRole());
            }
            log.info("redirect:" + redirect);
            return "redirect:" + redirect;
        } else {
            model.addAttribute("errorDesc", "用户名或密码错误");
        }

        return UrlConstant.LOGIN_URL;
    }