增强对第三方API兼容性
parent
271d1a4785
commit
6cae61ee33
|
@ -6,7 +6,12 @@ require_once __DIR__ . '/../application/function.php';
|
||||||
require_once APP_ROOT . '/application/class.upload.php';
|
require_once APP_ROOT . '/application/class.upload.php';
|
||||||
require_once APP_ROOT . '/config/api_key.php';
|
require_once APP_ROOT . '/config/api_key.php';
|
||||||
|
|
||||||
header('Access-Control-Allow-Origin:*');
|
// 允许跨域 https://stackoverflow.com/questions/8719276/cross-origin-request-headerscors-with-php-headers
|
||||||
|
header("Access-Control-Max-Age: 3600");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
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");
|
||||||
|
|
||||||
// 无文件
|
// 无文件
|
||||||
if (empty($_FILES['image'])) {
|
if (empty($_FILES['image'])) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
- 更换存储密码算法为SHA256
|
- 更换存储密码算法为SHA256
|
||||||
- 默认不支持SVG文件上传
|
- 默认不支持SVG文件上传
|
||||||
- 完全兼容 PHP5.6-8.0
|
- 完全兼容 PHP5.6-8.0
|
||||||
|
- 对picgo/ShareX/盘络等第三方API增强兼容性
|
||||||
- 本次漏洞修复和代码增强感谢 [xulei1112](https://github.com/xulei1112)
|
- 本次漏洞修复和代码增强感谢 [xulei1112](https://github.com/xulei1112)
|
||||||
|
|
||||||
* 2023-02-24 v2.7.5
|
* 2023-02-24 v2.7.5
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
1. 下载最新版[PicGo-windows版][1]或者[PicGo-mac版][2](我下载的版本是:PicGo-Setup-2.3.1-x64)
|
1. 下载最新版[PicGo-windows版][1]或者[PicGo-mac版][2](测试版本:PicGo-Setup-2.3.1-x64/PicGo-Setup-2.4.0-beta.0-x64)
|
||||||
2. 安装后在插件设置中搜索`web-uploader 1.1.1` 并安装(下载插件可能需要[node.js][3]插件)
|
2. 安装后在插件设置中搜索`web-uploader 1.1.1` 并安装(下载插件可能需要[node.js][3]插件)
|
||||||
3. 图床设置-自定义Web图床中按照如下方式填写,然后点击确定并设置为默认图床。
|
3. 图床设置-自定义Web图床中按照如下方式填写,然后点击确定并设置为默认图床。
|
||||||
4. 登录图床后台->图床安全->高级设置->开启API上传
|
4. 登录图床后台->图床安全->高级设置->开启API上传
|
||||||
|
|
||||||
|
|
||||||
|
![EasyImage简单图床使用PicGo上传图片](images/4128197507.png)
|
||||||
|
|
||||||
```PicGo
|
```PicGo
|
||||||
API地址:https://png.cm/api/index.php // 输入你的网站api地址
|
API地址:https://png.cm/api/index.php // 输入你网站api地址
|
||||||
POST参数名: image
|
POST参数名: image
|
||||||
JSON路径: url
|
JSON路径: url
|
||||||
自定义Body: {"token":"1c17b11693cb5ec63859b091c5b9c1b2"} // 这里输入你网站生成的token
|
自定义Body: {"token":"1c17b11693cb5ec63859b091c5b9c1b2"} // 这里输入你网站生成的token
|
||||||
```
|
```
|
||||||
|
|
||||||
![EasyImage简单图床使用PicGo上传图片](images/4128197507.png)
|
|
||||||
|
|
||||||
|
|
||||||
[1]: https://github.com/Molunerfinn/PicGo/releases
|
[1]: https://github.com/Molunerfinn/PicGo/releases
|
||||||
[2]: https://github.com/Molunerfinn/PicGo/releases
|
[2]: https://github.com/Molunerfinn/PicGo/releases
|
||||||
[3]: https://nodejs.org/zh-cn/
|
[3]: https://nodejs.org/zh-cn/
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
```ShareX
|
```ShareX
|
||||||
{
|
{
|
||||||
"Version": "13.5.0",
|
"Version": "15.0.0",
|
||||||
"Name": "简单图床API图片上传",
|
"Name": "简单图床API图片上传",
|
||||||
"DestinationType": "ImageUploader",
|
"DestinationType": "ImageUploader",
|
||||||
"RequestMethod": "POST",
|
"RequestMethod": "POST",
|
||||||
|
@ -17,10 +17,10 @@
|
||||||
"token": "8337effca0ddfcd9c5899f3509b23657"
|
"token": "8337effca0ddfcd9c5899f3509b23657"
|
||||||
},
|
},
|
||||||
"FileFormName": "image",
|
"FileFormName": "image",
|
||||||
"URL": "$json:url$",
|
"URL": "{json:url}",
|
||||||
"ThumbnailURL": "$json:thumb$",
|
"ThumbnailURL": "{json:thumb}",
|
||||||
"DeletionURL": "$json:del$",
|
"DeletionURL": "{json:del}",
|
||||||
"ErrorMessage": "$json:message$"
|
"ErrorMessage": "{json:message}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
![](images/ShareX_UwVwPnC3MJ.png)
|
![](images/ShareX_UwVwPnC3MJ.png)
|
||||||
|
|
Loading…
Reference in New Issue