| | |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.system.dto.LoginCabinetDTO; |
| | | import com.doumee.dao.system.dto.LoginH5DTO; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | |
| | | return ApiResponse.success(null); |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/logoutForH5") |
| | | @ApiOperation("退出登陆") |
| | | public ApiResponse<String> logoutForH5(@RequestHeader(Constants.HEADER_USER_TOKEN) String oldToken){ |
| | |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR); |
| | | } |
| | | return ApiResponse.success(null); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | return ApiResponse.failed( "登录已失效"); |
| | | } |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("登录 - 钥匙柜") |
| | | @PostMapping("/loginCabinet") |
| | | @LoginNoRequired |
| | | public ApiResponse<String> loginCabinet (@Validated @RequestBody LoginCabinetDTO dto, ServerWebExchange serverWebExchange) { |
| | | try { |
| | | ServerHttpRequest request = serverWebExchange.getRequest(); |
| | | LoginUserInfo user = systemLoginService.loginByPasswordForCabinet(dto,request); |
| | | String token = jwtTokenUtil.generateToken(user); |
| | | return ApiResponse.success(token); |
| | | }catch (BusinessException e){ |
| | | return ApiResponse.failed(e.getCode(),e.getMessage()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |