diff --git a/.gitignore b/.gitignore index c45a9ea..97a145a 100644 --- a/.gitignore +++ b/.gitignore @@ -53,7 +53,7 @@ logs/ # Test test/ -tests/ +# tests/ # 保留测试目录以便版本控制 # Share Directory share/ diff --git a/README.md b/README.md index f69e1e3..d10eb14 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ ## 📦 技术栈 ### 后端 -- **框架**: FastAPI (端口 9949) +- **框架**: FastAPI (端口 18080) - **数据库**: SQLite + aiosqlite - **异步**: asyncio ### 前端 -- **框架**: Vue 3 + Vite (端口 9948) +- **框架**: Vue 3 + Vite (端口 18081) - **UI库**: Element Plus - **状态管理**: Pinia - **图表**: ECharts @@ -53,7 +53,7 @@ start.bat **启动后端服务**(终端 1) ```bash -python api_server.py +python main.py ``` **启动前端服务**(终端 2) @@ -71,7 +71,7 @@ stop.bat ### 4. 访问 WebUI -打开浏览器访问:**http://localhost:9948** +打开浏览器访问:**http://localhost:18081** ## 📁 项目结构 @@ -202,10 +202,10 @@ POST /api/settings 2. **手动测试 API** ```bash # 获取统计信息 - curl http://localhost:9949/api/stats + curl http://localhost:18080/api/stats # 获取代理列表 - curl -X POST http://localhost:9949/api/proxies \ + curl -X POST http://localhost:18080/api/proxies \ -H "Content-Type: application/json" \ -d '{"page": 1, "page_size": 20}' ``` @@ -229,7 +229,7 @@ POST /api/settings ## 🔧 常见问题 ### Q: 启动后端口被占用? -A: 修改 `config.py` 中的端口号(默认9949)或 `frontend/vite.config.js` 中的端口号(默认9948) +A: 修改 `.env` 中的端口号(默认18080)或 `WebUI/vite.config.js` 中的端口号(默认18081) ### Q: 爬虫无法抓取代理? A: 检查网络连接,确保能访问目标网站,或尝试更换代理源插件 diff --git a/WebUI/index.html b/WebUI/index.html index 8769dc1..2410242 100644 --- a/WebUI/index.html +++ b/WebUI/index.html @@ -1,5 +1,5 @@ - + diff --git a/WebUI/src/api/index.js b/WebUI/src/api/index.js index d9b781b..3568518 100644 --- a/WebUI/src/api/index.js +++ b/WebUI/src/api/index.js @@ -61,8 +61,8 @@ export const statsAPI = { } export const proxiesAPI = { - getProxies: (params, signal) => - api.post('/api/proxies', cleanParams(params), signal ? { signal } : {}), + getProxies: (params, signal) => + api.post('/api/proxies', cleanParams(params), { signal }), deleteProxy: (ip, port) => api.delete(`/api/proxies/${ip}/${port}`), diff --git a/WebUI/src/stores/proxy.js b/WebUI/src/stores/proxy.js index 970863b..476b67a 100644 --- a/WebUI/src/stores/proxy.js +++ b/WebUI/src/stores/proxy.js @@ -89,7 +89,7 @@ export const useProxyStore = defineStore('proxy', () => { /** * 批量删除代理 - * @param {Array<[string, number|string]>} proxyList + * @param {Array<{ip: string, port: number}>} proxyList * @returns {Promise} 实际删除的数量 */ async function batchDeleteProxies(proxyList) { diff --git a/WebUI/src/views/Plugins.vue b/WebUI/src/views/Plugins.vue index 8874b83..73c039f 100644 --- a/WebUI/src/views/Plugins.vue +++ b/WebUI/src/views/Plugins.vue @@ -46,7 +46,7 @@