From 4312c0c557af9b407eccef5107a388c9d01b622a Mon Sep 17 00:00:00 2001 From: yangkexiang <1677036288@qq.com> Date: Wed, 29 Apr 2026 16:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8E=E7=AB=AF=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysVersionController.java | 30 +++++++++++ .../core/framework/config/SecurityConfig.java | 3 ++ .../src/main/resources/application.yml | 2 +- openhis-ui-vue3/src/api/system/info.js | 10 ++++ openhis-ui-vue3/src/views/login.vue | 50 ++++++++++++++++--- 5 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysVersionController.java create mode 100644 openhis-ui-vue3/src/api/system/info.js diff --git a/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysVersionController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysVersionController.java new file mode 100644 index 00000000..332d51ca --- /dev/null +++ b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysVersionController.java @@ -0,0 +1,30 @@ +package com.core.web.controller.system; + +import com.core.common.config.CoreConfig; +import com.core.common.core.domain.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 系统版本信息 + */ +@RestController +@RequestMapping("/system") +public class SysVersionController { + + @Autowired + private CoreConfig coreConfig; + + /** + * 获取后端版本号 + */ + @GetMapping("/version") + public AjaxResult getVersion() { + AjaxResult ajax = AjaxResult.success(); + ajax.put("backendVersion", coreConfig.getVersion()); + return ajax; + } +} + diff --git a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java index cce46c80..ad2204ba 100644 --- a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java @@ -107,6 +107,9 @@ public class SecurityConfig { .permitAll() .antMatchers("/patientmanage/information/**") .permitAll() + // 登录页展示用的系统版本信息,允许匿名访问 + .antMatchers("/system/version") + .permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); }) diff --git a/openhis-server-new/openhis-application/src/main/resources/application.yml b/openhis-server-new/openhis-application/src/main/resources/application.yml index ebe0302d..e6243809 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application.yml @@ -3,7 +3,7 @@ core: # 名称 name: HEALTHLINK-HIS # 版本 - version: 0.0.1 + version: ${CORE_VERSION:0.0.1} # 版权年份 copyrightYear: 2025 # 文件路径 diff --git a/openhis-ui-vue3/src/api/system/info.js b/openhis-ui-vue3/src/api/system/info.js new file mode 100644 index 00000000..7415ca16 --- /dev/null +++ b/openhis-ui-vue3/src/api/system/info.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +export function getSystemVersion(options = {}) { + return request({ + url: '/system/version', + method: 'get', + ...options + }) +} + diff --git a/openhis-ui-vue3/src/views/login.vue b/openhis-ui-vue3/src/views/login.vue index ffdf988e..ef2babb0 100644 --- a/openhis-ui-vue3/src/views/login.vue +++ b/openhis-ui-vue3/src/views/login.vue @@ -100,12 +100,16 @@ @@ -126,7 +130,7 @@