Skip to content

Commit

Permalink
uPic
Browse files Browse the repository at this point in the history
  • Loading branch information
icret committed Apr 23, 2023
1 parent 1583eec commit 9e2a513
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 6 deletions.
6 changes: 3 additions & 3 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Methods: PUT, POST, GET, OPTIONS, DELETE");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Cache-Control, Pragma, Authorization, Accept, Accept-Encoding");
// 定义返回头信息为Json
header("Content-type: application/json; charset=utf-8");

// 无文件
if (empty($_FILES['image'])) {
Expand Down Expand Up @@ -125,8 +127,6 @@

// 图片完整相对路径:/i/2021/05/03/k88e7p.jpg
if ($handle->processed) {
header('Content-type:text/json');

// 图片相对路径
$pathIMG = $Img_path . $handle->file_dst_name;
// 图片访问网址
Expand Down Expand Up @@ -174,6 +174,7 @@
"thumb" => $handleThumb,
"del" => $delUrl,
"ID" => $tokenID, // 202-02-11 增加返回Token ID
"messge" => "success",
// "memory" => getDistUsed(memory_get_peak_usage()), // 占用内存 2023-02-12
);
echo json_encode($reJson, JSON_UNESCAPED_UNICODE);
Expand All @@ -188,7 +189,6 @@
// 'log' => $handle->log, // 仅用作调试用
);
unset($handle);
header('Content-Type:application/json; charset=utf-8');
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
}

Expand Down
24 changes: 24 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* [简介](简介.md)
* [安装扩展](安装扩展.md)
* [安装图床](安装图床.md)
* [三方安装指南](三方安装指南.md)
* [跳过安装引导](跳过安装引导.md)
* [安全配置](安全配置.md)
* [后台管理](后台管理.md)
* [API](API.md)
* [鉴黄](鉴黄.md)
* [公共查询](公共查询.md)
* [分离相关](分离相关.md1)
* [Edge插件](Edge插件.md)
* [Chrome插件](Chrome插件.md)
* [使用uPic上传](使用uPic上传.md)
* [使用PicGo上传](使用PicGo上传.md)
* [使用ShareX上传](使用ShareX上传.md)
* [苹果快捷指令上传](苹果快捷指令上传.md)
* [隐藏存储路径](隐藏存储路径.md)
* [图床更新升级](图床更新升级.md)
* [更改域名/服务器](更改域名/服务器.md)
* [常见问题与环境要求](常见问题与环境要求.md)
* [打赏开发者](打赏开发者.md)
* [更新日志](更新日志.md)
* [许可证](许可证.md)
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [其他格式](./其他格式.md)
* [Edge插件](./Edge插件.md)
* [Chrome插件](./Chrome插件.md)
* [使用uPic上传](./使用uPic上传.md)
* [使用PicGo上传](./使用PicGo上传.md)
* [使用ShareX上传](./使用ShareX上传.md)
* [苹果快捷指令上传](./苹果快捷指令上传.md)
Expand Down
Binary file added docs/images/uPic.avif
Binary file not shown.
Binary file added docs/images/uPic1.avif
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* 2023-04-23 v2.8.2
- 增加uPic教程

* 2023-04-12 v2.8.1
- 修改上传签名生成方式
- 修复一处绕过代码
Expand Down
21 changes: 21 additions & 0 deletions docs/使用uPic上传.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. 下载并安装[uPic releases][1]或者[Mac App Store][2] | [App Store][3](测试版本:uPic v0.21.1)
2. 创建自定义图床并按照截图填写
3. 返回uPic主菜单栏, 选择默认上传为自定义图床

![EasyImage简单图床使用uPic上传图片](images/uPic1.avif)

![EasyImage简单图床使用uPic上传图片](images/uPic.avif)

```uPic
API地址:https://png.cm/api/index.php // 输入你网站api地址
请求方式: POST
文件字段名: image
添加其他字段:
- 增加Header字段: content-type multipart/form-data
- 增加Body字段: token 1c17b11693cb5ec63859b091c5b9c1b2 // 使用你的token
url路径: ["url"]
```

[1]: https://github.com/gee1k/uPic/releases
[2]: https://apps.apple.com/cn/app/id1549159979
[3]: https://apps.apple.com/us/app/id1510718678
6 changes: 3 additions & 3 deletions docs/图床更新升级.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
4. 如果出现错误请在设置中把所有底部设置点击一次`保存`

##### docker升级
1. 删除容器镜像
2. 保留挂载在主机上的配置文件
3. 重新执行一边安装代码
1. 删除容器镜像
2. 保留挂载在主机上的配置文件和上传文件夹
3. 重新执行一边docker安装代码

##### 更新后显示当前版本与Github版本不一致?

Expand Down

0 comments on commit 9e2a513

Please sign in to comment.