From d2a1a906709104731fc5687f714c5dd017f411cb Mon Sep 17 00:00:00 2001 From: icret Date: Tue, 3 May 2022 23:04:57 +0000 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0API/=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B5=8F=E8=A7=88=E5=92=8C=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 41 +++++++++++---------- admin/admin.inc.php | 73 +++++++++++++++++++++++++++++++------ config/config.php | 2 +- public/images/login_bg.jpg | Bin 0 -> 174072 bytes 4 files changed, 85 insertions(+), 31 deletions(-) create mode 100644 public/images/login_bg.jpg diff --git a/README.md b/README.md index 024e930..f1e740e 100755 --- a/README.md +++ b/README.md @@ -39,6 +39,27 @@ - [x] 支持创建仅上传用户 - [x] 更多支持请安装尝试··· +## 安装 +> 推荐环境:Nginx + PHP≥7.0 + linux +#### windows: +- 下载简单图床 [最新版](https://github.com/icret/EasyImages2.0/archive/refs/heads/master.zip)|[稳定版](https://github.com/icret/EasyImages2.0/releases) 上传至web根目录 + +#### Linux: + +- `git clone https://github.com/icret/EasyImages2.0.git` 至web目录 + +- 赋予web目录www:www和0755权限: +```shell +chmod 755 -R /web目录 +chown -R www:www /web目录 +``` + +#### BT宝塔面板 +- 安装环境 Ngixn(推荐) / Apache + PHP(推荐≥7.0) +- 软件商店搜索`简单图床`一键部署 + +>更多安装方式和问题请查阅->[使用手册](https://www.kancloud.cn/easyimage/easyimage/2625222) + ## 常见问题 1. 请将所有文件赋予`0755`和`www`权限 @@ -64,25 +85,6 @@ location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ } ``` -## 安装 -> 推荐环境:Nginx + PHP≥7.0 + linux -#### windows: -- 下载简单图床 [最新版](https://github.com/icret/EasyImages2.0/archive/refs/heads/master.zip)|[稳定版](https://github.com/icret/EasyImages2.0/releases) 上传至web根目录 - -#### Linux: - -- `git clone https://github.com/icret/EasyImages2.0.git` 至web目录 - -- 赋予web目录www:www和0755权限: -```shell -chmod 755 -R /web目录 -chown -R www:www /web目录 -``` - -#### BT宝塔面板 -- 安装环境 Ngixn(推荐) / Apache + PHP(推荐≥7.0) -- 软件商店搜索`简单图床`一键部署 - #### API上传 - 需要开启图床安全->API上传示例 ```html @@ -175,6 +177,7 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 * 2022-05-04 v2.6.2 deving +- 增加API/用户文件浏览和删除 - 增加转换webp后也会添加水印 - webp水印会增大图片体积消耗更多PHP内存,PHP8以上有很大概率失败! - 修复一些bugs diff --git a/admin/admin.inc.php b/admin/admin.inc.php index 1cf823b..ce40458 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -81,10 +81,51 @@ if (isset($_GET['stop_token'])) { }).show(); '; - header("refresh:2;url=" . $config['domain'] . "/admin/admin.inc.php"); + header("refresh:1;url=/admin/admin.inc.php"); } -// 删除guset.config.php数组对 +// 删除Token +if (isset($_GET['delete_token'])) { + unset($tokenList[$_GET['delete_token']]); + $config_file = APP_ROOT . '/config/api_key.php'; + cache_write($config_file, $tokenList, 'tokenList'); + echo ' + + '; + header("refresh:1;url=/admin/admin.inc.php"); +} + +// 禁用用户 +if (isset($_GET['stop_guest'])) { + $stop_guest = $_GET['stop_guest']; + $postArr = array( + $stop_guest => array( + 'password' => $guestConfig[$stop_guest]['password'], + 'expired' => time(), + 'add_time' => $guestConfig[$stop_guest]['add_time'] + ) + ); + $new_config = array_replace($guestConfig, $postArr); + $config_file = APP_ROOT . '/config/config.guest.php'; + cache_write($config_file, $new_config, 'guestConfig'); + echo ' + + '; + header("refresh:1;url=/admin/admin.inc.php"); +} + + +// 删除用户 if (isset($_GET['delete_guest'])) { unset($guestConfig[$_GET['delete_guest']]); $config_file = APP_ROOT . '/config/config.guest.php'; @@ -97,6 +138,7 @@ if (isset($_GET['delete_guest'])) { }).show(); '; + header("refresh:1;url=/admin/admin.inc.php"); } // 添加上传账号 修改config.guest.php @@ -164,6 +206,8 @@ if (isset($_GET['suspic_reimg'])) { "; } + + header("refresh:1;url=/admin/admin.inc.php"); } // 回收站恢复图片 @@ -188,6 +232,8 @@ if (isset($_GET['recycle_reimg'])) { "; } + + header("refresh:1;url=/admin/admin.inc.php"); } ?>
@@ -407,7 +453,7 @@ if (isset($_GET['recycle_reimg'])) { " placeholder="隐藏的保存"> - +

API调用网址:/api/index.php

@@ -431,7 +477,9 @@ if (isset($_GET['recycle_reimg'])) { @@ -923,15 +971,19 @@ if (isset($_GET['recycle_reimg'])) { - $value) : ?> + $value) : + $expired = $value['expired'] < time() ? '

已过期

' : '

' . date('Y年m月d日 H:i:s', $value['expired']) . '

'; + ?> - + @@ -1109,8 +1161,7 @@ if (isset($_GET['recycle_reimg'])) {
文件管理 Tinyfilemanager是由作者定制开发,非必要请勿替换
- 文件管理 - + 文件管理
删除文件 * 删除后不可恢复
@@ -1260,7 +1311,7 @@ if (isset($_GET['recycle_reimg'])) { name: 'manage', label: '管理Token', html: true, - width: 0.2 + width: 0.25 }, ], array: [ @@ -1271,7 +1322,7 @@ if (isset($_GET['recycle_reimg'])) { add_time: '', expired: '', number: , - manage: "禁用 ' class='btn btn-mini btn-primary '>删除上传" + manage: "' target='_blank' class='btn btn-mini btn-primary '>文件 禁用 删除 ' class='btn btn-mini btn-primary '>删除上传" }, ] diff --git a/config/config.php b/config/config.php index 7dbc87a..6b7afa2 100755 --- a/config/config.php +++ b/config/config.php @@ -92,7 +92,7 @@ $config=Array 'token_path_status'=>0, 'admin_path'=>'u', 'version'=>'2.6.1', - 'update'=>'2022-05-04 01:30:23', + 'update'=>'2022-05-04 06:57:24', 'footer'=>'请勿上传违反中国政策的图片
- 禁用 + ' target='_blank' class='btn btn-mini btn-primary '>文件 + 禁用 + 删除 ' class='btn btn-mini btn-primary '>删除上传
- 删除账户 + '>文件 + 禁用 + 删除 ' href='admin.inc.php?delDir='>删除上传