Skip to content

Commit 9027046

Browse files
🇨🇳 1.3.0.RELEASE shiro+jwt
1 parent 28131ee commit 9027046

File tree

6 files changed

+26
-37
lines changed

6 files changed

+26
-37
lines changed

README-zh.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
2. 集成mybatis plus快速dao操作
3939
3. 快速生成后台代码: entity/param/vo/controller/service/mapper/xml
4040
4. 集成swagger2,可自动生成api文档
41-
5. 集成jwt、spring security权限控制
41+
5. 集成jwt、shiro/spring security权限控制
4242
6. 集成redis、spring cache、ehcache缓存
4343
7. 集成rabbit/rocket/kafka mq消息队列
4444
8. 集成druid连接池,JDBC性能和慢查询检测
@@ -71,9 +71,11 @@ commons-codec | 1.13 | 加密解密等工具包 |
7171
commons-collections4 | 4.4 | 集合工具包 |
7272
reflections | 0.9.11 | 反射工具包 |
7373
hibernate-validator | 6.0.17.Final | 后台参数校验注解 |
74-
jwt | 0.9.1 | json web token |
74+
Shiro | 1.4.0 | 权限控制 |
75+
JWT | 3.8.3 | JSON WEB TOKEN |
7576
hutool-all | 4.6.4 | 常用工具集 |
7677
lombok | 1.18.8 | 注解生成Java Bean等工具 |
78+
mapstruct | 1.3.0.Final | 对象属性复制工具 |
7779

7880
## CHANGELOG
7981
#### [CHANGELOG.md](https://github.com/geekidea/spring-boot-plus/blob/master/CHANGELOG.md)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
- Integrated mybatis-plus fast dao operation
4141
- Quickly generate background code:entity/param/vo/controller/service/mapper/xml
4242
- Integrated swagger2, automatic generation of api documents
43-
- Integrated JWT, spring security permission control
43+
- Integrated JWT,Shiro/Spring security permission control
4444
- Integrated Redis、spring cache、ehcache,etc
4545
- Integrated Rabbit/Rocket/Kafka MQ
4646
- Integration alibaba druid connection pool, JDBC performance and slow query detection
@@ -73,9 +73,11 @@ commons-codec | 1.13 | Apache Toolkit such as encryption and decryption |
7373
commons-collections4 | 4.4 | Apache collections toolkit |
7474
reflections | 0.9.11 | Reflection Toolkit |
7575
hibernate-validator | 6.0.17.Final | Validator toolkit |
76-
jwt | 0.9.1 | JSON WEB TOKEN |
76+
Shiro | 1.4.0 | Permission control |
77+
JWT | 3.8.3 | JSON WEB TOKEN |
7778
hutool-all | 4.6.4 | Common toolset |
7879
lombok | 1.18.8 | Automatically plugs |
80+
mapstruct | 1.3.0.Final | Object property replication tool |
7981

8082
## CHANGELOG
8183
#### [CHANGELOG.md](https://github.com/geekidea/spring-boot-plus/blob/master/CHANGELOG.md)

pom.xml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@
6363
<jansi.version>1.18</jansi.version>
6464
<lombok.version>1.18.8</lombok.version>
6565
<commons-pool2.version>2.7.0</commons-pool2.version>
66-
<jwt.version>0.9.1</jwt.version>
6766
<spring-boot-admin.version>2.1.6</spring-boot-admin.version>
6867
<hutool.version>4.6.4</hutool.version>
6968
<junit.version>4.12</junit.version>
69+
<ini.version>0.5.4</ini.version>
7070
<mapstruct.version>1.3.0.Final</mapstruct.version>
71+
<shiro.version>1.4.0</shiro.version>
72+
<jwt.version>3.8.3</jwt.version>
7173

7274
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
7375
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
@@ -265,12 +267,14 @@
265267
</dependency>
266268
<!-- spring boot admin end -->
267269

270+
<!-- ini格式处理 -->
268271
<dependency>
269272
<groupId>org.ini4j</groupId>
270273
<artifactId>ini4j</artifactId>
271-
<version>0.5.4</version>
274+
<version>${ini.version}</version>
272275
</dependency>
273276

277+
<!-- 对象属性复制 -->
274278
<dependency>
275279
<groupId>org.mapstruct</groupId>
276280
<artifactId>mapstruct</artifactId>
@@ -283,29 +287,22 @@
283287
<scope>provided</scope>
284288
</dependency>
285289

286-
<!-- Shiro JWT start -->
290+
<!-- Shiro+JWT start -->
287291
<dependency>
288292
<groupId>org.apache.shiro</groupId>
289293
<artifactId>shiro-spring-boot-web-starter</artifactId>
290-
<version>1.4.0</version>
294+
<version>${shiro.version}</version>
291295
</dependency>
292-
293296
<dependency>
294297
<groupId>com.auth0</groupId>
295298
<artifactId>java-jwt</artifactId>
296-
<version>3.8.3</version>
299+
<version>${jwt.version}</version>
297300
</dependency>
298-
299-
<!-- <dependency>-->
300-
<!-- <groupId>io.jsonwebtoken</groupId>-->
301-
<!-- <artifactId>jjwt</artifactId>-->
302-
<!-- <version>${jwt.version}</version>-->
303-
<!-- </dependency>-->
304-
305-
<!-- Spring Security JWT start -->
301+
<!-- Shiro+JWT end -->
306302

307303
</dependencies>
308304

305+
309306
<build>
310307
<finalName>spring-boot-plus</finalName>
311308

src/main/java/io/geekidea/springbootplus/shiro/jwt/JwtFilter.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,6 @@ protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, Ser
151151
return true;
152152
}
153153

154-
/**
155-
* 如果(当前时间+倒计时) > 过期时间,则刷新token
156-
* 并更新缓存
157-
* 当前token失效,返回新token
158-
* 当前请求有效,返回状态码:460
159-
* 前端下次使用新token
160-
* 如果token继续发往后台,则提示,此token已失效,请使用新token,不在返回新token,返回状态码:461
161-
*
162-
* @param authenticationToken
163-
*/
164-
protected void refreshToken(AuthenticationToken authenticationToken, ServletResponse response) {
165-
166-
167-
}
168-
169-
170154
/**
171155
* 登陆失败处理
172156
*

src/main/java/io/geekidea/springbootplus/shiro/service/LoginService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ public interface LoginService {
4242
ApiResult login(LoginParam loginParam, HttpServletResponse response);
4343

4444
/**
45-
* 刷新token
45+
* 如果(当前时间+倒计时) > 过期时间,则刷新token
46+
* 并更新缓存
47+
* 当前token失效,返回新token
48+
* 当前请求有效,返回状态码:460
49+
* 前端下次使用新token
50+
* 如果token继续发往后台,则提示,此token已失效,请使用新token,不在返回新token,返回状态码:461
4651
*
4752
* @param jwtToken
4853
* @param httpServletResponse

src/main/resources/config/logback.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,13 @@
8787
<appender-ref ref ="ERROR_FILE"/>
8888
</appender>
8989

90-
9190
<!-- 不同环境的日志级别配置 -->
9291
<springProfile name="local">
9392
<logger name="io.geekidea.springbootplus" level="DEBUG"/>
9493
</springProfile>
9594

9695
<!-- 解决SpringBootAdmin错误日志问题 -->
97-
<!-- <logger name="org.apache.catalina.connector.CoyoteAdapter" level="OFF"/>-->
96+
<logger name="org.apache.catalina.connector.CoyoteAdapter" level="OFF"/>
9897

9998
<root level="INFO">
10099
<appender-ref ref="CONSOLE" />

0 commit comments

Comments
 (0)