|
@@ -1,7 +1,12 @@
|
|
|
package com.fdkankan.fusion.controller;
|
|
|
|
|
|
import cn.hutool.captcha.CaptchaUtil;
|
|
|
+import cn.hutool.captcha.CircleCaptcha;
|
|
|
import cn.hutool.captcha.LineCaptcha;
|
|
|
+import cn.hutool.captcha.ShearCaptcha;
|
|
|
+import cn.hutool.captcha.generator.CodeGenerator;
|
|
|
+import cn.hutool.captcha.generator.MathGenerator;
|
|
|
+import cn.hutool.captcha.generator.RandomGenerator;
|
|
|
import cn.hutool.crypto.digest.MD5;
|
|
|
import cn.hutool.http.ContentType;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -14,17 +19,21 @@ import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.response.UserAddRequest;
|
|
|
import com.fdkankan.fusion.service.ITmUserService;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import jdk.nashorn.internal.runtime.regexp.joni.Config;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.compress.utils.OsgiUtils;
|
|
|
import org.apache.http.HttpHeaders;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.security.Security;
|
|
|
-
|
|
|
+import java.util.Properties;
|
|
|
@RestController
|
|
|
@RequestMapping("/notAuth")
|
|
|
@Slf4j
|
|
@@ -41,7 +50,9 @@ public class NoLoginController {
|
|
|
response.setContentType("image/jpeg");
|
|
|
String id = request.getSession().getId();
|
|
|
try {
|
|
|
- LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100,4,60);
|
|
|
+ LineCaptcha lineCaptcha = new LineCaptcha(200, 100);
|
|
|
+ RandomGenerator mathGenerator = new RandomGenerator("1234567890",4);
|
|
|
+ lineCaptcha.setGenerator(mathGenerator);
|
|
|
redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,lineCaptcha.getCode()),lineCaptcha.getCode(),60*5);
|
|
|
lineCaptcha.write(response.getOutputStream());
|
|
|
response.getOutputStream().close();
|
|
@@ -62,9 +73,11 @@ public class NoLoginController {
|
|
|
return ResultData.ok( tmUserService.getMsgAuthCode(phoneNum));
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- String md5Hex = MD5.create().digestHex("Aa123456");
|
|
|
|
|
|
- System.out.println(MD5.create().digestHex(md5Hex));
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String passwordHash = MD5.create().digestHex("6N^KJTG*GkWj3C");
|
|
|
+ System.out.println(passwordHash);
|
|
|
+ String passwordHash2 = MD5.create().digestHex(passwordHash);
|
|
|
+ System.out.println(passwordHash2);
|
|
|
}
|
|
|
}
|