| | |
| | | import com.stylefeng.guns.modular.system.util.ALiApiUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.qiniuyun.KodoUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.UserInviteInfoWarpper; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | |
| | | try { |
| | | /* HttpSession session = request.getSession(); |
| | | String code = (String)session.getAttribute(Constants.KAPTCHA_SESSION_KEY);*/ |
| | | String code = redisUtil.getValue(phone+"_Code"); |
| | | System.out.println("缓存中验证码为:"+code); |
| | | if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | return ResultUtil.error("图形验证码错误"); |
| | | } |
| | | // String code = redisUtil.getValue(phone+"_Code"); |
| | | // System.out.println("缓存中验证码为:"+code); |
| | | // if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | // return ResultUtil.error("图形验证码错误"); |
| | | // } |
| | | return userInfoService.queryCaptcha(phone, type); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/uploadImg") |
| | | @ApiOperation(value = "上传图片", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "文件", name = "file", required = true, dataType = "file"), |
| | | }) |
| | | public ResultUtil uploadImg(MultipartFile file){ |
| | | try { |
| | | String upload = KodoUtil.upload(file); |
| | | return ResultUtil.success(upload); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |