feat(打包): 项目打包

master
tangqk 2025-08-13 16:42:09 +08:00
parent f107d97cf8
commit 5483503885
35 changed files with 54 additions and 483 deletions

View File

@ -20,6 +20,18 @@ importers:
antd:
specifier: ^5.4.0
version: 5.26.7(date-fns@2.30.0)(moment@2.30.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
dayjs:
specifier: ^1.11.13
version: 1.11.13
moment:
specifier: ^2.30.1
version: 2.30.1
spark-md5:
specifier: ^3.0.2
version: 3.0.2
uuid:
specifier: ^11.1.0
version: 11.1.0
devDependencies:
'@types/react':
specifier: ^18.0.33
@ -27,6 +39,9 @@ importers:
'@types/react-dom':
specifier: ^18.0.11
version: 18.3.7(@types/react@18.3.23)
'@types/spark-md5':
specifier: ^3.0.5
version: 3.0.5
lint-staged:
specifier: ^13.2.0
version: 13.3.0
@ -1344,6 +1359,9 @@ packages:
'@types/semver@7.7.0':
resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==}
'@types/spark-md5@3.0.5':
resolution: {integrity: sha512-lWf05dnD42DLVKQJZrDHtWFidcLrHuip01CtnC2/S6AMhX4t9ZlEUj4iuRlAnts0PQk7KESOqKxeGE/b6sIPGg==}
'@types/stylis@4.2.7':
resolution: {integrity: sha512-VgDNokpBoKF+wrdvhAAfS55OMQpL6QRglwTwNC3kIgBrzZxA4WsFj+2eLfEA/uMUDzBcEhYmjSbwQakn/i3ajA==}
@ -5535,6 +5553,9 @@ packages:
resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==}
engines: {node: '>= 12'}
spark-md5@3.0.2:
resolution: {integrity: sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==}
spdx-correct@3.2.0:
resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
@ -5988,6 +6009,10 @@ packages:
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
engines: {node: '>= 0.4.0'}
uuid@11.1.0:
resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==}
hasBin: true
v8-compile-cache@2.4.0:
resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==}
@ -7704,7 +7729,7 @@ snapshots:
'@types/history@5.0.0':
dependencies:
history: 4.10.1
history: 5.3.0
'@types/hoist-non-react-statics@3.3.7(@types/react@18.3.23)':
dependencies:
@ -7761,7 +7786,7 @@ snapshots:
'@types/history': 4.7.11
'@types/react': 18.3.23
'@types/react-router': 5.1.20
redux: 3.7.2
redux: 4.2.1
'@types/react-router@5.1.20':
dependencies:
@ -7777,6 +7802,8 @@ snapshots:
'@types/semver@7.7.0': {}
'@types/spark-md5@3.0.5': {}
'@types/stylis@4.2.7': {}
'@types/use-sync-external-store@0.0.3': {}
@ -13053,6 +13080,8 @@ snapshots:
source-map@0.7.6: {}
spark-md5@3.0.2: {}
spdx-correct@3.2.0:
dependencies:
spdx-expression-parse: 3.0.1
@ -13611,6 +13640,8 @@ snapshots:
utils-merge@1.0.1: {}
uuid@11.1.0: {}
v8-compile-cache@2.4.0: {}
validate-npm-package-license@3.0.4:

View File

View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="/umi.css">
</head>
<body>
<div id="root"></div>
<script src="/umi.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.main-layout{min-height:100vh}.main-sider .logo{height:64px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;font-weight:700;border-bottom:1px solid #303030}.main-header{background:#fff;padding:0 24px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 8px #0000001a}.main-header .trigger{font-size:18px;color:#666}.main-header .trigger:hover{color:#1890ff}.main-header .header-right{display:flex;align-items:center;gap:16px}.main-header .header-right .welcome-text{color:#666;font-size:14px}.main-header .header-right .user-avatar{cursor:pointer;background:#1890ff}.main-header .header-right .user-avatar:hover{opacity:.8}.main-content{background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;min-height:calc(100vh - 112px)}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.main-layout{min-height:100vh}.main-sider .logo{height:64px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;font-weight:700;border-bottom:1px solid #303030}.main-header{background:#fff;padding:0 24px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 8px #0000001a}.main-header .trigger{font-size:18px;color:#666}.main-header .trigger:hover{color:#1890ff}.main-header .header-right{display:flex;align-items:center;gap:16px}.main-header .header-right .welcome-text{color:#666;font-size:14px}.main-header .header-right .user-avatar{cursor:pointer;background:#1890ff}.main-header .header-right .user-avatar:hover{opacity:.8}.main-content{background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;min-height:calc(100vh - 112px)}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.page-header h2{margin:0;font-size:24px;font-weight:600;color:#333}.image-list{height:100%;display:flex;flex-direction:column;padding:16px;box-sizing:border-box}.image-list .search-box{margin-bottom:16px;display:flex;justify-content:space-between}.image-list .search-box .search-input{display:flex;gap:8px;align-items:center}.image-list .images-list-container,.image-list .images-list-container .images-list-table{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.image-list .images-list-container .images-list-table .ant-table-wrapper{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading,.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table,.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-header{flex-shrink:0}.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-body{flex:1 1;overflow:auto!important}.image-list .images-list-container .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-pagination{flex-shrink:0;position:relative;z-index:1}.image-list .image-detail .detail-item{margin-bottom:16px}.image-list .image-detail .detail-item label{font-weight:600;color:#333;display:inline-block;width:100px}.image-list .image-detail .detail-item span{color:#666}.image-list .image-detail .detail-item p{margin:8px 0 0 100px;color:#666;line-height:1.6}.profile-page .profile-content .profile-header{display:flex;align-items:center;gap:16px;margin-bottom:16px}.profile-page .profile-content .profile-header .profile-info h3{margin:0 0 4px;font-size:20px;font-weight:600;color:#333}.profile-page .profile-content .profile-header .profile-info p{margin:0;color:#666;font-size:14px}.profile-page .profile-content .quick-actions{display:flex;gap:12px;flex-wrap:wrap}@media (max-width: 768px){.page-header{flex-direction:column;align-items:flex-start;gap:12px}.profile-content .profile-header{flex-direction:column;text-align:center}.profile-content .quick-actions{justify-content:center}}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.login-container{display:flex;min-height:100vh;background:linear-gradient(135deg,#1890ff,#722ed1)}.login-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba%28255,255,255,0.1%29" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url%28%23grid%29"/></svg>');opacity:.3}.login-left{flex:1 1;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.brand-content{text-align:center;color:#fff;z-index:1;position:relative;max-width:400px;padding:40px}.brand-logo{margin-bottom:30px}.brand-logo .logo-icon{font-size:60px;margin-bottom:20px;display:block;color:#ffffffe6}.brand-logo .brand-title{font-size:36px;font-weight:700;margin:0;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,.3)}.brand-subtitle{font-size:20px;font-weight:500;margin-bottom:30px;color:#ffffffe6}.brand-description{margin-bottom:40px}.brand-description p{font-size:16px;line-height:1.6;margin:8px 0;color:#fffc}.brand-features{display:flex;justify-content:space-around;flex-wrap:wrap;gap:20px}.brand-features .feature-item{display:flex;flex-direction:column;align-items:center;gap:8px}.brand-features .feature-item .feature-icon{font-size:24px}.brand-features .feature-item span:last-child{font-size:14px;color:#fffc}.login-right{flex:1 1;display:flex;align-items:center;justify-content:center;padding:40px}.login-form-container{width:100%;max-width:400px}.login-header{text-align:center;margin-bottom:40px}.login-header .login-title{font-size:28px;font-weight:600;color:#fff;margin:0 0 8px}.login-header .login-subtitle{font-size:16px;color:#fff;margin:0}.login-form .ant-form-item{margin-bottom:24px}.login-input{height:48px;border-radius:8px;border:1px solid #d9d9d9;font-size:16px}.login-input:hover,.login-input:focus,.login-input.ant-input-focused{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.login-input .input-icon{color:#bfbfbf;font-size:16px}.login-button{height:48px;border-radius:8px;font-size:16px;font-weight:500;background:linear-gradient(135deg,#1890ff,#722ed1);border:none;margin-top:8px}.login-button:hover{background:linear-gradient(135deg,#40a9ff,#9254de);transform:translateY(-1px);box-shadow:0 4px 12px #1890ff4d}.login-button:active{transform:translateY(0)}.login-tips{text-align:center;margin-top:24px;padding:16px;background-color:#f6f8fa;border-radius:8px;border:1px solid #e8e8e8}.login-tips p{margin:0;color:#595959;font-size:14px}.login-footer{text-align:center;margin-top:40px}.login-footer p{color:#8c8c8c;font-size:12px;margin:0}@media (max-width: 768px){.login-container{flex-direction:column}.login-left{flex:none;height:200px;padding:20px}.brand-content{padding:20px}.brand-logo .logo-icon{font-size:40px}.brand-title{font-size:24px}.brand-subtitle{font-size:16px}.brand-description p{font-size:14px}.login-right{flex:1 1;padding:20px}}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.page-header h2{margin:0;font-size:24px;font-weight:600;color:#333}.image-list .image-detail .detail-item{margin-bottom:16px}.image-list .image-detail .detail-item label{font-weight:600;color:#333;display:inline-block;width:100px}.image-list .image-detail .detail-item span{color:#666}.image-list .image-detail .detail-item p{margin:8px 0 0 100px;color:#666;line-height:1.6}.profile-page .profile-content .profile-header{display:flex;align-items:center;gap:16px;margin-bottom:16px}.profile-page .profile-content .profile-header .profile-info h3{margin:0 0 4px;font-size:20px;font-weight:600;color:#333}.profile-page .profile-content .profile-header .profile-info p{margin:0;color:#666;font-size:14px}.profile-page .profile-content .quick-actions{display:flex;gap:12px;flex-wrap:wrap}@media (max-width: 768px){.page-header{flex-direction:column;align-items:flex-start;gap:12px}.profile-content .profile-header{flex-direction:column;text-align:center}.profile-content .quick-actions{justify-content:center}}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.user_content___NVrSf{display:flex;width:100%;height:100%;background-color:#f7f8fa}.user_content___NVrSf .left_content___k_v4w{width:400px;height:100%;padding:8px;background-color:#fff}.user_content___NVrSf .left_content___k_v4w .search___mN53j{width:100%;height:70px}.user_content___NVrSf .left_content___k_v4w .tree_box___HLlDc{width:100%;height:calc(100% - 70px);overflow:auto;padding-top:10px}.user_content___NVrSf .right_content___NTJte{width:calc(100% - 400px);height:100%;padding-left:10px}.user_content___NVrSf .right_content___NTJte .teble_content___yJ7lW{width:100%;height:100%;background-color:#fff;padding:8px}.user_content___NVrSf .right_content___NTJte .teble_content___yJ7lW .teble_box___YE1no{display:flex;flex-direction:column;width:100%;height:calc(100% - 50px);overflow:hidden}.user_content___NVrSf :where(.css-dev-only-do-not-override-1vjf2v5).ant-pagination .ant-pagination-total-text{position:absolute;left:5px}.user_content___NVrSf .images-list-table{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.user_content___NVrSf .images-list-table .ant-table-wrapper{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading,.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table,.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-header{flex-shrink:0}.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-body{flex:1 1;overflow:auto!important}.user_content___NVrSf .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-pagination{flex-shrink:0;position:relative;z-index:1}.content_wrap___IzyVq{width:100%;height:100%}.content_wrap___IzyVq .search_wrap___vyvi6{display:flex;justify-content:flex-end;margin-bottom:5px;padding-bottom:5px}.content_wrap___IzyVq :where(.css-dev-only-do-not-override-1vjf2v5).ant-pagination .ant-pagination-total-text{position:absolute;left:5px}.model_content___MsF87{width:100%;height:650px}.content_wrap___t2j0e{width:100%;height:100%}.content_wrap___t2j0e .search_wrap___MKaSL{display:flex;justify-content:flex-end;margin-bottom:5px;padding-bottom:5px}.content_wrap___t2j0e :where(.css-dev-only-do-not-override-1vjf2v5).ant-pagination .ant-pagination-total-text{position:absolute;left:5px}.model_content___DaYce{width:100%;height:650px}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.user_content___n6dbD{display:flex;width:100%;height:100%;background-color:#f7f8fa}.user_content___n6dbD .left_content___CkwkA{width:400px;height:100%;padding:8px;background-color:#fff}.user_content___n6dbD .left_content___CkwkA .search___HoQbf{width:100%;height:70px}.user_content___n6dbD .left_content___CkwkA .tree_box___x56Nb{width:100%;height:calc(100% - 70px);overflow:auto;padding-top:10px}.user_content___n6dbD .right_content___JtLdU{width:calc(100% - 400px);height:100%;padding-left:10px}.user_content___n6dbD .right_content___JtLdU .teble_content___kLIoM{width:100%;height:100%;background-color:#fff;padding:8px}.user_content___n6dbD .right_content___JtLdU .teble_content___kLIoM .teble_box___Gk7lM{display:flex;flex-direction:column;width:100%;height:calc(100% - 50px);overflow:hidden}.user_content___n6dbD :where(.css-dev-only-do-not-override-1vjf2v5).ant-pagination .ant-pagination-total-text{position:absolute;left:5px}.user_content___n6dbD .images-list-table{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.user_content___n6dbD .images-list-table .ant-table-wrapper{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading,.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container{flex:1 1;display:flex;flex-direction:column;overflow:hidden}.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table,.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container{display:flex;flex-direction:column;flex:1 1;overflow:hidden}.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-header{flex-shrink:0}.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-container .ant-table-body{flex:1 1;overflow:auto!important}.user_content___n6dbD .images-list-table .ant-table-wrapper .ant-spin-nested-loading .ant-spin-container .ant-table .ant-table-pagination{flex-shrink:0;position:relative;z-index:1}

View File

@ -1 +0,0 @@
html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@ const express = require('express');
const path = require('path');
const compression = require('compression');
const helmet = require('helmet');
const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
const PORT = process.env.PORT || 3000;
@ -14,6 +15,25 @@ app.use(helmet({
// 压缩中间件
app.use(compression());
// API 代理中间件 - 将 /api/* 请求代理到 10.100.5.86:8113
app.use('/api', createProxyMiddleware({
target: 'http://10.100.51.86:8113',
changeOrigin: true,
pathRewrite: {
'^/api': '/api', // 保持 /api 路径
},
onProxyReq: (proxyReq, req, res) => {
console.log(`🔄 代理请求: ${req.method} ${req.url} -> http://10.100.51.86:8113${req.url}`);
},
onProxyRes: (proxyRes, req, res) => {
console.log(`✅ 代理响应: ${req.method} ${req.url} - 状态码: ${proxyRes.statusCode}`);
},
onError: (err, req, res) => {
console.error(`❌ 代理错误: ${req.method} ${req.url}`, err.message);
res.status(500).json({ error: '代理请求失败', message: err.message });
}
}));
// 静态文件服务
app.use(express.static(path.join(__dirname, 'dist')));

View File

@ -25,6 +25,7 @@
"compression": "^1.7.4",
"express": "^4.18.2",
"helmet": "^7.1.0",
"http-proxy-middleware": "^2.0.6",
"pm2": "^6.0.8"
},
"devDependencies": {