refactor: 清理未使用的依赖和优化项目配置

- 移除前端未使用的依赖(md5, xlsx等)和类型定义
- 删除重复的.gitignore文件并统一配置
- 优化vite配置和打包策略
- 清理未使用的导入和注释代码
This commit is contained in:
zhangtao
2025-06-04 00:32:22 +08:00
parent 9ba539294f
commit 9a796873b4
24 changed files with 89 additions and 484 deletions
+20 -23
View File
@@ -1,31 +1,28 @@
.venv
__pycache__
.vscode
.idea
.dev
.chat
.DS_Store
__pycache__
.git
venv
backend/logs
backend/venv
backend/__pycache__
backend/dev_sql.db
backend/site/*
backend/.vscode
backend/.idea
backend/.DS_Store
backend/venv
backend/logs
backend/*.db
backend/site
frontend/build
frontend/node_modules
frontend/__pycache__
frontend/.vscode
frontend/.idea
frontend/.DS_Store
frontend/node_modules
frontend/dist
devops/frontend/dist
.history
.env.prod
.env.production
docker-compose.prod.yaml
docker-compose.yaml
backend/env/.env.prod
frontend/.env.production
prod/
uni-app/__pycache__
uni-app/.vscode
uni-app/.idea
uni-app/.DS_Store
uni-app/node_modules
uni-app/dist
Binary file not shown.
+12 -12
View File
@@ -35,27 +35,27 @@ DB_DRIVER = "mysql" # sqlite、mysql、postgresql
SQLITE_DB_NAME = "prod_sql.db"
# MYSQL配置
MYSQL_HOST = "生产环境地址"
MYSQL_USER = "生产环境用户名"
MYSQL_PASSWORD = "生产环境密码"
MYSQL_HOST = "172.18.52.77"
MYSQL_USER = "root"
MYSQL_PASSWORD = "FastApi123abc"
MYSQL_PORT = 3306
MYSQL_DB_NAME = "生产环境数据库名"
MYSQL_DB_NAME = "fastapi_vue3_admin"
# Redis配置
REDIS_ENABLE = True
REDIS_HOST = "生产环境地址"
REDIS_HOST = "172.18.52.77"
REDIS_PORT = 6379
REDIS_USER = "生产环境账号"
REDIS_PASSWORD = "生产环境密码"
REDIS_DB_NAME = "生产环境数据库名"
REDIS_USER = ''
REDIS_PASSWORD = 'FastApi123abc'
REDIS_DB_NAME = 1
# MongoDB配置
MONGO_DB_ENABLE = False
MONGO_DB_HOST = "生产环境地址"
MONGO_DB_USER = "生产环境账号"
MONGO_DB_PASSWORD = "生产环境密码"
MONGO_DB_HOST = "172.18.52.77"
MONGO_DB_USER = "root"
MONGO_DB_PASSWORD = 'FastApi123abc'
MONGO_DB_PORT = 27017
MONGO_DB_NAME = "生产环境数据库名"
MONGO_DB_NAME = "fastapi_vue3_admin"
# 日志配置
LOGGER_LEVEL = 'INFO' # 日志级别
+1 -1
View File
@@ -898,7 +898,7 @@ acllog-max-len 128
# The requirepass is not compatable with aclfile option and the ACL LOAD
# command, these will cause requirepass to be ignored.
#
requirepass 连接密码
requirepass FastApi123abc
# New users are initialized with restrictive permissions by default, via the
# equivalent of this ACL rule 'off resetkeys -@all'. Starting with Redis 6.2, it
+3 -5
View File
@@ -7,10 +7,8 @@ services:
restart: always
environment:
TZ: "Asia/Shanghai"
MYSQL_ROOT_PASSWORD: "管理员密码"
MYSQL_DATABASE: "生产环境数据库"
MYSQL_USER: "生产环境数据库"
MYSQL_PASSWORD: "生产环境数据库密码"
MYSQL_ROOT_PASSWORD: "FastApi123abc"
MYSQL_DATABASE: "fastapi_vue3_admin"
ports:
- "3306:3306"
volumes:
@@ -58,7 +56,7 @@ services:
- app_network
# 前端nginx服务
frontend:
nginx:
container_name: nginx
image: nginx:latest
restart: always
+1 -1
View File
@@ -9,7 +9,7 @@ VITE_APP_TITLE=生产环境
VITE_APP_BASE_API=/api/v1
# 网络请求公用地址
VITE_API_BASE_URL='生产环境地址'
VITE_API_BASE_URL=http://service.fastapiadmin.com
# 请求超时时间
VITE_TIMEOUT=10000
-25
View File
@@ -1,25 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
./package-lock.json
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+5 -323
View File
@@ -15,7 +15,6 @@
"echarts": "^5.5.0",
"element-plus": "^2.8.4",
"highlight.js": "^11.10.0",
"md5": "^2.3.0",
"pinia": "^3.0.0",
"pinia-plugin-persistedstate": "^4.3.0",
"sass": "1.63.2",
@@ -24,16 +23,12 @@
"vue-echarts": "^6.6.9",
"vue-request": "^2.0.4",
"vue-router": "^4.2.5",
"vue3-cron-plus-picker": "^1.0.2",
"xlsx": "^0.18.5"
"vue3-cron-plus-picker": "^1.0.2"
},
"devDependencies": {
"@types/md5": "^2.3.5",
"@types/store": "^2.0.5",
"@vitejs/plugin-vue": "^4.5.2",
"vite": "5.2.8",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-remove-console": "^2.2.0"
"vite": "5.2.8"
}
},
"node_modules/@ant-design/colors": {
@@ -993,13 +988,6 @@
"@types/lodash": "*"
}
},
"node_modules/@types/md5": {
"version": "2.3.5",
"resolved": "https://registry.npmmirror.com/@types/md5/-/md5-2.3.5.tgz",
"integrity": "sha512-/i42wjYNgE6wf0j2bcTX6kuowmdL/6PE4IVitMpm2eYKBUuYCprdcWVK+xEF0gcV6ufMCRhtxmReGfc6hIK7Jw==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/node": {
"version": "20.17.50",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-20.17.50.tgz",
@@ -1281,31 +1269,6 @@
"node": ">=0.4.0"
}
},
"node_modules/adler-32": {
"version": "1.3.1",
"resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.3.1.tgz",
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/ant-design-vue": {
"version": "4.2.6",
"resolved": "https://registry.npmmirror.com/ant-design-vue/-/ant-design-vue-4.2.6.tgz",
@@ -1483,45 +1446,6 @@
"node": ">= 0.4"
}
},
"node_modules/cfb": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz",
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
"license": "Apache-2.0",
"dependencies": {
"adler-32": "~1.3.0",
"crc-32": "~1.2.0"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==",
"license": "BSD-3-Clause",
"engines": {
"node": "*"
}
},
"node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-4.0.3.tgz",
@@ -1546,35 +1470,6 @@
"consola": "^3.2.3"
}
},
"node_modules/codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz",
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"license": "MIT"
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -1643,27 +1538,6 @@
"url": "https://opencollective.com/core-js"
}
},
"node_modules/crc-32": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz",
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
"license": "Apache-2.0",
"bin": {
"crc32": "bin/crc32.njs"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==",
"license": "BSD-3-Clause",
"engines": {
"node": "*"
}
},
"node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
@@ -1676,24 +1550,6 @@
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==",
"license": "MIT"
},
"node_modules/debug": {
"version": "4.4.1",
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.1.tgz",
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/deep-pick-omit": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/deep-pick-omit/-/deep-pick-omit-1.2.1.tgz",
@@ -1991,30 +1847,6 @@
"node": ">= 6"
}
},
"node_modules/frac": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
},
"node_modules/fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
@@ -2116,23 +1948,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true,
"license": "ISC"
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
@@ -2214,12 +2029,6 @@
"node": ">=8"
}
},
"node_modules/is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmmirror.com/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"license": "MIT"
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -2286,19 +2095,6 @@
"integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
"license": "MIT"
},
"node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/klona": {
"version": "2.0.6",
"resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.6.tgz",
@@ -2390,17 +2186,6 @@
"node": ">= 0.4"
}
},
"node_modules/md5": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"license": "BSD-3-Clause",
"dependencies": {
"charenc": "0.0.2",
"crypt": "0.0.2",
"is-buffer": "~1.1.6"
}
},
"node_modules/memoize-one": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz",
@@ -2463,13 +2248,6 @@
"pathe": "^2.0.1"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true,
"license": "MIT"
},
"node_modules/nanoid": {
"version": "3.3.11",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz",
@@ -2898,18 +2676,6 @@
"node": ">=0.10.0"
}
},
"node_modules/ssf": {
"version": "0.11.2",
"resolved": "https://registry.npmmirror.com/ssf/-/ssf-0.11.2.tgz",
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
"license": "Apache-2.0",
"dependencies": {
"frac": "~1.1.2"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/std-env": {
"version": "3.9.0",
"resolved": "https://registry.npmmirror.com/std-env/-/std-env-3.9.0.tgz",
@@ -2955,19 +2721,6 @@
"node": ">=16"
}
},
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/terser": {
"version": "5.40.0",
"resolved": "https://registry.npmmirror.com/terser/-/terser-5.40.0.tgz",
@@ -3005,9 +2758,9 @@
"license": "MIT"
},
"node_modules/tinyglobby": {
"version": "0.2.13",
"resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.13.tgz",
"integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==",
"version": "0.2.14",
"resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.14.tgz",
"integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==",
"license": "MIT",
"dependencies": {
"fdir": "^6.4.4",
@@ -3087,16 +2840,6 @@
"node": ">=18.12.0"
}
},
"node_modules/universalify": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/unplugin": {
"version": "2.3.4",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-2.3.4.tgz",
@@ -3199,28 +2942,6 @@
}
}
},
"node_modules/vite-plugin-compression": {
"version": "0.5.1",
"resolved": "https://registry.npmmirror.com/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
"integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^4.1.2",
"debug": "^4.3.3",
"fs-extra": "^10.0.0"
},
"peerDependencies": {
"vite": ">=2.0.0"
}
},
"node_modules/vite-plugin-remove-console": {
"version": "2.2.0",
"resolved": "https://registry.npmmirror.com/vite-plugin-remove-console/-/vite-plugin-remove-console-2.2.0.tgz",
"integrity": "sha512-qgjh5pz75MdE9Kzs8J0kBwaCfifHV0ezRbB9rpGsIOxam+ilcGV7WOk91vFJXquzRmiKrFh3Hxlh0JJWAmXTbQ==",
"dev": true,
"license": "MIT"
},
"node_modules/vue": {
"version": "3.5.14",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.14.tgz",
@@ -3397,45 +3118,6 @@
"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
"license": "MIT"
},
"node_modules/wmf": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz",
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
},
"node_modules/word": {
"version": "0.3.0",
"resolved": "https://registry.npmmirror.com/word/-/word-0.3.0.tgz",
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
},
"node_modules/xlsx": {
"version": "0.18.5",
"resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz",
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
"license": "Apache-2.0",
"dependencies": {
"adler-32": "~1.3.0",
"cfb": "~1.2.1",
"codepage": "~1.15.0",
"crc-32": "~1.2.1",
"ssf": "~0.11.2",
"wmf": "~1.0.1",
"word": "~0.3.0"
},
"bin": {
"xlsx": "bin/xlsx.njs"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
+2 -7
View File
@@ -16,7 +16,6 @@
"echarts": "^5.5.0",
"element-plus": "^2.8.4",
"highlight.js": "^11.10.0",
"md5": "^2.3.0",
"pinia": "^3.0.0",
"pinia-plugin-persistedstate": "^4.3.0",
"sass": "1.63.2",
@@ -25,15 +24,11 @@
"vue-echarts": "^6.6.9",
"vue-request": "^2.0.4",
"vue-router": "^4.2.5",
"vue3-cron-plus-picker": "^1.0.2",
"xlsx": "^0.18.5"
"vue3-cron-plus-picker": "^1.0.2"
},
"devDependencies": {
"@types/md5": "^2.3.5",
"@types/store": "^2.0.5",
"@vitejs/plugin-vue": "^4.5.2",
"vite": "5.2.8",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-remove-console": "^2.2.0"
"vite": "5.2.8"
}
}
+4 -4
View File
@@ -69,7 +69,7 @@
</template>
<template #header>
<div class="notice-header">
<icons.WarningOutlined style="color: #faad14" /> 公告通知
<WarningOutlined style="color: #faad14" /> 公告通知
</div>
</template>
</a-list>
@@ -166,9 +166,10 @@ import {
MenuUnfoldOutlined,
BulbOutlined,
BulbFilled,
SettingOutlined
SettingOutlined,
WarningOutlined
} from '@ant-design/icons-vue';
import { useUserStore, useNoticeStore, useDictStore, useConfigStore } from "@/store/index";
import { useUserStore, useNoticeStore, useConfigStore } from "@/store/index";
import { logout } from '@/api/system/auth';
const userStore = useUserStore();
@@ -349,7 +350,6 @@ onMounted(() => {
z-index: 99;
.logo-container {
height: calc(100vh - 64px);
padding: 16px;
display: flex;
align-items: center;
-1
View File
@@ -16,7 +16,6 @@ const app = createApp(App);
const pinia = createPinia();
app.use(pinia);
// app.use(VueCron);
app.use(ElementPlus)
const initConfig = async () => {
-1
View File
@@ -3,7 +3,6 @@ import storage from "store";
import router from "@/router";
import { getNewToken } from "@/api/system/auth";
import { save_token } from "@/utils/util";
import notification from "ant-design-vue/es/notification";
import { message } from 'ant-design-vue';
// 创建 axios 实例
+1 -1
View File
@@ -77,7 +77,7 @@ import { reactive, ref, onMounted } from 'vue';
import { message } from 'ant-design-vue';
import { getInitConfig, updateConfig, uploadFile } from '@/api/system/config';
import type { tableDataType } from './types';
import { PlusOutlined } from '@ant-design/icons-vue';
// 定义 configData
const configData = reactive<Record<string, any>>({});
-2
View File
@@ -293,11 +293,9 @@ import {
IdcardOutlined,
TeamOutlined,
ApartmentOutlined,
UploadOutlined,
KeyOutlined,
CheckOutlined,
SaveOutlined,
CheckCircleOutlined,
CloseCircleOutlined,
ClockCircleOutlined,
PlusOutlined,
+1 -1
View File
@@ -116,7 +116,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue';
import { ref } from 'vue';
import { timeFix } from '@/utils/util';
import { PlusOutlined, UserOutlined } from '@ant-design/icons-vue';
import { useUserStore } from "@/store/index";
@@ -143,7 +143,6 @@
<script lang="ts" setup>
import { ref, reactive, computed, unref, onMounted, h } from 'vue';
import dayjs from 'dayjs';
import { Table, message, Modal } from 'ant-design-vue';
import type { TableColumnsType } from 'ant-design-vue';
import { PlusOutlined, DownOutlined } from '@ant-design/icons-vue';
+3 -3
View File
@@ -216,10 +216,10 @@
import { ref, reactive, computed, unref, onMounted, h } from 'vue';
import { useRoute } from 'vue-router';
import { Table, message, Modal } from 'ant-design-vue';
import type { TableColumnsType, MenuProps } from 'ant-design-vue';
import { PlusOutlined, DownOutlined, CheckOutlined, StopOutlined } from '@ant-design/icons-vue';
import type { TableColumnsType } from 'ant-design-vue';
import { PlusOutlined, DownOutlined } from '@ant-design/icons-vue';
import { cloneDeep, isEmpty } from '@/utils/util';
import { getDictTypeOptionselect, getDictTypeList,getDictTypeDetail,createDictType,updateDictType,deleteDictType,exportDictType,getDictDataList,getDictDataDetail,createDictData,updateDictData,deleteDictData,exportDictData } from '@/api/system/dict'
import { getDictTypeOptionselect,getDictDataList,createDictData,updateDictData,deleteDictData,exportDictData } from '@/api/system/dict'
import type { searchDictDataType, tableDictDataType } from './types'
import { useDictStore } from "@/store/index";
+3 -3
View File
@@ -154,10 +154,10 @@
<script lang="ts" setup>
import { ref, reactive, computed, unref, onMounted, h } from 'vue';
import { Table, message, Modal } from 'ant-design-vue';
import type { TableColumnsType, MenuProps } from 'ant-design-vue';
import { PlusOutlined, DownOutlined, CheckOutlined, StopOutlined } from '@ant-design/icons-vue';
import type { TableColumnsType } from 'ant-design-vue';
import { PlusOutlined, DownOutlined } from '@ant-design/icons-vue';
import { cloneDeep, isEmpty } from '@/utils/util';
import { getDictTypeList,getDictTypeDetail,createDictType,updateDictType,deleteDictType,exportDictType,getDictDataList,getDictDataDetail,createDictData,updateDictData,deleteDictData,exportDictData } from '@/api/system/dict'
import { getDictTypeList,createDictType,updateDictType,deleteDictType,exportDictType} from '@/api/system/dict'
import type { searchDataType, tableDictType } from './types'
const createForm = ref();
+1 -1
View File
@@ -464,7 +464,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, computed, unref, onMounted, h, watch } from 'vue';
import { ref, reactive, computed, unref, onMounted, h } from 'vue';
import dayjs from 'dayjs';
import { Table, message, Modal } from 'ant-design-vue';
import type { TableColumnsType } from 'ant-design-vue';
+1 -2
View File
@@ -115,12 +115,11 @@
<script lang="ts" setup>
import { ref, reactive, onMounted, h } from 'vue';
import type { TableColumnsType } from 'ant-design-vue';
import { SearchOutlined, DownOutlined, DownloadOutlined } from '@ant-design/icons-vue';
import { SearchOutlined, DownOutlined } from '@ant-design/icons-vue';
import { message, Modal } from 'ant-design-vue';
import type { searchDataType, tableDataType, creatorType } from './types'
import { getLogList, deleteLog, exportLog } from '@/api/system/log'
import SelectorModal from './SelectorModal.vue'
import XLSX from 'xlsx';
const tableLoading = ref(false);
const dataSource = ref<tableDataType[]>([]);
-1
View File
@@ -180,7 +180,6 @@ import { cloneDeep, isEmpty } from '@/utils/util';
import PermissionDrawer from './PermissionDrawer.vue'
import type { searchDataType, tableDataType } from './types'
import { getRoleList, createRole, updateRole, deleteRole, batchAvailableRole, exportRole } from '@/api/system/role'
import XLSX from 'xlsx';
const createForm = ref();
const updateForm = ref();
+5 -12
View File
@@ -1,8 +1,6 @@
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import removeConsole from "vite-plugin-remove-console";
import viteCompression from 'vite-plugin-compression';
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
@@ -18,13 +16,7 @@ export default defineConfig(({ command, mode }) => {
},
plugins: [
vue(),
removeConsole(),
viteCompression({
threshold: 1024 * 20,
algorithm: 'brotliCompress',
ext: '.br'
})
vue()
],
server: {
host: "0.0.0.0",
@@ -52,9 +44,10 @@ export default defineConfig(({ command, mode }) => {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
// 让每个插件都打包成独立的文件
return id .toString() .split("node_modules/")[1] .split("/")[0] .toString();
if (id.includes('node_modules')) {
const module = id.toString().split('node_modules/')[1].split('/')[0]
if (['birpc', 'hookable'].includes(module)) return // 排除无用 chunk
return module
}
}
}
+26 -33
View File
@@ -1,9 +1,8 @@
#!/bin/bash
# 设置全局变量
PROJECT_NAME="fastapi_vue3_admin"
WORK_DIR="/home"
GIT_REPO="https://gitee.com/tao__tao/fastapi_vue3_admin.git"
WORK_DIR="$(dirname "$0")"
# /home/fastapi_vue3_admin
# 打印带时间戳的日志
log() {
@@ -12,7 +11,7 @@ log() {
# 检查权限
check_permissions() {
log "==========🔍 第一步检查权限...=========="
log "🚀 第一步: 检查权限..."
# 检查脚本文件是否有执行权限
if [ ! -x "$0" ]; then
log "⚠️ 当前脚本没有执行权限,尝试添加执行权限..."
@@ -30,7 +29,7 @@ check_permissions() {
# 检查依赖
check_dependencies() {
log "==========🔍 第二步检查系统依赖...=========="
log "🚀 第二步: 检查系统依赖..."
for cmd in git docker node npm; do
command -v $cmd &> /dev/null || { log "$cmd 未安装"; exit 1; }
log "🎉 $cmd 已安装 - $($cmd -v)"
@@ -40,25 +39,17 @@ check_dependencies() {
# 更新代码
update_code() {
log "==========🔍 第三步:检查项目...=========="
log "🚀 第三步: 开始更新代码..."
cd "${WORK_DIR}" || { log "❌ 无法进入工作目录:${WORK_DIR}"; exit 1; }
if [ -d "${PROJECT_NAME}/" ]; then
log "🔄 项目已存在,开始更新代码"
cd "${PROJECT_NAME}" || { log "❌ 无法进入项目目录:${PROJECT_NAME}"; exit 1; }
git pull --force || { log "❌ 拉取更新失败"; exit 1; }
git log -1 || { log "❌ 获取提交信息失败"; exit 1; }
log "✅ 代码更新成功"
else
log "📥 项目不存在,开始克隆代码"
git clone "${GIT_REPO}" || { log "❌ 项目克隆失败:${GIT_REPO}"; exit 1; }
cd "${PROJECT_NAME}" || { log "❌ 无法进入项目目录:${PROJECT_NAME}"; exit 1; }
log "✅ 代码克隆成功"
fi
git pull --force || { log "❌ 拉取更新失败,请检查网络或仓库权限"; exit 1; }
git log -1 || { log "❌ 获取提交信息失败"; exit 1; }
log "✅ 代码更新成功"
}
# 停止并删除容器
stop_and_remove_containers() {
log "==========🗑️ 第四步终止容器...=========="
log "🚀 第四步: 终止容器..."
cd "${WORK_DIR}" || { log "❌ 无法进入工作目录:${WORK_DIR}"; exit 1; }
[ -f "docker-compose.yaml" ] || { log "❌ docker-compose.yaml 文件未找到"; exit 1; }
docker compose down
log "✅ 容器已停止并删除"
@@ -66,15 +57,16 @@ stop_and_remove_containers() {
# 构建前端
build_frontend() {
log "==========🔍 第五步:检查前端...=========="
# 如果是首次克隆项目,或者检测到前端代码变更,则构建前端
if [ ! -d "frontend/dist" ] || [ "$(git diff --name-only HEAD~1 HEAD -- frontend/)" ]; then
log "🚀 检测到前端代码变更或首次克隆,开始构建前端..."
cd frontend || { log "❌ 无法进入前端目录"; exit 1; }
log "🚀 第五步: 构建前端..."
cd "${WORK_DIR}/frontend" || { log "❌ 无法进入前端目录"; exit 1; }
if [ ! -f "package.json" ]; then
log "❌ 前端项目缺少 package.json 文件"
exit 1
fi
if [ ! -d "dist" ] || [ ! -d "node_modules" ] || [ "$(git diff --name-only HEAD~1 HEAD -- frontend/)" ]; then
npm install || { log "❌ 前端依赖安装失败"; exit 1; }
npm run build || { log "❌ 前端工程打包失败"; exit 1; }
log "✅ 前端工程打包成功"
cd .. || { log "❌ 无法返回项目根目录"; exit 1; }
else
log "⚠️ 未检测到前端代码变更且非首次克隆,跳过前端构建"
fi
@@ -82,29 +74,30 @@ build_frontend() {
# 构建镜像
build_image() {
log "==========🚀 第六步构建镜像...==========🗑️ "
log "🚀 第六步: 构建镜像..."
cd "${WORK_DIR}" || { log "❌ 无法进入工作目录:${WORK_DIR}"; exit 1; }
docker compose build || { log "❌ 镜像构建失败"; exit 1; }
log "✅ Docker镜像构建成功"
log "✅ Docker镜像构建成功"
}
# 启动容器
start_containers() {
log "==========🚀 第七步启动容器...==========🗑️ "
log "🚀 第七步: 启动容器..."
cd "${WORK_DIR}" || { log "❌ 无法进入工作目录:${WORK_DIR}"; exit 1; }
docker compose up -d --force-recreate || { log "❌ 容器启动失败"; exit 1; }
log "✅ 容器启动成功"
log "✅ 容器启动成功"
}
# 清理旧镜像
cleanup_old_images() {
log "==========🗑️ 第八步清理24小时前的旧镜像...==========🗑️ "
log "🗑️ 第八步: 清理24小时前的旧镜像..."
docker image prune -f --filter "until=24h"
log "✅ 旧镜像清理完成"
}
# 主函数
main() {
log "==========🚀 开始部署流程=========="
log "==========🚀 开始部署=========="
check_permissions
check_dependencies
update_code
@@ -117,4 +110,4 @@ main() {
}
main
trap 'log "==========⚠️ 脚本中断=========="; exit 1' INT TERM
trap 'log "⚠️ 脚本中断"; exit 1' INT TERM
-21
View File
@@ -1,21 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?