mirror of
				https://github.com/yzcheng90/X-SpringBoot
				synced 2025-11-04 13:45:42 +08:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			d931939f0b
			...
			ee869cf263
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					ee869cf263 | ||
| 
						 | 
					9eebbb579f | ||
| 
						 | 
					5f586f7f7b | 
@@ -42,7 +42,7 @@ import java.util.List;
 | 
			
		||||
public class SecurityConfigurer {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private RedisTemplate<Object, Object> redisTemplate;
 | 
			
		||||
    private RedisTemplate<String, Object> redisTemplate;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private AuthIgnoreConfig authIgnoreConfig;
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
 | 
			
		||||
public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private RedisTemplate<Object,Object> redisTemplate;
 | 
			
		||||
    private RedisTemplate<String,Object> redisTemplate;
 | 
			
		||||
 | 
			
		||||
    @SneakyThrows
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ import java.util.Date;
 | 
			
		||||
public class CustomLogoutSuccessHandler implements LogoutSuccessHandler {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private RedisTemplate<Object,Object> redisTemplate;
 | 
			
		||||
    private RedisTemplate<String,Object> redisTemplate;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
 | 
			
		||||
public class RedisLock {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private RedisTemplate<Object, Object> redisTemplate;
 | 
			
		||||
    private RedisTemplate<String, Object> redisTemplate;
 | 
			
		||||
    /*** 释放锁脚本,原子操作,lua脚本*/
 | 
			
		||||
    private static final String UNLOCK_LUA;
 | 
			
		||||
    /*** 默认过期时间(30ms)*/
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +1,17 @@
 | 
			
		||||
package com.suke.czx.config;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import com.suke.czx.common.utils.Constant;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.cache.annotation.EnableCaching;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
import org.springframework.context.annotation.Primary;
 | 
			
		||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
 | 
			
		||||
import org.springframework.data.redis.cache.RedisCacheManager;
 | 
			
		||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
 | 
			
		||||
import org.springframework.data.redis.core.*;
 | 
			
		||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
 | 
			
		||||
import org.springframework.data.redis.serializer.RedisSerializer;
 | 
			
		||||
import com.suke.czx.common.utils.Constant;
 | 
			
		||||
 | 
			
		||||
import java.time.Duration;
 | 
			
		||||
 | 
			
		||||
@@ -22,7 +21,6 @@ import java.time.Duration;
 | 
			
		||||
public class RedisConfig {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    @Primary
 | 
			
		||||
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
 | 
			
		||||
        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
 | 
			
		||||
        redisTemplate.setKeySerializer(RedisSerializer.string());
 | 
			
		||||
 
 | 
			
		||||
@@ -31,10 +31,10 @@ import java.io.IOException;
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class AuthenticationTokenFilter extends OncePerRequestFilter {
 | 
			
		||||
 | 
			
		||||
    private final RedisTemplate<Object,Object> redisTemplate;
 | 
			
		||||
    private final RedisTemplate<String,Object> redisTemplate;
 | 
			
		||||
    private final AuthIgnoreConfig authIgnoreConfig;
 | 
			
		||||
 | 
			
		||||
    public AuthenticationTokenFilter(AuthIgnoreConfig authIgnoreConfig,RedisTemplate<Object,Object> template) {
 | 
			
		||||
    public AuthenticationTokenFilter(AuthIgnoreConfig authIgnoreConfig,RedisTemplate<String,Object> template) {
 | 
			
		||||
        this.redisTemplate = template;
 | 
			
		||||
        this.authIgnoreConfig = authIgnoreConfig;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -22,10 +22,10 @@ import org.springframework.web.filter.OncePerRequestFilter;
 | 
			
		||||
public class ValidateCodeFilter extends OncePerRequestFilter {
 | 
			
		||||
 | 
			
		||||
    private final AntPathMatcher pathMatcher = new AntPathMatcher();
 | 
			
		||||
    private final RedisTemplate<Object,Object> redisTemplate;
 | 
			
		||||
    private final RedisTemplate<String,Object> redisTemplate;
 | 
			
		||||
    private final AuthenticationFailureHandler authenticationFailureHandler;
 | 
			
		||||
 | 
			
		||||
    public ValidateCodeFilter(RedisTemplate<Object,Object> redisTemplate, AuthenticationFailureHandler authenticationFailureHandler){
 | 
			
		||||
    public ValidateCodeFilter(RedisTemplate<String,Object> redisTemplate, AuthenticationFailureHandler authenticationFailureHandler){
 | 
			
		||||
        this.redisTemplate = redisTemplate;
 | 
			
		||||
        this.authenticationFailureHandler = authenticationFailureHandler;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
 | 
			
		||||
public class SysLoginController extends AbstractController {
 | 
			
		||||
 | 
			
		||||
    private final Producer producer;
 | 
			
		||||
    private final RedisTemplate<Object,Object> redisTemplate;
 | 
			
		||||
    private final RedisTemplate<String,Object> redisTemplate;
 | 
			
		||||
 | 
			
		||||
    @AuthIgnore
 | 
			
		||||
    @RequestMapping(value = "/", method = RequestMethod.GET)
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,6 @@ public class ${className}Controller extends AbstractController {
 | 
			
		||||
    /**
 | 
			
		||||
     * 列表
 | 
			
		||||
     */
 | 
			
		||||
    @Operation(summary = "${comments}列表")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    @ResourceAuth(value = "${comments}列表", module = "${comments}")
 | 
			
		||||
    public R list(@RequestParam Map<String, Object> params) {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,15 +5,9 @@
 | 
			
		||||
        <el-input size="default" v-model="state.tableData.param.keyword" placeholder="请输入名称"
 | 
			
		||||
                  style="max-width: 180px"></el-input>
 | 
			
		||||
        <el-button size="default" type="primary" class="ml10" @click="fetchData()">
 | 
			
		||||
          <el-icon>
 | 
			
		||||
            <ele-Search/>
 | 
			
		||||
          </el-icon>
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button size="default" type="success" class="ml10" @click="onOpenAddOrEdit('add')">
 | 
			
		||||
          <el-icon>
 | 
			
		||||
            <ele-FolderAdd/>
 | 
			
		||||
          </el-icon>
 | 
			
		||||
          新增
 | 
			
		||||
        </el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -27,8 +21,8 @@
 | 
			
		||||
          #end
 | 
			
		||||
        <el-table-column label="操作" width="200">
 | 
			
		||||
          <template #default="scope">
 | 
			
		||||
            <el-button size="small" text type="primary" @click="onOpenAddOrEdit('edit', scope.row)">修改</el-button>
 | 
			
		||||
            <el-button size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
 | 
			
		||||
            <el-button size="small" type="text" @click="onOpenAddOrEdit('edit', scope.row)">修改</el-button>
 | 
			
		||||
            <el-button size="small" type="text" @click="onRowDel(scope.row)">删除</el-button>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user