|
@@ -60,34 +60,34 @@ public class UserLiveController extends BaseController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WxCUserAuthorityService wxCUserAuthorityService; |
|
|
private WxCUserAuthorityService wxCUserAuthorityService; |
|
|
|
|
|
|
|
|
@AuthIgnore |
|
|
|
|
|
@ApiOperation("验证码") |
|
|
|
|
|
@GetMapping("/captcha.jpg") |
|
|
|
|
|
public void captcha(HttpServletResponse response) { |
|
|
|
|
|
logger.debug("[" + getIpAddr() + "] WxUserGrantController::captcha"); |
|
|
|
|
|
response.setHeader("Cache-Control", "no-store, no-cache"); |
|
|
|
|
|
response.setContentType("image/jpeg"); |
|
|
|
|
|
|
|
|
|
|
|
//生成文字验证码 |
|
|
|
|
|
String text = producer.createText(); |
|
|
|
|
|
//生成图片验证码 |
|
|
|
|
|
BufferedImage image = producer.createImage(text); |
|
|
|
|
|
|
|
|
|
|
|
//保存到redis |
|
|
|
|
|
String ipAddr = getIpAddr(); |
|
|
|
|
|
String key = Constant.captchaPrev + ":" + ipAddr; |
|
|
|
|
|
RedisCacheUtils.cache(redisTemplate, key, text, 60); |
|
|
|
|
|
|
|
|
|
|
|
ServletOutputStream out = null; |
|
|
|
|
|
try { |
|
|
|
|
|
out = response.getOutputStream(); |
|
|
|
|
|
ImageIO.write(image, "jpg", out); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} finally { |
|
|
|
|
|
IOUtils.closeQuietly(out); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// @AuthIgnore |
|
|
|
|
|
// @ApiOperation("验证码") |
|
|
|
|
|
// @GetMapping("/captcha.jpg") |
|
|
|
|
|
// public void captcha(HttpServletResponse response) { |
|
|
|
|
|
// logger.debug("[" + getIpAddr() + "] WxUserGrantController::captcha"); |
|
|
|
|
|
// response.setHeader("Cache-Control", "no-store, no-cache"); |
|
|
|
|
|
// response.setContentType("image/jpeg"); |
|
|
|
|
|
// |
|
|
|
|
|
// //生成文字验证码 |
|
|
|
|
|
// String text = producer.createText(); |
|
|
|
|
|
// //生成图片验证码 |
|
|
|
|
|
// BufferedImage image = producer.createImage(text); |
|
|
|
|
|
// |
|
|
|
|
|
// //保存到redis |
|
|
|
|
|
// String ipAddr = getIpAddr(); |
|
|
|
|
|
// String key = Constant.captchaPrev + ":" + ipAddr; |
|
|
|
|
|
// RedisCacheUtils.cache(redisTemplate, key, text, 60); |
|
|
|
|
|
// |
|
|
|
|
|
// ServletOutputStream out = null; |
|
|
|
|
|
// try { |
|
|
|
|
|
// out = response.getOutputStream(); |
|
|
|
|
|
// ImageIO.write(image, "jpg", out); |
|
|
|
|
|
// } catch (IOException e) { |
|
|
|
|
|
// e.printStackTrace(); |
|
|
|
|
|
// } finally { |
|
|
|
|
|
// IOUtils.closeQuietly(out); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
@AuthIgnore |
|
|
@AuthIgnore |
|
|
@PostMapping("/login") |
|
|
@PostMapping("/login") |
|
|