diff --git a/src/main/java/org/joychou/controller/Shiro.java b/src/main/java/org/joychou/controller/Shiro.java index 2dc143ca..bb0adfa6 100644 --- a/src/main/java/org/joychou/controller/Shiro.java +++ b/src/main/java/org/joychou/controller/Shiro.java @@ -5,18 +5,21 @@ import org.apache.shiro.crypto.AesCipherService; import org.joychou.config.Constants; import org.joychou.util.CookieUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; + import static org.springframework.web.util.WebUtils.getCookie; @Slf4j @RestController public class Shiro { - + private static final Logger logger = LoggerFactory.getLogger(SSRF.class); byte[] KEYS = java.util.Base64.getDecoder().decode("kPH+bIxk5D2deZiIxcaaaA=="); private final static String DELETE_ME = "deleteMe"; AesCipherService acs = new AesCipherService(); @@ -39,7 +42,7 @@ public String shiro_deserialize(HttpServletRequest req, HttpServletResponse res) in.close(); } catch (Exception e){ if (CookieUtils.addCookie(res, "rememberMe", DELETE_ME)){ - log.error(e.getMessage()); + logger.error(e.getMessage()); return "RememberMe cookie decrypt error. Set deleteMe cookie success."; } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 326a2b76..1c436c20 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ - +server.port=18989 spring.datasource.url=jdbc:mysql://localhost:3306/java_sec_code?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC spring.datasource.username=root -spring.datasource.password=woshishujukumima +spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver mybatis.mapper-locations=classpath:mapper/*.xml # mybatis SQL log