mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
fix(启动报错): 启动报错问题修复
This commit is contained in:
@@ -10,7 +10,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ForestScan(basePackages = "com.fastbee")
|
|
||||||
public class FastBeeApplication
|
public class FastBeeApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|||||||
@@ -39,11 +39,12 @@ spring:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# redis 配置
|
# redis 配置
|
||||||
|
spring.data:
|
||||||
redis:
|
redis:
|
||||||
host: localhost # 地址
|
host: localhost # 地址
|
||||||
port: 6379 # 端口,默认为6379
|
port: 6379 # 端口,默认为6379
|
||||||
database: 15 # 数据库索引
|
database: 10 # 数据库索引
|
||||||
password: fastbee # 密码
|
password: fastbee # 密码
|
||||||
timeout: 10s # 连接超时时间
|
timeout: 10s # 连接超时时间
|
||||||
lettuce:
|
lettuce:
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ spring:
|
|||||||
# password: fastbee
|
# password: fastbee
|
||||||
|
|
||||||
# redis 配置
|
# redis 配置
|
||||||
|
spring.data:
|
||||||
redis:
|
redis:
|
||||||
host: 177.7.0.10 # 地址
|
host: 177.7.0.10 # 地址
|
||||||
port: 6379 # 端口,默认为6379
|
port: 6379 # 端口,默认为6379
|
||||||
|
|||||||
@@ -66,10 +66,11 @@ spring:
|
|||||||
|
|
||||||
|
|
||||||
# redis 配置
|
# redis 配置
|
||||||
|
spring.data:
|
||||||
redis:
|
redis:
|
||||||
host: 81.71.97.58 # 地址
|
host: 192.168.5.12 # 地址
|
||||||
port: 6379 # 端口,默认为6379
|
port: 6379 # 端口,默认为6379
|
||||||
database: 11 # 数据库索引
|
database: 11 # 数据库索引
|
||||||
password: fastbee # 密码
|
password: fastbee # 密码
|
||||||
timeout: 10s # 连接超时时间
|
timeout: 10s # 连接超时时间
|
||||||
lettuce:
|
lettuce:
|
||||||
@@ -85,7 +86,7 @@ sip:
|
|||||||
## 本地调试时,绑定网卡局域网IP,设备在同一局域网,设备接入IP填写绑定IP
|
## 本地调试时,绑定网卡局域网IP,设备在同一局域网,设备接入IP填写绑定IP
|
||||||
## 部署服务端时,默认绑定容器IP,设备接入IP填写服务器公网IP
|
## 部署服务端时,默认绑定容器IP,设备接入IP填写服务器公网IP
|
||||||
#ip: 177.7.0.13
|
#ip: 177.7.0.13
|
||||||
ip: 192.168.5.27
|
ip: 192.168.5.12
|
||||||
port: 5061 # SIP端口(保持默认)
|
port: 5061 # SIP端口(保持默认)
|
||||||
domain: 3402000000 # 由省级、市级、区级、基层编号组成
|
domain: 3402000000 # 由省级、市级、区级、基层编号组成
|
||||||
id: 34020000002000000001 # 同上,另外增加编号,(可保持默认)
|
id: 34020000002000000001 # 同上,另外增加编号,(可保持默认)
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ spring:
|
|||||||
# 环境配置,dev=开发环境,prod=生产环境
|
# 环境配置,dev=开发环境,prod=生产环境
|
||||||
profiles:
|
profiles:
|
||||||
active: prod # 环境配置,dev=开发环境,prod=生产环境
|
active: prod # 环境配置,dev=开发环境,prod=生产环境
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
|
mvc:
|
||||||
|
pathmatch:
|
||||||
|
matching-strategy: ant_path_matcher
|
||||||
# 资源信息
|
# 资源信息
|
||||||
messages:
|
messages:
|
||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
@@ -90,15 +95,11 @@ token:
|
|||||||
|
|
||||||
# mybatis-plus配置
|
# mybatis-plus配置
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
# 自定义配置 是否全局开启逻辑删除 关闭后 所有逻辑删除功能将失效
|
# 搜索指定包别名
|
||||||
enableLogicDelete: true
|
typeAliasesPackage: com.fastbee.**.domain
|
||||||
# 多包名使用 例如 org.dromara.**.mapper,org.xxx.**.mapper
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||||
mapperPackage: com.fastbee.**.mapper
|
|
||||||
# 对应的 XML 文件位置
|
|
||||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||||
configLocation: classpath:mybatis/mybatis-config.xml # 加载全局的配置文件
|
configLocation: classpath:mybatis/mybatis-config.xml # 加载全局的配置文件
|
||||||
# 实体扫描,多个package用逗号或者分号分隔
|
|
||||||
typeAliasesPackage: org.dromara.**.domain
|
|
||||||
global-config:
|
global-config:
|
||||||
dbConfig:
|
dbConfig:
|
||||||
# 主键类型
|
# 主键类型
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.fastbee.framework.config;
|
package com.fastbee.framework.config;
|
||||||
|
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -14,6 +16,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|||||||
@Configuration
|
@Configuration
|
||||||
// 表示通过aop框架暴露该代理对象,AopContext能够访问
|
// 表示通过aop框架暴露该代理对象,AopContext能够访问
|
||||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||||
|
@MapperScan("com.fastbee.**.mapper")
|
||||||
public class ApplicationConfig
|
public class ApplicationConfig
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -99,40 +99,38 @@ public class SecurityConfig
|
|||||||
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception
|
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception
|
||||||
{
|
{
|
||||||
return httpSecurity
|
return httpSecurity
|
||||||
// CSRF禁用,因为不使用session
|
// CSRF禁用,因为不使用session
|
||||||
.csrf(csrf -> csrf.disable())
|
.csrf(csrf -> csrf.disable())
|
||||||
// 禁用HTTP响应标头
|
// 禁用HTTP响应标头
|
||||||
.headers((headersCustomizer) -> {
|
.headers((headersCustomizer) -> {
|
||||||
headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin());
|
headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin());
|
||||||
})
|
})
|
||||||
// 认证失败处理类
|
// 认证失败处理类
|
||||||
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
|
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
|
||||||
// 基于token,所以不需要session
|
// 基于token,所以不需要session
|
||||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||||
// 注解标记允许匿名访问的url
|
// 注解标记允许匿名访问的url
|
||||||
.authorizeHttpRequests((requests) -> {
|
.authorizeHttpRequests((requests) -> {
|
||||||
permitAllUrl.getUrls().forEach(url -> requests.requestMatchers(url).permitAll());
|
permitAllUrl.getUrls().forEach(url -> requests.requestMatchers(url).permitAll());
|
||||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||||
// 静态资源,可匿名访问
|
requests.requestMatchers("/login", "/register", "/captchaImage","/iot/tool/register","/iot/tool/ntp","/iot/tool/download",
|
||||||
requests.requestMatchers("/login", "/register", "/captchaImage","/iot/tool/register","/iot/tool/ntp","/iot/tool/download",
|
"/iot/tool/mqtt/auth","/iot/tool/mqtt/authv5","/iot/tool/mqtt/webhook","/iot/tool/mqtt/webhookv5","/auth/**/**",
|
||||||
"/iot/tool/mqtt/auth","/iot/tool/mqtt/authv5","/iot/tool/mqtt/webhook","/iot/tool/mqtt/webhookv5","/auth/**/**",
|
"/wechat/mobileLogin", "/wechat/miniLogin", "/wechat/wxBind/callback").permitAll()
|
||||||
"/wechat/mobileLogin", "/wechat/miniLogin", "/wechat/wxBind/callback").permitAll()
|
.requestMatchers("/zlmhook/**","/goview/sys/login","/goview/project/getData").permitAll()
|
||||||
.requestMatchers("/zlmhook/**").permitAll()
|
// 静态资源,可匿名访问
|
||||||
.requestMatchers("/goview/sys/login","/goview/project/getData").permitAll()
|
.requestMatchers(HttpMethod.GET, "/", "/*.html", "/**.html", "/**.css", "/**.js", "/profile/**").permitAll()
|
||||||
// 静态资源,可匿名访问
|
.requestMatchers("/swagger-ui.html", "/v3/api-docs/**", "/swagger-ui/**", "/druid/**").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
// 除上面外的所有请求全部需要鉴权认证
|
||||||
.requestMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
.anyRequest().authenticated();
|
||||||
// 除上面外的所有请求全部需要鉴权认证
|
})
|
||||||
.anyRequest().authenticated();
|
// 添加Logout filter
|
||||||
})
|
.logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))
|
||||||
// 添加Logout filter
|
// 添加JWT filter
|
||||||
.logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))
|
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class)
|
||||||
// 添加JWT filter
|
// 添加CORS filter
|
||||||
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class)
|
.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class)
|
||||||
// 添加CORS filter
|
.addFilterBefore(corsFilter, LogoutFilter.class)
|
||||||
.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class)
|
.build();
|
||||||
.addFilterBefore(corsFilter, LogoutFilter.class)
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
import com.fastbee.framework.config.SqlFilterArgumentResolver;
|
import com.fastbee.framework.config.SqlFilterArgumentResolver;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
@@ -19,8 +17,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @author admin
|
* @author admin
|
||||||
*/
|
*/
|
||||||
@EnableTransactionManagement(proxyTargetClass = true)
|
@Configuration(proxyBeanMethods = false)
|
||||||
@MapperScan("${mybatis-plus.mapperPackage}")
|
|
||||||
public class MybatisPlusConfig implements WebMvcConfigurer {
|
public class MybatisPlusConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,8 +55,6 @@ public class MybatisPlusConfig implements WebMvcConfigurer {
|
|||||||
public MybatisPlusMetaObjectHandler mybatisPlusMetaObjectHandler() {
|
public MybatisPlusMetaObjectHandler mybatisPlusMetaObjectHandler() {
|
||||||
return new MybatisPlusMetaObjectHandler();
|
return new MybatisPlusMetaObjectHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 乐观锁插件
|
* 乐观锁插件
|
||||||
*/
|
*/
|
||||||
@@ -78,7 +73,4 @@ public class MybatisPlusConfig implements WebMvcConfigurer {
|
|||||||
interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor());
|
interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor());
|
||||||
return interceptor;
|
return interceptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.fastbee.iot.ruleEngine;
|
package com.fastbee.iot.ruleEngine;
|
||||||
|
|
||||||
import com.fastbee.common.core.redis.RedisCache;
|
import com.fastbee.common.core.redis.RedisCache;
|
||||||
import com.yomahub.liteflow.script.annotation.ScriptBean;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -12,7 +11,6 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ScriptBean("msgContextService")
|
|
||||||
public class MsgContextService {
|
public class MsgContextService {
|
||||||
|
|
||||||
private final RedisCache redisCache;
|
private final RedisCache redisCache;
|
||||||
@@ -24,6 +22,4 @@ public class MsgContextService {
|
|||||||
private void process(String serialNumber){
|
private void process(String serialNumber){
|
||||||
//执行的业务逻辑
|
//执行的业务逻辑
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user