mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-23 23:45:08 +08:00
多模块重构 12:修改项目名字,按照新的规则
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
|
||||
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
|
||||
public class YudaoServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(YudaoServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.server.framework.monitor.config;
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableAdminServer
|
||||
public class AdminServerConfiguration {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 使用 Spring Boot Admin 实现简单的监控平台
|
||||
*/
|
||||
package cn.iocoder.yudao.server.framework.monitor;
|
@ -0,0 +1 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Admin/?yudao>
|
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 属于整个 yudao-admin-server 的 framework 封装
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
package cn.iocoder.yudao.server.framework;
|
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.server.framework.security;
|
||||
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Resource
|
||||
private WebProperties webProperties;
|
||||
|
||||
@Value("${spring.boot.admin.context-path:''}")
|
||||
private String adminSeverContextPath;
|
||||
|
||||
@Bean
|
||||
public Customizer<ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry> authorizeRequestsCustomizer() {
|
||||
return registry -> {
|
||||
// 验证码的接口
|
||||
registry.antMatchers(buildAdminApi("/system/captcha/**")).anonymous();
|
||||
// 获得租户编号的接口
|
||||
registry.antMatchers(buildAdminApi("/system/tenant/get-id-by-name")).anonymous();
|
||||
// Spring Boot Admin Server 的安全配置
|
||||
registry.antMatchers(adminSeverContextPath).anonymous()
|
||||
.antMatchers(adminSeverContextPath + "/**").anonymous();
|
||||
// 短信回调 API
|
||||
registry.antMatchers(buildAdminApi("/system/sms/callback/**")).anonymous();
|
||||
|
||||
// 设置 App API 无需认证
|
||||
registry.antMatchers(buildAppApi("/**")).permitAll();
|
||||
};
|
||||
}
|
||||
|
||||
private String buildAdminApi(String url) {
|
||||
// TODO 芋艿:多模块
|
||||
return webProperties.getAdminApi().getPrefix() + url;
|
||||
}
|
||||
|
||||
private String buildAppApi(String url) {
|
||||
// TODO 芋艿:多模块
|
||||
return webProperties.getAppApi().getPrefix() + url;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user