mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-19 10:08:07 +08:00
优化核心包代码注释 & 彩色日志打印
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<!-- 定义 Sa-Token 版本号 -->
|
||||
<properties>
|
||||
<sa-token.version>1.34.0</sa-token.version>
|
||||
<java.run.main.class>com.pj.SaTokenApplication</java.run.main.class>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -38,7 +39,13 @@
|
||||
<artifactId>sa-token-spring-boot-starter</artifactId>
|
||||
<version>${sa-token.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Sa-Token 整合 Redis (使用jdk默认序列化方式) -->
|
||||
<!-- <dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
@@ -67,6 +74,59 @@
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<!-- 构建配置 -->
|
||||
<build>
|
||||
<!-- 配置资源目录 -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>${java.run.main.class}</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- 拷贝依赖的jar包到lib目录 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/lib
|
||||
</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -1,13 +1,13 @@
|
||||
package com.pj;
|
||||
|
||||
import cn.dev33.satoken.SaManager;
|
||||
import cn.dev33.satoken.filter.SaServletFilter;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
||||
/**
|
||||
* Sa-Token 测试
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@SpringBootApplication
|
||||
|
@@ -13,7 +13,7 @@ import cn.dev33.satoken.util.SaResult;
|
||||
|
||||
/**
|
||||
* 处理 404
|
||||
* @author kong
|
||||
* @author click33
|
||||
*/
|
||||
@RestController
|
||||
public class NotFoundHandle implements ErrorController {
|
||||
|
@@ -3,7 +3,7 @@ package com.pj.model;
|
||||
/**
|
||||
* User 实体类
|
||||
*
|
||||
* @author kong
|
||||
* @author click33
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
public class SysUser {
|
||||
|
@@ -1,14 +1,13 @@
|
||||
package com.pj.satoken;
|
||||
|
||||
import cn.dev33.satoken.log.SaLog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import cn.dev33.satoken.log.SaLog;
|
||||
|
||||
/**
|
||||
* 将 Sa-Token log 信息转接到 Slf4j
|
||||
*
|
||||
* @author kong
|
||||
* @author click33
|
||||
* @since 2022-11-2
|
||||
*/
|
||||
//@Component
|
||||
@@ -33,7 +32,7 @@ public class SaLogForSlf4j implements SaLog {
|
||||
|
||||
@Override
|
||||
public void warn(String str, Object... args) {
|
||||
log.trace(str, args);
|
||||
log.warn(str, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -15,7 +15,7 @@ import cn.dev33.satoken.util.SaResult;
|
||||
|
||||
/**
|
||||
* [Sa-Token 权限认证] 配置类
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@Configuration
|
||||
|
@@ -14,7 +14,7 @@ import cn.dev33.satoken.stp.StpLogic;
|
||||
|
||||
/**
|
||||
* Sa-Token 权限认证工具类 (User版)
|
||||
* @author kong
|
||||
* @author click33
|
||||
*/
|
||||
@Component
|
||||
public class StpUserUtil {
|
||||
|
@@ -14,7 +14,7 @@ import cn.dev33.satoken.util.SaResult;
|
||||
|
||||
/**
|
||||
* 注解鉴权测试
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
|
@@ -8,7 +8,7 @@ import cn.dev33.satoken.util.SaResult;
|
||||
|
||||
/**
|
||||
* 登录测试
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
|
@@ -13,7 +13,7 @@ import cn.dev33.satoken.util.SaResult;
|
||||
|
||||
/**
|
||||
* 压力测试
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
|
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 测试专用Controller
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
|
@@ -3,7 +3,7 @@ package com.pj.util;
|
||||
|
||||
/**
|
||||
* 用于测试用时
|
||||
* @author kong
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
public class Ttime {
|
||||
|
@@ -17,7 +17,7 @@ sa-token:
|
||||
# token风格
|
||||
token-style: uuid
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
is-log: true
|
||||
|
||||
spring:
|
||||
# redis配置
|
||||
|
Reference in New Issue
Block a user