diff --git a/README.md b/README.md new file mode 100644 index 0000000..c83cc30 --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +# Pixiv 下载浏览管理器 + +一个简单易用的 Pixiv 作品下载和浏览管理工具,最近闲着没事逛逛p站,发现p站下载一个个手点累的很,看看现成的项目都比较久远或者是操作麻烦,干脆自己搞一个玩玩。 + +## 📋 项目介绍 + +Pixiv 下载浏览管理器是一个基于 Web 的应用程序,提供以下功能: + +- 🔐 OAuth 2.0 登录认证 +- 🔍 作品搜索和浏览 +- 📥 作品下载管理 +- 👤 作者搜索 +- 🆔 作品ID搜索 + +## 🚀 快速开始 + +### 环境要求 + +- **Node.js** (版本 >= 16.0.0) +- **npm** 或 **pnpm** (推荐使用 pnpm) + +### 安装步骤 + +1. **安装 Node.js** + - 访问 [Node.js 官网](https://nodejs.org/) 下载并安装 + +2. **解压前端文件** + - 进入 `ui` 目录 + - 解压 `dist.zip` 文件到 `ui/dist` 目录 + +3. **安装依赖** + ```bash + # 在项目根目录执行 + npm install + # 或者使用 pnpm (推荐) + pnpm install + ``` + +4. **启动应用** + - 双击 `start.bat` 文件 + - 或者手动运行:`node backend/start.js` + +5. **访问应用** + - 打开浏览器访问:http://localhost:3000 + +## 🔐 登录认证 + +### 获取授权码 + +1. **访问 Pixiv 开发者页面(ui登录页面点击自动跳转)** +  + +2. **创建应用并获取授权码** +  + +3. **在应用中输入授权码完成登录** + +## 📱 功能展示 + +### 主界面 + + +### 搜索功能 +- **作品搜索** +  + +- **作者搜索** +  + +- **作品ID搜索** +  + +### 下载管理 + + +## 🛠️ 开发说明 + +本项目刚刚建立,很多功能还不够完善,欢迎大家一起参与开发! + +### 技术栈 +- **后端**: Node.js + Express +- **前端**: Vue3 + Vite +- **包管理**: pnpm (推荐) + +### 项目结构 +``` +你的项目文件/ +├── backend/ # 后端服务 +├── ui/ # 前端应用 +│ ├── dist/ # 打包后的前端文件 +│ └── src/ # 前端源码 +├── downloads/ # 下载目录 +├── data/ # 数据存储 +└── start.bat # 启动脚本 +``` + +## 🤝 贡献 + +欢迎提交 Issue 和 Pull Request 来帮助改进这个项目! + +## 许可证 + +MIT License \ No newline at end of file diff --git a/backend/auth.js b/backend/auth.js index 0b54013..3f583b6 100644 --- a/backend/auth.js +++ b/backend/auth.js @@ -199,7 +199,7 @@ class PixivAuth { this.accessToken = tokenData.access_token; this.refreshToken = tokenData.refresh_token; - + // 如果响应中包含用户信息,则保存 if (tokenData.user) { this.user = tokenData.user; diff --git a/backend/server.js b/backend/server.js index 6cf7f7a..8669f04 100644 --- a/backend/server.js +++ b/backend/server.js @@ -108,9 +108,9 @@ class PixivServer { // 如果是API请求,返回JSON格式的404 if (req.path.startsWith('/api/')) { return res.status(404).json({ - error: 'Not Found', - message: `Route ${req.originalUrl} not found` - }); + error: 'Not Found', + message: `Route ${req.originalUrl} not found` + }); } // 否则返回前端页面(SPA路由支持) diff --git a/pic/下载管理.png b/pic/下载管理.png new file mode 100644 index 0000000..3f418c7 Binary files /dev/null and b/pic/下载管理.png differ diff --git a/pic/作品id搜索.png b/pic/作品id搜索.png new file mode 100644 index 0000000..3dff95c Binary files /dev/null and b/pic/作品id搜索.png differ diff --git a/pic/作者搜索.png b/pic/作者搜索.png new file mode 100644 index 0000000..a956e37 Binary files /dev/null and b/pic/作者搜索.png differ diff --git a/pic/搜索作品.png b/pic/搜索作品.png new file mode 100644 index 0000000..1775c40 Binary files /dev/null and b/pic/搜索作品.png differ diff --git a/pic/获取授权码1.png b/pic/获取授权码1.png new file mode 100644 index 0000000..72c8bcd Binary files /dev/null and b/pic/获取授权码1.png differ diff --git a/pic/获取授权码2.png b/pic/获取授权码2.png new file mode 100644 index 0000000..899b516 Binary files /dev/null and b/pic/获取授权码2.png differ diff --git a/ui/dist.zip b/ui/dist.zip new file mode 100644 index 0000000..91b1175 Binary files /dev/null and b/ui/dist.zip differ diff --git a/ui/src/views/LoginView.vue b/ui/src/views/LoginView.vue index 76b6d93..9336565 100644 --- a/ui/src/views/LoginView.vue +++ b/ui/src/views/LoginView.vue @@ -46,9 +46,11 @@
code= 后面的内容code= 后面的内容