luodangjia
2024-12-10 31ce6be2d56798d9509e6d90335999064351f7f3
UserNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -104,6 +104,24 @@
    }
    @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({
@@ -708,11 +726,11 @@
    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){