| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/wechat") |
| | | @ApiOperation(value = "微信一键登录", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "code", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil<LoginWarpper> wechat(String code){ |
| | | try { |
| | | |
| | | String phone1 = weChatUtil.getPhone(code); |
| | | return userInfoService.captchaLogin1(phone1); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/oneClickLogin") |
| | | @ApiOperation(value = "手机一键登录", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | |
| | | public ResultUtil uploadImg(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | String name = file.getOriginalFilename(); |
| | | String type = name.substring(name.lastIndexOf(".") + 1).toLowerCase(); |
| | | List<String> types = Arrays.asList("jpg", "jpeg", "png"); |
| | | if(!types.contains(type)){ |
| | | return ResultUtil.error("请上传图片文件(jpg/jpeg/png)"); |
| | | } |
| | | // String type = name.substring(name.lastIndexOf(".") + 1).toLowerCase(); |
| | | // List<String> types = Arrays.asList("jpg", "jpeg", "png"); |
| | | // if(!types.contains(type)){ |
| | | // return ResultUtil.error("请上传图片文件(jpg/jpeg/png)"); |
| | | // } |
| | | String s = OssUploadUtil.ossUpload(request, file); |
| | | return ResultUtil.success(s); |
| | | }catch (Exception e){ |