From db25e10b83d0f35c958b2255855b8bd0b15998f7 Mon Sep 17 00:00:00 2001 From: dataprince Date: Thu, 17 Aug 2023 11:18:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90SpringBoot-Admin=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- ruoyi-admin/pom.xml | 6 ++ .../src/main/resources/application-dev.yml | 20 ++++++ .../src/main/resources/application-prod.yml | 21 ++++++ ruoyi-common/ruoyi-common-bom/pom.xml | 2 +- .../common/core/utils/poi/ExcelUtil.java | 33 ++++----- ruoyi-extra/pom.xml | 4 +- ruoyi-extra/ruoyi-monitor/Dockerfile | 13 ++++ ruoyi-extra/ruoyi-monitor/pom.xml | 67 +++++++++++++++++++ .../admin/RuoYiMonitorAdminApplication.java | 21 ++++++ .../admin/config/AdminServerConfig.java | 31 +++++++++ .../config/SpringBootAdminSecurityConfig.java | 56 ++++++++++++++++ .../admin/notifier/CustomNotifier.java | 40 +++++++++++ .../src/main/resources/application.yml | 45 +++++++++++++ .../main/resources/logback-ruoyi-monitor.xml | 34 ++++++++++ ruoyi-ui/.env.development | 3 + ruoyi-ui/.env.production | 3 + ruoyi-ui/src/components/iFrame/index.vue | 8 +-- ruoyi-ui/src/views/index.vue | 16 +++-- ruoyi-ui/src/views/monitor/admin/index.vue | 22 ++++++ sql/update.sql | 3 + 21 files changed, 418 insertions(+), 32 deletions(-) create mode 100644 ruoyi-extra/ruoyi-monitor/Dockerfile create mode 100644 ruoyi-extra/ruoyi-monitor/pom.xml create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/RuoYiMonitorAdminApplication.java create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/AdminServerConfig.java create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/SpringBootAdminSecurityConfig.java create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/notifier/CustomNotifier.java create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/resources/application.yml create mode 100644 ruoyi-extra/ruoyi-monitor/src/main/resources/logback-ruoyi-monitor.xml create mode 100644 ruoyi-ui/src/views/monitor/admin/index.vue diff --git a/pom.xml b/pom.xml index ee0d724..8426a7d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ Ruoyi-Flex管理系统 - 4.1.4 + 4.1.5-SNAPSHOT UTF-8 UTF-8 17 diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index fa9e812..0a46e5d 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -67,6 +67,12 @@ ruoyi-demo + + + de.codecentric + spring-boot-admin-starter-client + + diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 7132031..0f50a5b 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -105,4 +105,24 @@ redisson: # 发布和订阅连接池大小 subscriptionConnectionPoolSize: 50 +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/ruoyi-monitor.log +--- # 监控中心配置 +spring.boot.admin.client: + # 增加客户端开关 + enabled: true + url: http://localhost:9090/admin + instance: + service-host-type: IP + username: ruoyi + password: 123456 diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 5f6feb2..d6e1ef0 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -107,4 +107,25 @@ redisson: # 发布和订阅连接池大小 subscriptionConnectionPoolSize: 50 +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/ruoyi-monitor.log + +--- # 监控中心配置 +spring.boot.admin.client: + # 增加客户端开关 + enabled: true + url: http://localhost:9090/admin + instance: + service-host-type: IP + username: ruoyi + password: 123456 diff --git a/ruoyi-common/ruoyi-common-bom/pom.xml b/ruoyi-common/ruoyi-common-bom/pom.xml index 16586e6..f06a25c 100644 --- a/ruoyi-common/ruoyi-common-bom/pom.xml +++ b/ruoyi-common/ruoyi-common-bom/pom.xml @@ -14,7 +14,7 @@ - 4.1.4 + 4.1.5-SNAPSHOT diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 498d2c4..2055164 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -98,7 +98,7 @@ public class ExcelUtil { /** * 用于dictType属性数据存储,避免重复查缓存 */ - public Map sysDictMap = new HashMap(); + public Map sysDictMap = new HashMap<>(); /** * Excel sheet最大行数,默认65536 @@ -178,7 +178,7 @@ public class ExcelUtil { /** * 统计列表 */ - private Map statistics = new HashMap(); + private Map statistics = new HashMap<>(); /** * 数字格式 @@ -203,7 +203,6 @@ public class ExcelUtil { * 隐藏Excel中列属性 * * @param fields 列属性名 示例[单个"name"/多个"id","name"] - * @throws Exception */ public void hideColumn(String... fields) { this.excludeFields = fields; @@ -211,7 +210,7 @@ public class ExcelUtil { public void init(List list, String sheetName, String title, Excel.Type type) { if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); } this.list = list; this.sheetName = sheetName; @@ -300,7 +299,7 @@ public class ExcelUtil { public List importExcel(String sheetName, InputStream is, int titleNum) throws Exception { this.type = Excel.Type.IMPORT; this.wb = WorkbookFactory.create(is); - List list = new ArrayList(); + List list = new ArrayList<>(); // 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0); if (sheet == null) { @@ -318,7 +317,7 @@ public class ExcelUtil { if (rows > 0) { // 定义一个map用于存放excel列的序号和field. - Map cellMap = new HashMap(); + Map cellMap = new HashMap<>(); // 获取表头 Row heard = sheet.getRow(titleNum); for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) { @@ -332,7 +331,7 @@ public class ExcelUtil { } // 有数据时才处理 得到类的所有field. List fields = this.getFields(); - Map fieldsMap = new HashMap(); + Map fieldsMap = new HashMap<>(); for (Object[] objects : fields) { Excel attr = (Excel) objects[1]; Integer column = cellMap.get(attr.name()); @@ -447,7 +446,6 @@ public class ExcelUtil { * @param response 返回数据 * @param list 导出数据集合 * @param sheetName 工作表的名称 - * @return 结果 */ public void exportExcel(HttpServletResponse response, List list, String sheetName) { exportExcel(response, list, sheetName, StringUtils.EMPTY); @@ -460,7 +458,6 @@ public class ExcelUtil { * @param list 导出数据集合 * @param sheetName 工作表的名称 * @param title 标题 - * @return 结果 */ public void exportExcel(HttpServletResponse response, List list, String sheetName, String title) { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); @@ -495,7 +492,6 @@ public class ExcelUtil { * 对list数据源将其里面的数据导入到excel表单 * * @param sheetName 工作表的名称 - * @return 结果 */ public void importTemplateExcel(HttpServletResponse response, String sheetName) { importTemplateExcel(response, sheetName, StringUtils.EMPTY); @@ -506,7 +502,6 @@ public class ExcelUtil { * * @param sheetName 工作表的名称 * @param title 标题 - * @return 结果 */ public void importTemplateExcel(HttpServletResponse response, String sheetName, String title) { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); @@ -518,7 +513,6 @@ public class ExcelUtil { /** * 对list数据源将其里面的数据导入到excel表单 * - * @return 结果 */ public void exportExcel(HttpServletResponse response) { try { @@ -650,7 +644,7 @@ public class ExcelUtil { */ private Map createStyles(Workbook wb) { // 写入各条记录,每条记录对应excel表中的一行 - Map styles = new HashMap(); + Map styles = new HashMap<>(); CellStyle style = wb.createCellStyle(); style.setAlignment(HorizontalAlignment.CENTER); style.setVerticalAlignment(VerticalAlignment.CENTER); @@ -701,7 +695,7 @@ public class ExcelUtil { * @return 自定义样式列表 */ private Map annotationHeaderStyles(Workbook wb, Map styles) { - Map headerStyles = new HashMap(); + Map headerStyles = new HashMap<>(); for (Object[] os : fields) { Excel excel = (Excel) os[1]; String key = StringUtils.format("header_{}_{}", excel.headerColor(), excel.headerBackgroundColor()); @@ -731,7 +725,7 @@ public class ExcelUtil { * @return 自定义样式列表 */ private Map annotationDataStyles(Workbook wb) { - Map styles = new HashMap(); + Map styles = new HashMap<>(); for (Object[] os : fields) { Excel excel = (Excel) os[1]; String key = StringUtils.format("data_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor()); @@ -840,7 +834,7 @@ public class ExcelUtil { * 创建表格样式 */ public void setDataValidation(Excel attr, Row row, int column) { - if (attr.name().indexOf("注:") >= 0) { + if (attr.name().contains("注:")) { sheet.setColumnWidth(column, 6000); } else { // 设置列宽 @@ -1153,7 +1147,6 @@ public class ExcelUtil { * @param field 字段 * @param excel 注解 * @return 最终的属性值 - * @throws Exception */ private Object getTargetValue(T vo, Field field, Excel excel) throws Exception { Object o = field.get(vo); @@ -1202,7 +1195,7 @@ public class ExcelUtil { * 获取字段注解信息 */ public List getFields() { - List fields = new ArrayList(); + List fields = new ArrayList<>(); List tempFields = new ArrayList<>(); tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); @@ -1345,7 +1338,7 @@ public class ExcelUtil { * @return Map key:图片单元格索引(1_1)String,value:图片流PictureData */ public static Map getSheetPictures03(HSSFSheet sheet, HSSFWorkbook workbook) { - Map sheetIndexPicMap = new HashMap(); + Map sheetIndexPicMap = new HashMap<>(); List pictures = workbook.getAllPictures(); if (!pictures.isEmpty()) { for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren()) { @@ -1372,7 +1365,7 @@ public class ExcelUtil { * @return Map key:图片单元格索引(1_1)String,value:图片流PictureData */ public static Map getSheetPictures07(XSSFSheet sheet, XSSFWorkbook workbook) { - Map sheetIndexPicMap = new HashMap(); + Map sheetIndexPicMap = new HashMap<>(); for (POIXMLDocumentPart dr : sheet.getRelations()) { if (dr instanceof XSSFDrawing) { XSSFDrawing drawing = (XSSFDrawing) dr; diff --git a/ruoyi-extra/pom.xml b/ruoyi-extra/pom.xml index c37b8e9..71ae759 100644 --- a/ruoyi-extra/pom.xml +++ b/ruoyi-extra/pom.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - ruoyi-flex com.ruoyi + ruoyi-flex ${revision} 4.0.0 @@ -13,7 +13,7 @@ ruoyi-extra - + ruoyi-monitor diff --git a/ruoyi-extra/ruoyi-monitor/Dockerfile b/ruoyi-extra/ruoyi-monitor/Dockerfile new file mode 100644 index 0000000..c506f1b --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/Dockerfile @@ -0,0 +1,13 @@ +FROM findepi/graalvm:java17-native + +MAINTAINER Lion Li + +RUN mkdir -p /ruoyi/monitor/logs + +WORKDIR /ruoyi/monitor + +EXPOSE 9090 + +ADD ./target/ruoyi-monitor-admin.jar ./app.jar + +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] diff --git a/ruoyi-extra/ruoyi-monitor/pom.xml b/ruoyi-extra/ruoyi-monitor/pom.xml new file mode 100644 index 0000000..8039e3c --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/pom.xml @@ -0,0 +1,67 @@ + + + + com.ruoyi + ruoyi-extra + ${revision} + + 4.0.0 + jar + ruoyi-monitor + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-security + + + + + de.codecentric + spring-boot-admin-starter-server + + + + + de.codecentric + spring-boot-admin-starter-client + + + + org.projectlombok + lombok + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + + + + repackage + + + + + + + + diff --git a/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/RuoYiMonitorAdminApplication.java b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/RuoYiMonitorAdminApplication.java new file mode 100644 index 0000000..83a26d9 --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/RuoYiMonitorAdminApplication.java @@ -0,0 +1,21 @@ +package com.ruoyi.monitor.admin; + +import de.codecentric.boot.admin.server.config.EnableAdminServer; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * SpringBoot Admin 监控启动程序 + * + * @author dataprince数据小王子 + */ +@EnableAdminServer +@SpringBootApplication +public class RuoYiMonitorAdminApplication { + + public static void main(String[] args) { + SpringApplication.run(RuoYiMonitorAdminApplication.class, args); + System.out.println("SpringBoot Admin 监控程序启动成功!"); + } + +} diff --git a/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/AdminServerConfig.java b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/AdminServerConfig.java new file mode 100644 index 0000000..e2a9c51 --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/AdminServerConfig.java @@ -0,0 +1,31 @@ +package com.ruoyi.monitor.admin.config; + +import de.codecentric.boot.admin.server.config.EnableAdminServer; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; +import org.springframework.boot.task.TaskExecutorBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; + +/** + * springboot-admin server配置类 + * + * @author Lion Li + */ +@Configuration +@EnableAdminServer +public class AdminServerConfig { + + @Lazy + @Bean(name = TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME) + @ConditionalOnMissingBean(Executor.class) + public ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) { + return builder.build(); + } + + +} diff --git a/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/SpringBootAdminSecurityConfig.java b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/SpringBootAdminSecurityConfig.java new file mode 100644 index 0000000..2885038 --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/config/SpringBootAdminSecurityConfig.java @@ -0,0 +1,56 @@ +package com.ruoyi.monitor.admin.config; + +import de.codecentric.boot.admin.server.config.AdminServerProperties; +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.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +/** + * SpringBootAdmin 监控安全配置 + * + * @author Lion Li + */ +@EnableWebSecurity +@Configuration +public class SpringBootAdminSecurityConfig { + + private final String adminContextPath; + + public SpringBootAdminSecurityConfig(AdminServerProperties adminServerProperties) { + this.adminContextPath = adminServerProperties.getContextPath(); + } + + @Bean + public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception { + SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); + successHandler.setTargetUrlParameter("redirectTo"); + successHandler.setDefaultTargetUrl(adminContextPath + "/"); + + return httpSecurity + .headers((header) -> + header.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable)) + .authorizeHttpRequests((authorize) -> + authorize.requestMatchers( + new AntPathRequestMatcher(adminContextPath + "/assets/**"), + new AntPathRequestMatcher(adminContextPath + "/login"), + new AntPathRequestMatcher("/actuator"), + new AntPathRequestMatcher("/actuator/**") + ).permitAll() + .anyRequest().authenticated()) + .formLogin((formLogin) -> + formLogin.loginPage(adminContextPath + "/login").successHandler(successHandler)) + .logout((logout) -> + logout.logoutUrl(adminContextPath + "/logout")) + .httpBasic(Customizer.withDefaults()) + .csrf(AbstractHttpConfigurer::disable) + .build(); + } + +} diff --git a/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/notifier/CustomNotifier.java b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/notifier/CustomNotifier.java new file mode 100644 index 0000000..4d0a7a0 --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/java/com/ruoyi/monitor/admin/notifier/CustomNotifier.java @@ -0,0 +1,40 @@ +package com.ruoyi.monitor.admin.notifier; + +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; +import de.codecentric.boot.admin.server.notify.AbstractEventNotifier; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import reactor.core.publisher.Mono; + +/** + * 自定义事件通知处理 + * + * @author Lion Li + */ +@Slf4j +@Component +public class CustomNotifier extends AbstractEventNotifier { + + protected CustomNotifier(InstanceRepository repository) { + super(repository); + } + + @Override + @SuppressWarnings("all") + protected Mono doNotify(InstanceEvent event, Instance instance) { + return Mono.fromRunnable(() -> { + // 实例状态改变事件 + if (event instanceof InstanceStatusChangedEvent) { + String registName = instance.getRegistration().getName(); + String instanceId = event.getInstance().getValue(); + String status = ((InstanceStatusChangedEvent) event).getStatusInfo().getStatus(); + log.info("Instance Status Change: [{}],[{}],[{}]", registName, instanceId, status); + } + + }); + } + +} diff --git a/ruoyi-extra/ruoyi-monitor/src/main/resources/application.yml b/ruoyi-extra/ruoyi-monitor/src/main/resources/application.yml new file mode 100644 index 0000000..5fa3a1b --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/resources/application.yml @@ -0,0 +1,45 @@ +server: + port: 9090 +spring: + application: + name: Ruoyi-Monitor-AdminServer + profiles: + active: @profiles.active@ + +logging: + config: classpath:logback-ruoyi-monitor.xml + +--- # 监控中心服务端配置 +spring: + security: + user: + name: ruoyi + password: 123456 + boot: + admin: + ui: + title: RuoYi-Flex服务监控中心 + context-path: /admin + +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/ruoyi-monitor.log + +--- # 监控配置 +spring.boot.admin.client: + # 增加客户端开关 + enabled: true + # 设置 Spring Boot Admin Server 地址 + url: http://localhost:9090/admin + instance: + service-host-type: IP + username: ruoyi + password: 123456 diff --git a/ruoyi-extra/ruoyi-monitor/src/main/resources/logback-ruoyi-monitor.xml b/ruoyi-extra/ruoyi-monitor/src/main/resources/logback-ruoyi-monitor.xml new file mode 100644 index 0000000..e778966 --- /dev/null +++ b/ruoyi-extra/ruoyi-monitor/src/main/resources/logback-ruoyi-monitor.xml @@ -0,0 +1,34 @@ + + + + logback + + + + + + + ${console.log.pattern} + utf-8 + + + + + ${log.path}.log + + ${log.path}.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index d657a2b..2f2426c 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -7,5 +7,8 @@ ENV = 'development' # 若依管理系统/开发环境 VUE_APP_BASE_API = '/dev-api' +# 监控地址 +VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications' + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index b61fa4a..e9abac0 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -6,3 +6,6 @@ ENV = 'production' # 若依管理系统/生产环境 VUE_APP_BASE_API = '/prod-api' + +# 监控地址 +VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications' diff --git a/ruoyi-ui/src/components/iFrame/index.vue b/ruoyi-ui/src/components/iFrame/index.vue index 426857f..c7ba3a6 100644 --- a/ruoyi-ui/src/components/iFrame/index.vue +++ b/ruoyi-ui/src/components/iFrame/index.vue @@ -1,7 +1,7 @@