| | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.LoginDTO; |
| | | import com.doumee.dao.system.dto.LoginPhoneDTO; |
| | | import com.doumee.dao.system.dto.UpdatePwdDto; |
| | | import com.doumee.dao.system.dto.WebLoginDTO; |
| | | import com.doumee.dao.system.dto.*; |
| | | import com.doumee.service.system.SystemLoginService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation("登录 - 后端") |
| | | @PostMapping("/login") |
| | | public ApiResponse<String> login (@Validated @RequestBody LoginDTO dto, HttpServletRequest request) { |
| | | return ApiResponse.success(systemLoginService.loginByPassword(dto, Constants.ONE, request)); |
| | | return ApiResponse.success(systemLoginService.loginByPassword(dto, Constants.ONE, true, request)); |
| | | } |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("短信验证码登录") |
| | | @PostMapping("/loginByPhone") |
| | | public ApiResponse<String> loginByPhone (@Validated @RequestBody LoginPhoneDTO dto, HttpServletRequest request) { |
| | | return ApiResponse.success(systemLoginService.loginByPhone(dto, Constants.ZERO, request)); |
| | | return ApiResponse.success(systemLoginService.loginByPhone(dto, Constants.ONE, true, request)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("切换企业 - 后端") |
| | | @GetMapping("/switchCompany") |
| | | public ApiResponse<String> switchCompany (@RequestParam Integer companyId, HttpServletRequest request) { |
| | | return ApiResponse.success(systemLoginService.switchCompany(getLoginUser(),companyId, request)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("微信小程序登录") |
| | | @PostMapping("/loginByWxMini") |
| | | public ApiResponse<String> loginByWxMini (@Validated @RequestBody WxMiniLoginDTO dto, HttpServletRequest request) { |
| | | return ApiResponse.success(systemLoginService.loginByWxMini(dto, request)); |
| | | } |
| | | |
| | | @ApiOperation("退出登录") |
| | | @PostMapping("/logout") |
| | | public ApiResponse logout () { |
| | | systemLoginService.cleaOpenid(); |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | subject.logout(); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @Trace(withRequestParameters = false) |
| | | @ApiOperation("修改当前用户密码") |
| | | @PostMapping("/updatePwd") |