diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..121fb2a8 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,76 @@ +# OpenHIS — AI 编码助手 指南 + +目的:帮助自动化/AI 编码代理快速上手本仓库,包含架构要点、关键文件、常用构建/运行命令以及项目约定。请只按照仓库内真实可见的内容提出修改建议或补充说明。 + +- **代码组织**: 本项目是一个 Java 后端(多模块 Maven)+ Vue3 前端(Vite)的大型应用。 + - 后端主模块目录:`openhis-server-new/`(顶层为 `pom`,包含多个子模块)。关键子模块示例:`openhis-application`, `openhis-domain`, `openhis-common`, `core-*` 系列。 + - 前端目录:`openhis-ui-vue3/`(Vite + Vue 3,使用 Pinia、Element Plus 等)。 + +- **大局观(Big Picture)**: 后端以 Spring Boot(Java 17)实现,使用多模块 Maven 管理公共库与业务模块;前端由单独仓库目录通过 Vite 构建并以环境变量(`VITE_APP_BASE_API`)与后端交互。后端扫描 `com.core` 与 `com.openhis` 包(见 `OpenHisApplication.java`),启动类位于:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。 + +- **运行/构建(Windows PowerShell 示例)**: + - 构建后端(从仓库根执行): + +```powershell +cd openhis-server-new +mvn clean package -DskipTests +``` + + - 仅运行后端模块(开发时常用): + +```powershell +cd openhis-server-new/openhis-application +mvn spring-boot:run +# 或在 IDE 中运行 `com.openhis.OpenHisApplication` 的 main() +``` + + - 前端启动与构建(需要 Node.js v16.x,仓库 README 建议 v16.15): + +```powershell +cd openhis-ui-vue3 +npm install +npm run dev # 本地开发(热重载) +npm run build:prod # 生产构建 +``` + +- **环境与配置**: + - 后端配置:`openhis-server-new/openhis-application/src/main/resources/application.yml`(数据库、端口、profile 等)。README 还提及 `application-druid.yml`(若存在请优先查看)。 + - 前端配置:多个 `.env.*` 文件(例如 `.env.development`, `.env.staging`, `.env.production`),关键变量:`VITE_APP_BASE_API`(例如 `/dev-api`),前端通过 `import.meta.env.VITE_APP_BASE_API` 拼接后端 URL(见 `src/utils/request.js`、多个视图与组件)。 + +- **重要约定 / 模式**: + - 后端采用 Java 17、Spring Boot 2.5.x 家族,父 POM在 `openhis-server-new/pom.xml` 定义。常用依赖版本在该 POM 的 `` 中集中维护。 + - 模块间以 Maven 模块依赖与 `com.core` / `com.openhis` 包名分层(见 `pom.xml` 的 `` 与 `dependencyManagement`)。 + - 前端通过 Vite 插件配置(`openhis-ui-vue3/vite/plugins`)管理 svg、自动导入等。UI 框架为 Element Plus,状态管理为 Pinia。 + +- **集成点 & 外部依赖**: + - 数据库:PostgreSQL(README 建议 v16.2),仓库根含一个大型初始化 SQL:`数据库初始话脚本(请使用navicat16版本导入).sql`,用于初始化表与演示数据。 + - 缓存/会话:Redis(需自行配置)。 + - 其他:Flowable(工作流),Druid(连接池监控),第三方服务通过特定配置类(例如 `YbServiceConfig` 在 `OpenHisApplication` 中启用)。 + +- **调试与常见位置**: + - 启动类:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。 + - 全局配置:`openhis-server-new/openhis-application/src/main/resources/`(`application.yml`、profile 文件等)。 + - 前端入口:`openhis-ui-vue3/src/main.js`、路由在 `openhis-ui-vue3/src/router/index.js`。 + - API 文档与监控路径(通常由后端暴露并被前端访问): + - Swagger UI: `/swagger-ui/index.html`(前端视图在 `src/views/tool/swagger/index.vue`)。 + - Druid: `/druid/login.html`(见前端相关视图引用)。 + +- **为 AI 代理的具体建议(如何安全、有效地修改代码)**: + - 修改后端时:优先在子模块(例如 `openhis-application`)本地运行 `mvn spring-boot:run` 验证启动与基础 API;大量改动前先执行 `mvn -T1C -DskipTests clean package` 在 CI 环境上验证构建(本地机器也可用)。 + - 修改前端时:检查/调整对应 `.env.*` 文件中的 `VITE_APP_BASE_API`,使用 `npm run dev` 本地联调后端接口(可通过代理或将 `VITE_APP_BASE_API` 指向后端地址)。 + - 修改数据库结构或 seed:请参考仓库根的 SQL 初始化脚本,任何 DDL/数据变更需同步该脚本并通知数据库管理员/运维。 + +- **举例(常见任务示例)**: + - 本地联调前端 + 后端(PowerShell): + +```powershell +# 启动后端 +cd openhis-server-new/openhis-application +mvn spring-boot:run + +# 启动前端(另开终端) +cd openhis-ui-vue3 +npm run dev +``` + +如需我把这些内容合并为更短或更详细的版本,或把其中某部分(例如后端模块依赖关系图、关键 Java 包说明)展开,请告诉我要增强哪一节。 diff --git a/openhis-server-new/openhis-application/src/main/resources/application-local.yml b/openhis-server-new/openhis-application/src/main/resources/application-dev.yml similarity index 94% rename from openhis-server-new/openhis-application/src/main/resources/application-local.yml rename to openhis-server-new/openhis-application/src/main/resources/application-dev.yml index 25e5ee40..fe94317c 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application-local.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application-dev.yml @@ -59,6 +59,8 @@ spring: wall: config: multi-statement-allow: true + + # redis 配置 redis: # 地址 @@ -84,4 +86,10 @@ spring: # 文言 messages: basename: i18n/general_message/messages - encoding: utf-8 \ No newline at end of file + encoding: utf-8 +server: + # 服务器的HTTP端口,默认为18080 + port: 18080 + servlet: + # 应用的访问路径 + context-path: /openhis \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/application-prod.yml b/openhis-server-new/openhis-application/src/main/resources/application-prd.yml similarity index 91% rename from openhis-server-new/openhis-application/src/main/resources/application-prod.yml rename to openhis-server-new/openhis-application/src/main/resources/application-prd.yml index 6e96ab2e..32581f8b 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application-prod.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application-prd.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=public&characterEncoding=UTF-8&client_encoding=UTF-8 + url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=hisprd&characterEncoding=UTF-8&client_encoding=UTF-8 username: postgresql password: Jchl1528 # 从库数据源 @@ -84,4 +84,10 @@ spring: # 文言 messages: basename: i18n/general_message/messages - encoding: utf-8 \ No newline at end of file + encoding: utf-8 +server: + # 服务器的HTTP端口,默认为18080 + port: 18082 + servlet: + # 应用的访问路径 + context-path: /openhis \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/application-test.yml b/openhis-server-new/openhis-application/src/main/resources/application-test.yml new file mode 100644 index 00000000..b4401162 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/application-test.yml @@ -0,0 +1,93 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: org.postgresql.Driver + druid: + # 主库数据源 + master: + url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=histest&characterEncoding=UTF-8&client_encoding=UTF-8 + username: postgresql + password: Jchl1528 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 # FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: openhis + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true + # redis 配置 + redis: + # 地址 + host: 192.168.110.252 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 1 + # 密码 + password: Jchl1528 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + # 文言 + messages: + basename: i18n/general_message/messages + encoding: utf-8 +server: + # 服务器的HTTP端口,默认为18080 + port: 18081 + servlet: + # 应用的访问路径 + context-path: /openhis \ No newline at end of file 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 4fd26eb3..a14166e9 100644 --- a/openhis-server-new/openhis-application/src/main/resources/application.yml +++ b/openhis-server-new/openhis-application/src/main/resources/application.yml @@ -15,11 +15,6 @@ core: # 开发环境配置 server: - # 服务器的HTTP端口,默认为18080 - port: 18080 - servlet: - # 应用的访问路径 - context-path: /openhis tomcat: # tomcat的URI编码 uri-encoding: UTF-8 @@ -54,7 +49,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: local #(本地)local (生产)prod (农大) + active: dev # 文件上传 servlet: multipart: diff --git a/openhis-ui-vue3/.env.development b/openhis-ui-vue3/.env.dev similarity index 69% rename from openhis-ui-vue3/.env.development rename to openhis-ui-vue3/.env.dev index ed0aec06..681c2ba8 100644 --- a/openhis-ui-vue3/.env.development +++ b/openhis-ui-vue3/.env.dev @@ -2,7 +2,10 @@ VITE_APP_TITLE = 医院信息管理系统 # 开发环境配置 -VITE_APP_ENV = 'development' +VITE_APP_ENV = 'dev' # OpenHIS管理系统/开发环境 VITE_APP_BASE_API = '/dev-api' + +# 租户ID配置 +VITE_APP_TENANT_ID = '1' diff --git a/openhis-ui-vue3/.env.production b/openhis-ui-vue3/.env.prod similarity index 59% rename from openhis-ui-vue3/.env.production rename to openhis-ui-vue3/.env.prod index 2892b974..19763de5 100644 --- a/openhis-ui-vue3/.env.production +++ b/openhis-ui-vue3/.env.prod @@ -2,10 +2,13 @@ VITE_APP_TITLE=医院信息管理系统 # 生产环境配置 -VITE_APP_ENV=production +VITE_APP_ENV= 'prod' # OpenHIS管理系统/生产环境 -VITE_APP_BASE_API=/prod-api +VITE_APP_BASE_API= '/prd-api' + +# 租户ID配置 +VITE_APP_TENANT_ID= '1' # 是否在打包时开启压缩,支持 gzip 和 brotli -VITE_BUILD_COMPRESS=gzip \ No newline at end of file +VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/openhis-ui-vue3/.env.spug b/openhis-ui-vue3/.env.spug index d333e353..07d67125 100644 --- a/openhis-ui-vue3/.env.spug +++ b/openhis-ui-vue3/.env.spug @@ -13,6 +13,9 @@ VITE_UPLOAD_TYPE=server # OpenHIS管理系统/SPUG环境 VITE_APP_BASE_API = '/admin-api' +# 租户ID配置 +VITE_APP_TENANT_ID=1 + # 是否删除debugger VITE_DROP_DEBUGGER=false diff --git a/openhis-ui-vue3/.env.staging b/openhis-ui-vue3/.env.staging index 7d0b0249..ec9adfb1 100644 --- a/openhis-ui-vue3/.env.staging +++ b/openhis-ui-vue3/.env.staging @@ -7,5 +7,8 @@ VITE_APP_ENV = 'staging' # OpenHIS管理系统/生产环境 VITE_APP_BASE_API = '/stage-api' +# 租户ID配置 +VITE_APP_TENANT_ID=1 + # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/openhis-ui-vue3/.env.test b/openhis-ui-vue3/.env.test new file mode 100644 index 00000000..a1d43452 --- /dev/null +++ b/openhis-ui-vue3/.env.test @@ -0,0 +1,12 @@ +# 页面标题 +VITE_APP_TITLE = 医院信息管理系统 + +# 测试环境配置 +VITE_APP_ENV = 'test' + +# OpenHIS管理系统/测试环境 + +VITE_APP_BASE_API = '/test-api' + +# 租户ID配置 +VITE_APP_TENANT_ID = '1' diff --git a/openhis-ui-vue3/package-lock.json b/openhis-ui-vue3/package-lock.json index feed423d..ad03573e 100644 --- a/openhis-ui-vue3/package-lock.json +++ b/openhis-ui-vue3/package-lock.json @@ -910,6 +910,7 @@ "version": "4.17.12", "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz", "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "peer": true, "dependencies": { "@types/lodash": "*" } @@ -919,6 +920,7 @@ "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.10.tgz", "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, + "peer": true, "dependencies": { "undici-types": "~6.20.0" } @@ -2324,6 +2326,7 @@ "version": "3.0.0", "resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "peer": true, "engines": { "node": ">=12" } @@ -4215,7 +4218,8 @@ "node_modules/jquery": { "version": "3.7.1", "resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "peer": true }, "node_modules/js-base64": { "version": "2.6.4", @@ -4345,12 +4349,14 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "peer": true }, "node_modules/lodash-es": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "peer": true }, "node_modules/lodash-unified": { "version": "1.0.3", @@ -5079,6 +5085,7 @@ "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -5480,6 +5487,7 @@ "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.35.0.tgz", "integrity": "sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==", "dev": true, + "peer": true, "dependencies": { "@types/estree": "1.0.6" }, @@ -5644,6 +5652,7 @@ "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.5.tgz", "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", "dev": true, + "peer": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -5666,6 +5675,7 @@ "version": "2.0.3", "resolved": "https://registry.npmmirror.com/segmentit/-/segmentit-2.0.3.tgz", "integrity": "sha512-7mn2XL3OdTUQ+AhHz7SbgyxLTaQRzTWQNVwiK+UlTO8aePGbSwvKUzTwE4238+OUY9MoR6ksAg35zl8sfTunQQ==", + "peer": true, "dependencies": { "preval.macro": "^4.0.0" } @@ -7023,6 +7033,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.4.tgz", "integrity": "sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==", "dev": true, + "peer": true, "dependencies": { "esbuild": "^0.19.3", "postcss": "^8.4.31", @@ -7116,6 +7127,7 @@ "version": "3.5.13", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.13", "@vue/compiler-sfc": "3.5.13", @@ -7894,6 +7906,7 @@ "version": "4.17.12", "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz", "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "peer": true, "requires": { "@types/lodash": "*" } @@ -7903,6 +7916,7 @@ "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.13.10.tgz", "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "dev": true, + "peer": true, "requires": { "undici-types": "~6.20.0" } @@ -8957,7 +8971,8 @@ "d3-selection": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz", - "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==" + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "peer": true }, "d3-shape": { "version": "3.2.0", @@ -10316,7 +10331,8 @@ "jquery": { "version": "3.7.1", "resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "peer": true }, "js-base64": { "version": "2.6.4", @@ -10424,12 +10440,14 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "peer": true }, "lodash-es": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "peer": true }, "lodash-unified": { "version": "1.0.3", @@ -10934,6 +10952,7 @@ "version": "8.5.3", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.3.tgz", "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "peer": true, "requires": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -11238,6 +11257,7 @@ "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.35.0.tgz", "integrity": "sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==", "dev": true, + "peer": true, "requires": { "@rollup/rollup-android-arm-eabi": "4.35.0", "@rollup/rollup-android-arm64": "4.35.0", @@ -11351,6 +11371,7 @@ "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.5.tgz", "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", "dev": true, + "peer": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -11367,6 +11388,7 @@ "version": "2.0.3", "resolved": "https://registry.npmmirror.com/segmentit/-/segmentit-2.0.3.tgz", "integrity": "sha512-7mn2XL3OdTUQ+AhHz7SbgyxLTaQRzTWQNVwiK+UlTO8aePGbSwvKUzTwE4238+OUY9MoR6ksAg35zl8sfTunQQ==", + "peer": true, "requires": { "preval.macro": "^4.0.0" } @@ -12422,6 +12444,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.4.tgz", "integrity": "sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==", "dev": true, + "peer": true, "requires": { "esbuild": "^0.19.3", "fsevents": "~2.3.3", @@ -12468,6 +12491,7 @@ "version": "3.5.13", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "peer": true, "requires": { "@vue/compiler-dom": "3.5.13", "@vue/compiler-sfc": "3.5.13", diff --git a/openhis-ui-vue3/package.json b/openhis-ui-vue3/package.json index 8249129b..63a66cc8 100644 --- a/openhis-ui-vue3/package.json +++ b/openhis-ui-vue3/package.json @@ -7,8 +7,10 @@ "type": "module", "scripts": { "dev": "vite", - "build:prod": "vite build --mode production", + "build:prod": "vite build --mode prod", "build:stage": "vite build --mode staging", + "build:test": "vite build --mode test", + "build:dev": "vite build --mode dev", "preview": "vite preview", "build:spug": "vite build --mode spug" }, diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index 1a5a2c37..8f10b6e5 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -12,7 +12,8 @@ let downloadLoadingInstance; export let isRelogin = { show: false }; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' -axios.defaults.headers['X-Tenant-ID'] = '1' +// 从环境变量读取租户ID,如果没有则使用默认值'1' +axios.defaults.headers['X-Tenant-ID'] = import.meta.env.VITE_APP_TENANT_ID || '1' axios.defaults.headers['Request-Method-Name'] = 'login' // 创建axios实例 const service = axios.create({ diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue index a4cfc820..b721af68 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/patientAddDialog.vue @@ -1,16 +1,16 @@