分批次提交

This commit is contained in:
Ghost
2026-03-17 11:51:58 +08:00
parent 96f1b5e66d
commit ba76a39edd
9 changed files with 3394 additions and 0 deletions

7
admin/.env.development Normal file
View File

@@ -0,0 +1,7 @@
# 开发环境配置
# 测试环境API地址
VITE_API_BASE_URL=http://mbti.com
# 环境标识
VITE_APP_ENV=development
VITE_APP_TITLE=MBTI管理后台-测试环境

7
admin/.env.production Normal file
View File

@@ -0,0 +1,7 @@
# 生产环境配置
# 正式环境API地址
VITE_API_BASE_URL=https://mbtiapi.quwanzhi.com
# 环境标识
VITE_APP_ENV=production
VITE_APP_TITLE=MBTI管理后台

32
admin/.gitignore vendored Normal file
View File

@@ -0,0 +1,32 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
# 环境文件(.env.local 不提交,但 .env.development 和 .env.production 需要提交)
.env.local
.env.local.*
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Auto-generated
src/auto-imports.d.ts
src/components.d.ts

14
admin/index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/svg+xml" href="/vite.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MBTI 管理后台</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

3211
admin/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
admin/package.json Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "mbti-admin",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"axios": "^1.6.7",
"dayjs": "^1.11.10",
"echarts": "^5.6.0",
"element-plus": "^2.6.2",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-echarts": "^6.6.9",
"vue-router": "^4.3.0",
"vue3-draggable-resizable": "^1.6.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"@vue/tsconfig": "^0.5.1",
"sass": "^1.71.1",
"typescript": "~5.4.0",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.1.6",
"vue-tsc": "^2.0.6"
}
}

26
admin/tsconfig.json Normal file
View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}

11
admin/tsconfig.node.json Normal file
View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

52
admin/vite.config.ts Normal file
View File

@@ -0,0 +1,52 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
css: {
preprocessorOptions: {
scss: { silenceDeprecations: ['legacy-js-api'] },
sass: { silenceDeprecations: ['legacy-js-api'] }
}
},
build: {
chunkSizeWarningLimit: 1200
},
plugins: [
vue(),
AutoImport({
imports: ['vue', 'vue-router', 'pinia'],
resolvers: [ElementPlusResolver()],
dts: 'src/auto-imports.d.ts',
}),
Components({
resolvers: [ElementPlusResolver()],
dts: 'src/components.d.ts',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
host: '0.0.0.0', // 允许局域网访问
port: 5173, // 首选端口
strictPort: false, // 如果端口被占用,自动尝试下一个可用端口
proxy: {
'/api': {
// 如果 VITE_API_BASE_URL 是完整URL则不使用代理
// 否则代理到测试服务器
// 注意在vite.config.ts中无法直接访问import.meta.env
// 这里使用默认代理配置实际请求会根据VITE_API_BASE_URL决定
target: 'http://test.mbti.com', // 本地开发代理到测试环境
changeOrigin: true,
rewrite: (path) => path, // 保持路径不变
}
}
}
})