修正prd

This commit is contained in:
2025-12-02 14:43:35 +08:00
parent 73a349f98a
commit a853c16854
4 changed files with 59 additions and 39 deletions

View File

@@ -2,7 +2,7 @@
VITE_APP_TITLE=医院信息管理系统
# 生产环境配置
VITE_APP_ENV= 'production'
VITE_APP_ENV= 'prd'
# OpenHIS管理系统/生产环境
VITE_APP_BASE_API= '/prd-api'

View File

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

View File

@@ -7,8 +7,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build:prd": "vite build --mode production",
"build:prod": "vite build --mode production",
"build:prd": "vite build --mode prd",
"build:prod": "vite build --mode prod",
"build:stage": "vite build --mode staging",
"build:test": "vite build --mode test",
"build:dev": "vite build --mode dev",

View File

@@ -3,14 +3,14 @@
* @Date: 2025-04-09 09:33:35
* @Description:
*/
import {defineConfig, loadEnv} from 'vite';
import { defineConfig, loadEnv } from 'vite';
import path from 'path';
import createVitePlugins from './vite/plugins';
// https://vitejs.dev/config/
export default defineConfig (({mode, command}) => {
const env = loadEnv (mode, process.cwd ());
const {VITE_APP_ENV} = env;
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
const { VITE_APP_ENV } = env;
return {
// define: {
// // enable hydration mismatch details in production build
@@ -19,15 +19,15 @@ export default defineConfig (({mode, command}) => {
// 部署生产环境和开发环境下的URL。
// 默认情况下vite 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.openHIS.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.openhis.vip/admin/,则设置 baseUrl 为 /admin/。
base: VITE_APP_ENV === 'production' ? '/' : '/',
plugins: createVitePlugins (env, command === 'build'),
base: VITE_APP_ENV === 'prd' ? '/' : '/',
plugins: createVitePlugins(env, command === 'build'),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
alias: {
// 设置路径
'~': path.resolve (__dirname, './'),
'~': path.resolve(__dirname, './'),
// 设置别名
'@': path.resolve (__dirname, './src'),
'@': path.resolve(__dirname, './src'),
},
// https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
@@ -40,28 +40,24 @@ export default defineConfig (({mode, command}) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://localhost:18080/openhis',
// target: 'http://192.168.31.30:18080/openhis', // zwh
// target: 'http://192.168.31.50:18080/openhis', // wh
// target: 'http://192.168.31.190:18080/openhis', // yangmo
// target: 'http://60.188.247.175:18080/openhis',// 公网
changeOrigin: true,
rewrite: p => p.replace (/^\/dev-api/, ''),
},
'/ybplugin':{
target: 'http://localhost:5000',
changeOrigin: true,
rewrite: p => p.replace (/^\/ybplugin/, ''),
},
'/prod-api': {
target: 'http://localhost:18080/openhis',
changeOrigin: true,
rewrite: p => p.replace (/^\/prod-api/, ''),
},
'/test-api': {
target: 'http://localhost:18080/openhis',
changeOrigin: true,
rewrite: p => p.replace (/^\/test-api/, ''),
rewrite: p => p.replace(/^\/dev-api/, ''),
},
'/ybplugin': {
target: 'http://localhost:5000',
changeOrigin: true,
rewrite: p => p.replace(/^\/ybplugin/, ''),
},
'/prd-api': {
target: 'http://localhost:18082/openhis',
changeOrigin: true,
rewrite: p => p.replace(/^\/prd-api/, ''),
},
'/test-api': {
target: 'http://localhost:18081/openhis',
changeOrigin: true,
rewrite: p => p.replace(/^\/test-api/, ''),
}
},
},
@@ -74,7 +70,7 @@ export default defineConfig (({mode, command}) => {
AtRule: {
charset: atRule => {
if (atRule.name === 'charset') {
atRule.remove ();
atRule.remove();
}
},
},