一个简洁美观的图床系统,基于 ThinkPHP 8 + React 18 构建。支持多种云存储,具备完善的用户权限管理。
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- 图片上传(支持拖拽、粘贴)
- 目录分类管理
- 批量操作(复制链接、移动目录、删除)
- 瀑布流展示
- 图片搜索与筛选
- 本地存储
- 阿里云 OSS
- 腾讯云 COS
- 七牛云 KODO
- 华为云 OBS
- AWS S3(兼容 MinIO、Cloudflare R2 等)
- 用户注册/登录
- 邮箱验证码
- 密码找回
- 个人资料管理
- 存储配额控制
- 角色组管理
- 细粒度权限控制(上传、删除、查看等)
- 管理员后台
- 密钥认证上传
- 图片删除接口
- 随机图片接口(支持横竖屏自适应)
| 后端 | 前端 |
|---|---|
| PHP >= 8.2 | React 18 |
| ThinkPHP 8 | TypeScript |
| MySQL | Tailwind CSS |
| JWT 认证 | Zustand |
| PHPMailer | Vite |
- PHP >= 8.2(安装PRO,fileinfo,curl扩展)
- MySQL >= 5.7
- Node.js >= 18(仅构建时需要)
- Composer
从 GitHub Actions 下载最新的 prettypicture-release.zip,解压后直接部署。
# 1. 克隆项目
git clone https://github.com/your-repo/PrettyPicture.git
cd PrettyPicture
# 2. 安装后端依赖
composer install --no-dev
# 3. 构建前端
cd PrettyPicture-react
npm install
npm run build
# 4. 复制前端构建文件
cp -r dist/* ../public/-
访问
/install目录进行安装 -
配置 Web 服务器,将根目录指向
public/ -
确保
runtime/目录可写 -
配置 Rewrite 规则为:thinkphp
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
POST /api/upload?key=YOUR_SECRET_KEY&folder_id=0
Content-Type: multipart/form-data
file: 图片文件DELETE /api/delete?key=YOUR_SECRET_KEY&id=IMAGE_IDGET /api/random?folder_id=1&type=redirect&orientation=auto
# 参数说明
folder_id: 公开目录ID(必填)
type: redirect(跳转)或 json(返回URL)
orientation: auto | vertical | horizontalPrettyPicture/
├── app/ # 后端应用
│ ├── controller/ # 控制器
│ ├── model/ # 数据模型
│ ├── services/ # 服务类
│ └── middleware/ # 中间件
├── config/ # 配置文件
├── public/ # Web 根目录
└── PrettyPicture-react/ # 前端源码
└── src/
├── api/ # API 接口
├── components/ # 组件
├── pages/ # 页面
└── store/ # 状态管理
Apache License 2.0





