| | |
| | | if (user == null || !Constants.equalsInteger(user.getH5UserType(), LoginUserInfo.H5_USER_CUSTOMER)) { |
| | | return ApiResponse.failed("登录已失效"); |
| | | } |
| | | return ApiResponse.success(ywCustomerH5AuthService.buildLoginUserInfo(user.getCustomerId())); |
| | | return ApiResponse.success(ywCustomerH5AuthService.buildLoginUserInfo(user.getCustomerId(), user.getMemberId())); |
| | | } |
| | | |
| | | @ApiOperation("商户退出登录") |
| | | @PostMapping("/logout") |
| | | public ApiResponse<String> logout(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | try { |
| | | LoginUserInfo user = requireCustomerUser(token); |
| | | ywCustomerH5AuthService.logout(user, token); |
| | | return ApiResponse.success("退出成功"); |
| | | } catch (Exception e) { |
| | | log.error("customer logout failed", e); |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR.getCode(), "退出失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("工作台轮播图") |
| | |
| | | @GetMapping("/home") |
| | | public ApiResponse<Map<String, Object>> home(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo user = requireCustomerUser(token); |
| | | return ApiResponse.success(ywCustomerH5BizService.home(user.getCustomerId())); |
| | | return ApiResponse.success(ywCustomerH5BizService.home(user.getCustomerId(), user.getMemberId())); |
| | | } |
| | | |
| | | @ApiOperation("交电费设备列表") |