opt:管理后台系统优化。
This commit is contained in:
@@ -13,10 +13,10 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
@Configuration
|
||||
public class RedisListenerConfig {
|
||||
|
||||
// @Bean
|
||||
// RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory) {
|
||||
// RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||
// container.setConnectionFactory(connectionFactory);
|
||||
// return container;
|
||||
// }
|
||||
@Bean
|
||||
RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory) {
|
||||
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||
container.setConnectionFactory(connectionFactory);
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
package org.nl.sys.modular.backgroundmanagement.common.security.satoken;
|
||||
|
||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
|
||||
import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: sa-token的配置路由拦截
|
||||
* @Date: 2022-09-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
|
||||
// Sa-Token 整合 jwt (Simple 简单模式)
|
||||
@Bean
|
||||
public StpLogic getStpLogicJwt() {
|
||||
return new StpLogicJwtForSimple();
|
||||
}
|
||||
}
|
||||
//package org.nl.sys.modular.backgroundmanagement.common.security.satoken;
|
||||
//
|
||||
//import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
//import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
|
||||
//import cn.dev33.satoken.stp.StpLogic;
|
||||
//import cn.dev33.satoken.stp.StpUtil;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
//
|
||||
///**
|
||||
// * @author: lyd
|
||||
// * @description: sa-token的配置路由拦截
|
||||
// * @Date: 2022-09-20
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Configuration
|
||||
//public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
//
|
||||
// // Sa-Token 整合 jwt (Simple 简单模式)
|
||||
// @Bean
|
||||
// public StpLogic getStpLogicJwt() {
|
||||
// return new StpLogicJwtForSimple();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
package org.nl.sys.modular.backgroundmanagement.common.security.service;
|
||||
//*
|
||||
// * Copyright 2019-2020 the original author or authors.
|
||||
// *
|
||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// * you may not use this file except in compliance with the License.
|
||||
// * You may obtain a copy of the License at
|
||||
// *
|
||||
// * http://www.apache.org/licenses/LICENSE-2.0
|
||||
// *
|
||||
// * Unless required by applicable law or agreed to in writing, software
|
||||
// * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// * See the License for the specific language governing permissions and
|
||||
// * limitations under the License.
|
||||
//package org.nl.sys.modular.backgroundmanagement.common.security.service;
|
||||
////*
|
||||
//// * Copyright 2019-2020 the original author or authors.
|
||||
//// *
|
||||
//// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
//// * you may not use this file except in compliance with the License.
|
||||
//// * You may obtain a copy of the License at
|
||||
//// *
|
||||
//// * http://www.apache.org/licenses/LICENSE-2.0
|
||||
//// *
|
||||
//// * Unless required by applicable law or agreed to in writing, software
|
||||
//// * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
//// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//// * See the License for the specific language governing permissions and
|
||||
//// * limitations under the License.
|
||||
//// */
|
||||
//
|
||||
//import cn.hutool.core.util.StrUtil;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * @author: liaojinlong
|
||||
// * @date: 2020/6/11 18:01
|
||||
// * @apiNote: 用于清理 用户登录信息缓存,为防止Spring循环依赖与安全考虑 ,单独构成工具类
|
||||
// */
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author: liaojinlong
|
||||
* @date: 2020/6/11 18:01
|
||||
* @apiNote: 用于清理 用户登录信息缓存,为防止Spring循环依赖与安全考虑 ,单独构成工具类
|
||||
*/
|
||||
@Component
|
||||
public class UserCacheClean {
|
||||
|
||||
/**
|
||||
* 清理特定用户缓存信息<br>
|
||||
* 用户信息变更时
|
||||
*
|
||||
* @param userName /
|
||||
*/
|
||||
public void cleanUserCache(String userName) {
|
||||
if (StrUtil.isNotEmpty(userName)) {
|
||||
// UserDetailsServiceImpl.userDtoCache.remove(userName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理所有用户的缓存信息<br>
|
||||
* ,如发生角色授权信息变化,可以简便的全部失效缓存
|
||||
*/
|
||||
// public void cleanAll() {
|
||||
// UserDetailsServiceImpl.userDtoCache.clear();
|
||||
//@Component
|
||||
//public class UserCacheClean {
|
||||
//
|
||||
// /**
|
||||
// * 清理特定用户缓存信息<br>
|
||||
// * 用户信息变更时
|
||||
// *
|
||||
// * @param userName /
|
||||
// */
|
||||
// public void cleanUserCache(String userName) {
|
||||
// if (StrUtil.isNotEmpty(userName)) {
|
||||
//// UserDetailsServiceImpl.userDtoCache.remove(userName);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 清理所有用户的缓存信息<br>
|
||||
// * ,如发生角色授权信息变化,可以简便的全部失效缓存
|
||||
// */
|
||||
//// public void cleanAll() {
|
||||
//// UserDetailsServiceImpl.userDtoCache.clear();
|
||||
//// }
|
||||
//}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class QRCodeController {
|
||||
|
||||
@PostMapping("/generateQRCode")
|
||||
@Log("生成二维码")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> generateQRCode(@Validated @RequestBody GenerateQRCodeParam generateQRCodeParam){
|
||||
return new ResponseEntity<>(qrCodeService.generateQRCode(generateQRCodeParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user