|
|
@@ -94,7 +94,8 @@ public class AuthController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/authorize")
|
|
|
- public Result<AuthDTO> authorize(HttpServletRequest request, @RequestParam String username, @RequestParam String password) {
|
|
|
+ public Result<AuthDTO> authorize(HttpServletRequest request, @RequestParam String username, @RequestParam String password,
|
|
|
+ @RequestParam(value = "companyId", required = false) Long companyId) {
|
|
|
// 非法操作(登录失败次数过多...)导致被冻结
|
|
|
if (authorizeCountService.isFrozen(username)) {
|
|
|
return Result.error(ExceptionCode.AUTH_FROZEN);
|
|
|
@@ -104,8 +105,7 @@ public class AuthController {
|
|
|
authorizeCountService.clear(username);
|
|
|
|
|
|
AccountDTO accountDTO = result.getData();
|
|
|
- Long companyId = null;
|
|
|
- if (!CollectionUtils.isEmpty(accountDTO.getCompanies())) {
|
|
|
+ if (null == companyId && !CollectionUtils.isEmpty(accountDTO.getCompanies())) {
|
|
|
companyId = accountDTO.getCompanies().get(0).getId();
|
|
|
}
|
|
|
// TODO
|