日常事务-处分管理 添加印章图片签名验证功能

- 实现了图片签名工具类ImageSignUtils,支持生成和验证带时间戳的签名URL
- 配置SecurityConfig允许匿名访问签名的印章图片URL,但Base64接口需认证
- 创建StampController提供受保护的印章图片访问接口
- 将应用默认文件路径配置改为Windows环境路径
- 支持通过签名URL安全访问印章图片资源
This commit is contained in:
2026-03-20 11:48:37 +08:00
parent e43637894b
commit f99b4621d2
4 changed files with 183 additions and 1 deletions

View File

@@ -140,6 +140,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "doc.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 签名的印章图片URL可匿名访问签名验证
.antMatchers(HttpMethod.GET, "/common/stamp/**").permitAll()
// Base64接口需要认证
.antMatchers(HttpMethod.GET, "/common/stamp/base64/**").authenticated()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
@@ -172,6 +176,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "doc.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 签名的印章图片URL可匿名访问签名验证
.antMatchers(HttpMethod.GET, "/common/stamp/**").permitAll()
// Base64接口需要认证
.antMatchers(HttpMethod.GET, "/common/stamp/base64/**").authenticated()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()