| | |
| | | * @return 登录用户值对象 |
| | | */ |
| | | @PostMapping(path = "login", consumes = MediaType.APPLICATION_JSON_VALUE)//前端提交json数据 |
| | | @Log("用户登录(json)") |
| | | @Log("用户登录") |
| | | public BaseResponse<UserVo> login(@RequestBody @Valid LoginVo vo,BindingResult bindingResult, |
| | | HttpSession session) { |
| | | try { |
| | |
| | | * @return 登录用户值对象 |
| | | */ |
| | | @PostMapping(path = "loginForm", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)//前端提交form表单数据 |
| | | @Log("用户登录(form)") |
| | | public BaseResponse<UserVo> loginForm(@Valid LoginVo loginVo, BindingResult bindingResult,HttpSession session){ |
| | | try{ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | |
| | | * @return |
| | | */ |
| | | private String generateCaptcha() { |
| | | Random r = new Random(); |
| | | return r.nextInt(9000) + 1000 + ""; |
| | | // Random r = new Random(); |
| | | // return r.nextInt(9000) + 1000 + ""; |
| | | return "1234"; |
| | | } |
| | | /** |
| | | * 用户登录 |