Skip to content

Commit 4a339ec

Browse files
🚔 优化验证码控制器,优化SpringBootPlusConfig类,README.md
1 parent 246a0d3 commit 4a339ec

File tree

8 files changed

+183
-68
lines changed

8 files changed

+183
-68
lines changed

TODO.md renamed to CHANGELOG_TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TODO
1+
# CHANGELOG TODO
22

33
## [V1.5]
44
- 代码生成起优化,是否生成自定义update方法
@@ -10,6 +10,7 @@
1010
- 字典表
1111
- 配置参数表
1212
- 上传文件附件表
13+
- Redis分布式锁
1314

1415
## [V1.6]
1516
- Spring security集成

README-zh.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,49 @@ sh deploy.sh
356356
tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
357357
```
358358
359+
360+
## spring-boot-plus Views
361+
362+
### spring-boot-plus IDEA Sources Views
363+
364+
![spring-boot-plus-idea](https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-idea.png)
365+
366+
### [Spring Boot Admin Instances](http://47.105.159.10:8888/instances/e211ba082db8/details)
367+
<p>
368+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
369+
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin.png" alt="spring-boot-admin instances">
370+
</a>
371+
</p>
372+
373+
### [Spring Boot Admin Statistics](http://47.105.159.10:8888/instances/e211ba082db8/details)
374+
<p>
375+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
376+
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin-1.png" alt="spring-boot-admin statistics">
377+
</a>
378+
</p>
379+
380+
### [Spring Boot Admin Log](http://47.105.159.10:8888/instances/e211ba082db8/logfile)
381+
<p>
382+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/logfile">
383+
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-admin-log.png" alt="spring-boot-admin log">
384+
</a>
385+
</p>
386+
387+
### [spring-boot-plus Swagger文档](http://47.105.159.10:8888/swagger-ui.html)
388+
<p>
389+
<a href="http://47.105.159.10:8888/swagger-ui.html">
390+
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-swagger.png" alt="spring-boot-plus swagger docs">
391+
</a>
392+
</p>
393+
394+
### [spring-boot-plus Java Api Docs](http://geekidea.io/spring-boot-plus-apidocs/)
395+
<p>
396+
<a href="http://geekidea.io/spring-boot-plus-apidocs/">
397+
<img src="https://spring-boot-plus.gitee.io/img/home/spring-boot-plus-java-apidocs.png" alt="spring-boot-plus Java Api Docs">
398+
</a>
399+
</p>
400+
401+
359402
## spring-boot-plus 视频 :movie_camera:
360403
- [5分钟完成增删改查](https://www.bilibili.com/video/av67401204)
361404
- [CentOS 快速安装 JDK/Git/Maven/Redis/MySQL](https://www.bilibili.com/video/av67218836/)

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,48 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
360360
```
361361
362362
363+
## spring-boot-plus Views
364+
365+
### spring-boot-plus IDEA Sources Views
366+
367+
![spring-boot-plus-idea](https://springboot.plus/img/home/spring-boot-plus-idea.png)
368+
369+
### [Spring Boot Admin Instances](http://47.105.159.10:8888/instances/e211ba082db8/details)
370+
<p>
371+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
372+
<img src="https://springboot.plus/img/home/spring-boot-admin.png" alt="spring-boot-admin instances">
373+
</a>
374+
</p>
375+
376+
### [Spring Boot Admin Statistics](http://47.105.159.10:8888/instances/e211ba082db8/details)
377+
<p>
378+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
379+
<img src="https://springboot.plus/img/home/spring-boot-admin-1.png" alt="spring-boot-admin statistics">
380+
</a>
381+
</p>
382+
383+
### [Spring Boot Admin Log](http://47.105.159.10:8888/instances/e211ba082db8/logfile)
384+
<p>
385+
<a href="http://47.105.159.10:8888/instances/e211ba082db8/logfile">
386+
<img src="https://springboot.plus/img/home/spring-boot-admin-log.png" alt="spring-boot-admin log">
387+
</a>
388+
</p>
389+
390+
### [spring-boot-plus Swagger文档](http://47.105.159.10:8888/swagger-ui.html)
391+
<p>
392+
<a href="http://47.105.159.10:8888/swagger-ui.html">
393+
<img src="https://springboot.plus/img/home/spring-boot-plus-swagger.png" alt="spring-boot-plus swagger docs">
394+
</a>
395+
</p>
396+
397+
### [spring-boot-plus Java Api Docs](http://geekidea.io/spring-boot-plus-apidocs/)
398+
<p>
399+
<a href="http://geekidea.io/spring-boot-plus-apidocs/">
400+
<img src="https://springboot.plus/img/home/spring-boot-plus-java-apidocs.png" alt="spring-boot-plus Java Api Docs">
401+
</a>
402+
</p>
403+
404+
363405
## spring-boot-plus Videos :movie_camera:
364406
- [5-Minutes-Finish-CRUD](https://www.bilibili.com/video/av67401204)
365407
- [CentOS Quick Installation JDK/Git/Maven/Redis/MySQL](https://www.bilibili.com/video/av67218836/)

src/main/java/io/geekidea/springbootplus/core/config/SpringBootPlusConfig.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@
1616
package io.geekidea.springbootplus.core.config;
1717

1818
import io.geekidea.springbootplus.core.properties.*;
19-
import io.geekidea.springbootplus.interceptor.PermissionInterceptor;
20-
import io.geekidea.springbootplus.resource.interceptor.DownloadInterceptor;
21-
import io.geekidea.springbootplus.resource.interceptor.ResourceInterceptor;
22-
import io.geekidea.springbootplus.resource.interceptor.UploadInterceptor;
2319
import lombok.extern.slf4j.Slf4j;
2420
import org.springframework.boot.context.properties.EnableConfigurationProperties;
25-
import org.springframework.context.annotation.Bean;
2621
import org.springframework.context.annotation.Configuration;
2722

2823
/**
@@ -43,47 +38,4 @@
4338
})
4439
public class SpringBootPlusConfig {
4540

46-
/**
47-
* 权限拦截器
48-
*
49-
* @return
50-
*/
51-
@Bean
52-
public PermissionInterceptor permissionInterceptor() {
53-
PermissionInterceptor permissionInterceptor = new PermissionInterceptor();
54-
return permissionInterceptor;
55-
}
56-
57-
/**
58-
* 上传拦截器
59-
*
60-
* @return
61-
*/
62-
@Bean
63-
public UploadInterceptor uploadInterceptor() {
64-
UploadInterceptor uploadInterceptor = new UploadInterceptor();
65-
return uploadInterceptor;
66-
}
67-
68-
/**
69-
* 资源拦截器
70-
*
71-
* @return
72-
*/
73-
@Bean
74-
public ResourceInterceptor resourceInterceptor() {
75-
ResourceInterceptor resourceInterceptor = new ResourceInterceptor();
76-
return resourceInterceptor;
77-
}
78-
79-
/**
80-
* 下载拦截器
81-
*
82-
* @return
83-
*/
84-
@Bean
85-
public DownloadInterceptor downloadInterceptor() {
86-
DownloadInterceptor downloadInterceptor = new DownloadInterceptor();
87-
return downloadInterceptor;
88-
}
8941
}

src/main/java/io/geekidea/springbootplus/core/config/SpringBootPlusWebMvcConfig.java

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@
1717
package io.geekidea.springbootplus.core.config;
1818

1919
import com.alibaba.fastjson.JSON;
20-
import io.geekidea.springbootplus.interceptor.PermissionInterceptor;
2120
import io.geekidea.springbootplus.core.properties.SpringBootPlusInterceptorProperties;
2221
import io.geekidea.springbootplus.core.properties.SpringBootPlusProperties;
22+
import io.geekidea.springbootplus.interceptor.PermissionInterceptor;
2323
import io.geekidea.springbootplus.resource.interceptor.DownloadInterceptor;
2424
import io.geekidea.springbootplus.resource.interceptor.ResourceInterceptor;
2525
import io.geekidea.springbootplus.resource.interceptor.UploadInterceptor;
2626
import io.geekidea.springbootplus.util.IniUtil;
2727
import lombok.extern.slf4j.Slf4j;
2828
import org.apache.commons.lang3.StringUtils;
2929
import org.springframework.beans.factory.annotation.Autowired;
30+
import org.springframework.context.annotation.Bean;
3031
import org.springframework.context.annotation.Configuration;
3132
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
3233
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
@@ -44,20 +45,56 @@
4445
@Configuration
4546
public class SpringBootPlusWebMvcConfig implements WebMvcConfigurer {
4647

48+
/**
49+
* spring-boot-plus配置属性
50+
*/
4751
@Autowired
4852
private SpringBootPlusProperties springBootPlusProperties;
4953

50-
@Autowired
51-
private PermissionInterceptor permissionInterceptor;
54+
/**
55+
* 权限拦截器
56+
*
57+
* @return
58+
*/
59+
@Bean
60+
public PermissionInterceptor permissionInterceptor() {
61+
PermissionInterceptor permissionInterceptor = new PermissionInterceptor();
62+
return permissionInterceptor;
63+
}
5264

53-
@Autowired
54-
private ResourceInterceptor resourceInterceptor;
65+
/**
66+
* 上传拦截器
67+
*
68+
* @return
69+
*/
70+
@Bean
71+
public UploadInterceptor uploadInterceptor() {
72+
UploadInterceptor uploadInterceptor = new UploadInterceptor();
73+
return uploadInterceptor;
74+
}
5575

56-
@Autowired
57-
private UploadInterceptor uploadInterceptor;
76+
/**
77+
* 资源拦截器
78+
*
79+
* @return
80+
*/
81+
@Bean
82+
public ResourceInterceptor resourceInterceptor() {
83+
ResourceInterceptor resourceInterceptor = new ResourceInterceptor();
84+
return resourceInterceptor;
85+
}
86+
87+
/**
88+
* 下载拦截器
89+
*
90+
* @return
91+
*/
92+
@Bean
93+
public DownloadInterceptor downloadInterceptor() {
94+
DownloadInterceptor downloadInterceptor = new DownloadInterceptor();
95+
return downloadInterceptor;
96+
}
5897

59-
@Autowired
60-
private DownloadInterceptor downloadInterceptor;
6198

6299
@PostConstruct
63100
public void init(){
@@ -71,25 +108,25 @@ public void addInterceptors(InterceptorRegistry registry) {
71108

72109
// 上传拦截器
73110
if (interceptorConfig.getUpload().isEnabled()){
74-
registry.addInterceptor(uploadInterceptor)
111+
registry.addInterceptor(uploadInterceptor())
75112
.addPathPatterns(interceptorConfig.getUpload().getIncludePaths());
76113
}
77114

78115
// 资源拦截器注册
79116
if (interceptorConfig.getResource().isEnabled()){
80-
registry.addInterceptor(resourceInterceptor)
117+
registry.addInterceptor(resourceInterceptor())
81118
.addPathPatterns(interceptorConfig.getResource().getIncludePaths());
82119
}
83120

84121
// 下载拦截器注册
85122
if (interceptorConfig.getDownload().isEnabled()){
86-
registry.addInterceptor(downloadInterceptor)
123+
registry.addInterceptor(downloadInterceptor())
87124
.addPathPatterns(interceptorConfig.getDownload().getIncludePaths());
88125
}
89126

90127
if (interceptorConfig.getPermission().isEnabled()){
91128
// 权限拦截器注册
92-
registry.addInterceptor(permissionInterceptor)
129+
registry.addInterceptor(permissionInterceptor())
93130
.addPathPatterns(interceptorConfig.getPermission().getIncludePaths())
94131
.excludePathPatterns(interceptorConfig.getPermission().getExcludePaths());
95132
}

src/main/java/io/geekidea/springbootplus/system/controller/VerificationCodeController.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import io.swagger.annotations.Api;
2525
import io.swagger.annotations.ApiOperation;
2626
import lombok.extern.slf4j.Slf4j;
27-
import org.apache.shiro.authz.annotation.RequiresPermissions;
2827
import org.springframework.beans.factory.annotation.Autowired;
2928
import org.springframework.data.redis.core.RedisTemplate;
3029
import org.springframework.http.MediaType;
@@ -60,15 +59,14 @@ public class VerificationCodeController {
6059
* 获取验证码
6160
*/
6261
@GetMapping("/getImage")
63-
@RequiresPermissions("verification:code")
6462
@ApiOperation(value = "获取验证码", notes = "获取验证码", response = ApiResult.class)
6563
public void getImage(HttpServletResponse response) throws Exception {
6664
VerificationCode verificationCode = new VerificationCode();
6765
BufferedImage image = verificationCode.getImage();
6866
String code = verificationCode.getText();
6967
String verifyToken = UUIDUtil.getUUID();
7068
// 缓存到Redis
71-
redisTemplate.opsForValue().set(String.format(CommonRedisKey.VERIFY_CODE, verifyToken), code, 10, TimeUnit.MINUTES);
69+
redisTemplate.opsForValue().set(String.format(CommonRedisKey.VERIFY_CODE, verifyToken), code, 5, TimeUnit.MINUTES);
7270
response.setHeader(CommonConstant.VERIFY_TOKEN, verifyToken);
7371
response.setContentType(MediaType.IMAGE_JPEG_VALUE);
7472
response.setHeader("Pragma", "No-cache");
@@ -82,7 +80,6 @@ public void getImage(HttpServletResponse response) throws Exception {
8280
* 获取图片Base64验证码
8381
*/
8482
@GetMapping("/getBase64Image")
85-
@RequiresPermissions("verification:code")
8683
@ResponseBody
8784
@ApiOperation(value = "获取图片Base64验证码", notes = "获取图片Base64验证码", response = ApiResult.class)
8885
public ApiResult getCode(HttpServletResponse response) throws Exception {
@@ -99,7 +96,7 @@ public ApiResult getCode(HttpServletResponse response) throws Exception {
9996
map.put(CommonConstant.IMAGE, CommonConstant.BASE64_PREFIX + base64);
10097
map.put(CommonConstant.VERIFY_TOKEN, verifyToken);
10198
// 缓存到Redis
102-
redisTemplate.opsForValue().set(String.format(CommonRedisKey.VERIFY_CODE, verifyToken), code, 10, TimeUnit.MINUTES);
99+
redisTemplate.opsForValue().set(String.format(CommonRedisKey.VERIFY_CODE, verifyToken), code, 5, TimeUnit.MINUTES);
103100
return ApiResult.ok(map);
104101
}
105102

1.12 KB
Binary file not shown.

src/main/resources/static/verifyCode.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,49 @@
2121
<title>验证码</title>
2222
</head>
2323
<body>
24-
<img src="data:image/png;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAmAG4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDh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6quQOAR/erCN1F2PNxCU8TFN20/r5naDYoAQzBto+UAHnvnnp+FSyOXRMysduQqODkD+XYdzSRGZ2YJD9oQDlGj3YyMDBxkdPUVFGqmMsN+QQCMcD0/Hr2/Gs9T0Ir3jfvp2t0c3UcctnJlGTG4nI9CMEH0Pr17VDaW2mvFNBY2UNqZACxSFVBIPBIHXBPQ0UVS1ZL0iUjrCbYhIhWVB/rQu4+3ce+c1Xnks9SgFtfWUV1AcZjkUbSAM4I54B5Hp7diipvdajaUdUVja6Yum/2c2nRHTgxItQF2ZyDnbjb1yeneojYaS9lHbnTLR7SAgpbtbIUVjnLAEEZyT27npRRUS0eg4t8rdyzbJFb2q29rFFBChO2OKNUC5zkADoCSeBxyarQ2dnbXkl7b2dtFdyZ8ydIVWR8tuJLAZJJ5zRRTTZPUW403RLyZ5bvS7S4mbCGWW0jdyAAMliMk4GAOwxzWnLYKtol7CcxHGUk6jnGOOoyT6UUVSbbswTKewPaTO8cbx8IysoIOc9jkY4P4cVSsNE0vTpWuoNMt1cELku74DA9AxOPunnrzjOCRRRTTdhShGUrtGi15BIEJMsTIRt2AnA9iW4x6CmTajLMqq53hehI5Hrzyf1oopp3dhRbR//Z" alt="">
24+
25+
<div>
26+
<p>方式一:获取图片</p>
27+
<img id="imageCode" src="http://localhost:8888/verificationCode/getImage" alt="" onclick="changeImage()">
28+
<p>verifyToken:查看Responses Headers</p>
29+
</div>
30+
31+
<hr>
32+
33+
<div>
34+
<p>方式二:获取base64图片编码</p>
35+
<img src="" alt="" id="base64ImageCode" onclick="changeBase64Image()">
36+
<p id="verifyToken"></p>
37+
</div>
38+
39+
<script type="text/javascript">
40+
function changeImage() {
41+
document.getElementById('imageCode').src = "http://localhost:8888/verificationCode/getImage?time=" + new Date().getTime();
42+
}
43+
44+
var url = "http://localhost:8888/verificationCode/getBase64Image";
45+
46+
function changeBase64Image() {
47+
var xmlHttp = null;
48+
if (window.XMLHttpRequest) {
49+
xmlHttp = new XMLHttpRequest();
50+
} else if (window.ActiveXObject) {
51+
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
52+
}
53+
xmlHttp.onreadystatechange = function () {
54+
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
55+
var result = JSON.parse(xmlHttp.responseText);
56+
document.getElementById('base64ImageCode').src = result.data.image;
57+
document.getElementById('verifyToken').innerText = "verifyToken:" + result.data.verifyToken;
58+
}
59+
};
60+
xmlHttp.open("GET", url, true);
61+
xmlHttp.send(null);
62+
}
63+
64+
changeBase64Image();
65+
66+
</script>
67+
2568
</body>
2669
</html>

0 commit comments

Comments
 (0)