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 @@