From ae21b70a1342e71a964032677d4aa7a1b34ed4cd Mon Sep 17 00:00:00 2001 From: icret Date: Wed, 1 Feb 2023 02:26:09 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0IP=E5=9C=B0=E5=9D=80=20(=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=82=E8=80=83=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 2023-02-01 v2.7.0 dev - 增加上传历史记录 - 增加粘贴上传状态 - 增加广场非图片图标 - 增加前端显示缩略图链接 - 增加每日获取Bing图片背景 - 增加图片详细信息管理登录后显示更多信息 - 增加解析上传IP地址 (使用方法参考提示信息) - 修复图片详细信息中随机图片排版混乱 - 替换访问生成缩略图代码 - 更新一些组件 - 调整前端显示 - 优化代码 --- README.md | 14 +- admin/admin.inc.php | 54 ++-- application/bing.php | 38 +-- application/check_admin.inc.php | 39 ++- application/function.php | 40 +++ application/history.php | 2 +- application/info.php | 20 +- application/ip2region/Ip2Region.php | 69 ++++ application/ip2region/XdbSearcher.php | 368 ++++++++++++++++++++++ application/{read_log.php => viewlog.php} | 348 ++++++++++---------- config/config.php | 4 +- public/static/EasyImage.js | 26 +- 12 files changed, 759 insertions(+), 263 deletions(-) create mode 100644 application/ip2region/Ip2Region.php create mode 100644 application/ip2region/XdbSearcher.php rename application/{read_log.php => viewlog.php} (79%) mode change 100755 => 100644 diff --git a/README.md b/README.md index b5b91f4..ec53303 100755 --- a/README.md +++ b/README.md @@ -73,12 +73,12 @@ chown -R www:www /安装目录 3. 请关闭防跨站或删除域名文件夹内的`user.ini`文件 如`宝塔面板`|`军哥lnmp` 4. 网站域名与图片域名必须填写,如果只有一个域名请填写成一样的 5. 首次使用会执行安装程序并生成`install.lock` 跳过安装流程请删除`install`目录 -6. 首次访问首页会检查环境并在`config`目录下生成`EasyImage.lock` +6. 首次访问首页会检查环境并在`admin`目录下生成`EasyImage.lock` 7. 可以使用谷歌浏览器的调试模式查看错误`F12->console` -8. `upload File size exceeds the maximum value` 调整`PHP`上传大小 -9. `undefined function imagecreatefromwebp()`GD没安装webp, 以此类推 -10. `Warning: is_dir(): open_basedir restriction in effect`解决方法同`3` -11. 无法上传/访问/不显示验证码: 1. 权限问题见问题`1` 2. CDN缓存了 3. 开防火墙了 +8. 提示 `upload File size exceeds the maximum value` 调整`PHP`上传大小 +9. 提示 `undefined function imagecreatefromwebp()`GD没安装webp, 以此类推 +10. 提示 `Warning: is_dir(): open_basedir restriction in effect`解决方法同`3` +11. 无法上传/访问/不显示验证码: 1. 权限问题见问题`1` 2. CDN缓存了 3. 防火墙拦截 12. 宝塔或者其他环境安装成功但是上传失败,多数原因是防火墙拦截上传,取消拦截即可 13. `Fatal error: Allowed memory size......`主机内存或分配给PHP的内存不够 解决方法百度 14. 开启原图保护功能后打开图片链接显示`404`是因为`nginx`或`Apache`页面缓存导致的,`Nginx`解决办法: @@ -192,7 +192,6 @@ $HTTP["url"] =~ "^/(i|public)/" { fastcgi.server = () } ``` - - 或者参考:[https://blog.png.cm/996.html](https://blog.png.cm/996.html) ## 鉴黄 图床支持moderatecontent和nsfwjs方式鉴黄 @@ -231,13 +230,14 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 -* 2023-01-31 v2.7.0 dev +* 2023-02-01 v2.7.0 dev - 增加上传历史记录 - 增加粘贴上传状态 - 增加广场非图片图标 - 增加前端显示缩略图链接 - 增加每日获取Bing图片背景 - 增加图片详细信息管理登录后显示更多信息 +- 增加解析上传IP地址 (使用方法参考提示信息) - 修复图片详细信息中随机图片排版混乱 - 替换访问生成缩略图代码 - 更新一些组件 diff --git a/admin/admin.inc.php b/admin/admin.inc.php index 9747f7f..d89d668 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -483,7 +483,7 @@ if (isset($_GET['recycle_reimg'])) {
上传日志 需要开启上传日志
-
+
@@ -811,41 +811,51 @@ if (isset($_GET['recycle_reimg'])) {
图床信息

API 插件
- Edge - Chrome - ShareX - PicGo + Edge + Chrome + ShareX + PicGo
图床依赖

+ ZUI + Verot + Tinyfilemanager + Ip2Region - TinyPng + TinyPng - TinyPng + TinyPng - Moderatecontent + Moderatecontent - Moderatecontent + Moderatecontent - ZUI - Verot - Tinyfilemanager - - - - - GPL-2.0 + + GPL-2.0

EasyImage2.0简单图床构建于众多优秀的开源项目之上,非常感谢这些项目!

-
+
-

最新版本: 点击下载

-

更新日期:

-

更新内容:

-

更新后删除/admin/logs/verson/文件夹会自动同步最新版本号

+

Ip2region - IP地址数据库 下载 / 更新

+
+

+ Ip2region (2.0 - xdb) 是一个离线 IP 数据管理框架和定位库,支持亿级别的数据段,10微秒级别的查询性能,提供了许多主流编程语言的 xdb 数据管理引擎的实现。 + 每个 ip 数据段的 region 信息都固定了格式:国家|区域|省份|城市|ISP, 只有中国的数据绝大部分精确到了城市, 其他国家部分数据只能定位到国家, 后前的选项全部是0。 +

+
* 下载 ip2region.xdb IP数据库上传到 /application/ip2region/ 文件夹, 如遇到下载失败可访问开源地址下载: [ Github | Gitee ] 更新方法与此相同。
+ +
+

最新版本: 下载新版本

+
+

更新日期:

+

更新内容:

+
更新后删除 /admin/logs/verson/ 文件夹会自动同步最新版本号
+
+
diff --git a/application/bing.php b/application/bing.php index aae74d3..b41ca3a 100644 --- a/application/bing.php +++ b/application/bing.php @@ -10,10 +10,14 @@ include_once '../config/config.php'; -$path = __DIR__ . '/..' . $config['path'] . $config['delDir']; // 设置图片缓存文件夹 -$filename = date("Ymd") . '.jpg'; // 用年月日来命名新的文件名 -if (!file_exists($path . $filename)) // 如果文件不存在,则说明今天还没有进行缓存 +$path = '..' . $config['path'] . $config['delDir']; // 设置图片缓存文件夹 +$filename = date("Ymd") . '.jpg'; // 用年月日来命名新的文件名 +if (file_exists($path . $filename)) // 如果文件不存在,则说明今天还没有进行缓存 { + header("Content-type: image/jpeg"); + exit(file_get_contents($path . $filename, true)); +} else { + if (!file_exists($path)) //如果目录不存在 { mkdir($path, 0777); //创建缓存目录 @@ -22,31 +26,6 @@ if (!file_exists($path . $filename)) // 如果文件不存在,则说明 $str = json_decode($str, true); $imgurl = 'http://cn.bing.com' . $str['images'][0]['url']; //获取图片url $img = grabImage($imgurl, $path . $filename); //读取并保存图片 - /* - $handle = fopen("dat.txt", "a"); //用于存放图片信息,如果不需要保存图片的相关信息,可以把下面这些去掉。 - if ($handle) { - $copyright = $str['images'][0]['copyright']; //说明 - $startdate = $str['images'][0]['startdate']; - $fullstartdate = $str['images'][0]['fullstartdate']; - $enddate = $str['images'][0]['enddate']; - $urlbase = $str['images'][0]['urlbase']; - $copyrightlink = $str['images'][0]['copyrightlink']; - $quiz = $str['images'][0]['quiz']; - $wp = $str['images'][0]['wp']; - $hsh = $str['images'][0]['hsh']; - $drk = $str['images'][0]['drk']; - $top = $str['images'][0]['top']; - $bot = $str['images'][0]['bot']; - $tempArr = array( - "imgurl" => $imgurl, "copyright" => $copyright, "startdate" => $startdate, - "fullstartdate" => $fullstartdate, "enddate" => $enddate, "urlbase" => $urlbase, - "copyrightlink" => $copyrightlink, "quiz" => $quiz, "wp" => $wp, - "hsh" => $hsh, "drk" => $drk, "top" => $top, "bot" => $bot - ); //将相关信息放进数组中 - fwrite($handle, json_encode($tempArr) . "\r\n"); //最终以json格式保存在文本文档中 - fclose($handle); - } - */ } /** * 远程抓取图片并保存 @@ -65,8 +44,7 @@ function grabImage($url, $filename = "") readfile($url); //输出图片文件 $img = ob_get_contents(); //得到浏览器输出 ob_end_clean(); //清除输出并关闭 - $size = strlen($img); //得到图片大小 - $fp2 = @fopen($filename, "a"); + $fp2 = @fopen($filename, "w+"); fwrite($fp2, $img); //向当前目录写入图片文件,并重新命名 fclose($fp2); return $filename; //返回新的文件名 diff --git a/application/check_admin.inc.php b/application/check_admin.inc.php index 947ecff..904a5dc 100755 --- a/application/check_admin.inc.php +++ b/application/check_admin.inc.php @@ -6,7 +6,7 @@ if (PHP_VERSION < 7) { '; @@ -19,7 +19,8 @@ foreach ($expand as $val) { '; @@ -32,7 +33,7 @@ if ($config['password'] === 'e6e061838856bf47e1de730719fb2609') { '; @@ -43,7 +44,8 @@ if (is_local($config['domain']) || is_local($config['imgurl'])) { echo ' '; @@ -55,7 +57,19 @@ if (file_exists(APP_ROOT . '/.user.ini')) { + '; +} + +// 检测是否存在 IP数据库文件 ip2region.xdb +if (!file_exists(__DIR__ . '/ip2region/ip2region.xdb')) { + echo ' + '; @@ -67,7 +81,7 @@ if (getVersion() !== get_current_version()) { '; @@ -88,7 +102,7 @@ if (!is_file(APP_ROOT . $config['waterImg'])) { '; @@ -100,7 +114,7 @@ if (!is_file(APP_ROOT . $config['textFont'])) { '; @@ -115,7 +129,8 @@ if ($config['checkImg'] !== 0) { echo ' '; @@ -132,7 +147,8 @@ if ($config['checkImg'] !== 0) { echo ' '; @@ -142,7 +158,8 @@ if ($config['checkImg'] !== 0) { echo ' '; diff --git a/application/function.php b/application/function.php index 851625a..cc5d5fa 100755 --- a/application/function.php +++ b/application/function.php @@ -1515,3 +1515,43 @@ function get_current_version($file = '/admin/version.php') return 'No Version File'; } + +/** + * IP地址查询 + */ +function ip2region(String $IP) +{ + $db = __DIR__ . '/ip2region/ip2region.xdb'; + + if (!is_file($db)) { + return 'IP数据库不存在'; + } + + try { + require_once __DIR__ . '/ip2region/Ip2Region.php'; + $ip2region = new Ip2Region(); + $location = $ip2region->memorySearch($IP); + $location = $location['region']; + $location = str_replace(array('0', '||'), '', $location); + return $location; + } catch (Exception $e) { + return '查询失败: ' . $e->getMessage(); + } + + /* 官方查询示例 + require 'Ip2Region.php'; + + $ip2region = new Ip2Region(); + + $ip = '107.148.129.110'; + echo PHP_EOL; + echo "查询IP:{$ip}" . PHP_EOL; + $info = $ip2region->btreeSearch($ip); + var_export($info); + + echo PHP_EOL; + $info = $ip2region->memorySearch($ip); + var_export($info); + echo PHP_EOL; + */ +} diff --git a/application/history.php b/application/history.php index 30a3c17..167a93e 100644 --- a/application/history.php +++ b/application/history.php @@ -28,7 +28,7 @@ include_once __DIR__ . "/header.php"; $('.listNum').append('') } }) - $('.history_clear').append('

'); + $('.history_clear').append('

'); } else { $('.listNum').append('

上传历史记录不存在~~
非上传记录 | 清空缓存 | 浏览器版本低不显示~!

'); }; diff --git a/application/info.php b/application/info.php index 7b2f863..fcf4f3e 100755 --- a/application/info.php +++ b/application/info.php @@ -33,7 +33,7 @@ $logsName = basename($img_url); if (is_file(APP_ROOT . '/admin/logs/upload/' . $logs . '.php')) { include APP_ROOT . '/admin/logs/upload/' . $logs . '.php'; } else { - $logs = array($logsName => array('source' => '日志文件不存在', 'date' => '日志文件不存在', 'ip' => '日志文件不存在', 'port' => '日志文件不存在', 'user_agent' => '日志文件不存在', 'path' => '日志文件不存在', 'size' => '日志文件不存在', 'md5' => '日志文件不存在', 'checkImg' => '日志文件不存在', 'from' => '日志文件不存在')); + $logs = array($logsName => array('source' => '日志文件不存在', 'date' => '日志文件不存在', 'ip' => '0.0.0.0', 'port' => '日志文件不存在', 'user_agent' => '日志文件不存在', 'path' => '日志文件不存在', 'size' => '日志文件不存在', 'md5' => '日志文件不存在', 'checkImg' => '日志文件不存在', 'from' => '日志文件不存在')); } // 图片真实路径 @@ -57,11 +57,11 @@ if ($config['ad_top']) echo $config['ad_top_info']; <?php echo $img_url; ?>
- +
- + @@ -82,7 +82,7 @@ if ($config['ad_top']) echo $config['ad_top_info']; - + @@ -93,12 +93,16 @@ if ($config['ad_top']) echo $config['ad_top_info']; - - + + - - + + + + + + diff --git a/application/ip2region/Ip2Region.php b/application/ip2region/Ip2Region.php new file mode 100644 index 0000000..8502c20 --- /dev/null +++ b/application/ip2region/Ip2Region.php @@ -0,0 +1,69 @@ + + * @datetime 2022/07/18 + */ +class Ip2Region +{ + /** + * 查询实例对象 + * @var XdbSearcher + */ + private $searcher; + + /** + * 初始化构造方法 + * @throws Exception + */ + public function __construct() + { + class_exists('XdbSearcher') || include(__DIR__ . '/XdbSearcher.php'); + $this->searcher = XdbSearcher::newWithFileOnly(__DIR__ . '/ip2region.xdb'); + } + + /** + * 兼容原 memorySearch 查询 + * @param string $ip + * @return array + * @throws Exception + */ + public function memorySearch($ip) + { + return ['city_id' => 0, 'region' => $this->searcher->search($ip)]; + } + + /** + * 兼容原 binarySearch 查询 + * @param string $ip + * @return array + * @throws Exception + */ + public function binarySearch($ip) + { + return $this->memorySearch($ip); + } + + /** + * 兼容原 btreeSearch 查询 + * @param string $ip + * @return array + * @throws Exception + */ + public function btreeSearch($ip) + { + return $this->memorySearch($ip); + } + + /** + * destruct method + * resource destroy + */ + public function __destruct() + { + $this->searcher->close(); + unset($this->searcher); + } +} \ No newline at end of file diff --git a/application/ip2region/XdbSearcher.php b/application/ip2region/XdbSearcher.php new file mode 100644 index 0000000..d3168d2 --- /dev/null +++ b/application/ip2region/XdbSearcher.php @@ -0,0 +1,368 @@ + +// @Date 2022/06/21 + +class XdbSearcher +{ + const HeaderInfoLength = 256; + const VectorIndexRows = 256; + const VectorIndexCols = 256; + const VectorIndexSize = 8; + const SegmentIndexSize = 14; + + // xdb file handle + private $handle = null; + + // header info + private $header = null; + private $ioCount = 0; + + // vector index in binary string. + // string decode will be faster than the map based Array. + private $vectorIndex = null; + + // xdb content buffer + private $contentBuff = null; + + // --- + // static function to create searcher + + /** + * @throws Exception + */ + public static function newWithFileOnly($dbFile) + { + return new XdbSearcher($dbFile, null, null); + } + + /** + * @throws Exception + */ + public static function newWithVectorIndex($dbFile, $vIndex) + { + return new XdbSearcher($dbFile, $vIndex); + } + + /** + * @throws Exception + */ + public static function newWithBuffer($cBuff) + { + return new XdbSearcher(null, null, $cBuff); + } + + // --- End of static creator + + /** + * initialize the xdb searcher + * @throws Exception + */ + function __construct($dbFile = null, $vectorIndex = null, $cBuff = null) + { + // check the content buffer first + if ($cBuff != null) { + $this->vectorIndex = null; + $this->contentBuff = $cBuff; + } else { + // 加载默认数据文件 by Anyon + if (is_null($dbFile)) { + $dbFile = __DIR__ . DIRECTORY_SEPARATOR . 'ip2region.xdb'; + } + // open the xdb binary file + $this->handle = fopen($dbFile, "r"); + if ($this->handle === false) { + throw new Exception("failed to open xdb file '%s'", $dbFile); + } + + $this->vectorIndex = $vectorIndex; + } + } + + function close() + { + if ($this->handle != null) { + fclose($this->handle); + } + } + + function getIOCount() + { + return $this->ioCount; + } + + /** + * find the region info for the specified ip address + * @throws Exception + */ + function search($ip) + { + // check and convert the sting ip to a 4-bytes long + if (is_string($ip)) { + $t = self::ip2long($ip); + if ($t === null) { + throw new Exception("invalid ip address `$ip`"); + } + $ip = $t; + } + + // reset the global counter + $this->ioCount = 0; + + // locate the segment index block based on the vector index + $il0 = ($ip >> 24) & 0xFF; + $il1 = ($ip >> 16) & 0xFF; + $idx = $il0 * self::VectorIndexCols * self::VectorIndexSize + $il1 * self::VectorIndexSize; + if ($this->vectorIndex != null) { + $sPtr = self::getLong($this->vectorIndex, $idx); + $ePtr = self::getLong($this->vectorIndex, $idx + 4); + } elseif ($this->contentBuff != null) { + $sPtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx); + $ePtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx + 4); + } else { + // read the vector index block + $buff = $this->read(self::HeaderInfoLength + $idx, 8); + if ($buff === null) { + throw new Exception("failed to read vector index at ${idx}"); + } + + $sPtr = self::getLong($buff, 0); + $ePtr = self::getLong($buff, 4); + } + + // printf("sPtr: %d, ePtr: %d\n", $sPtr, $ePtr); + + // binary search the segment index to get the region info + $dataLen = 0; + $dataPtr = null; + $l = 0; + $h = ($ePtr - $sPtr) / self::SegmentIndexSize; + while ($l <= $h) { + $m = ($l + $h) >> 1; + $p = $sPtr + $m * self::SegmentIndexSize; + + // read the segment index + $buff = $this->read($p, self::SegmentIndexSize); + if ($buff == null) { + throw new Exception("failed to read segment index at ${p}"); + } + + $sip = self::getLong($buff, 0); + if ($ip < $sip) { + $h = $m - 1; + } else { + $eip = self::getLong($buff, 4); + if ($ip > $eip) { + $l = $m + 1; + } else { + $dataLen = self::getShort($buff, 8); + $dataPtr = self::getLong($buff, 10); + break; + } + } + } + + // match nothing interception. + // @TODO: could this even be a case ? + // printf("dataLen: %d, dataPtr: %d\n", $dataLen, $dataPtr); + if ($dataPtr == null) { + return null; + } + + // load and return the region data + $buff = $this->read($dataPtr, $dataLen); + if ($buff == null) { + return null; + } + + return $buff; + } + + // read specified bytes from the specified index + private function read($offset, $len) + { + // check the in-memory buffer first + if ($this->contentBuff != null) { + return substr($this->contentBuff, $offset, $len); + } + + // read from the file + $r = fseek($this->handle, $offset); + if ($r == -1) { + return null; + } + + $this->ioCount++; + $buff = fread($this->handle, $len); + if ($buff === false) { + return null; + } + + if (strlen($buff) != $len) { + return null; + } + + return $buff; + } + + // --- static util functions ---- + + // convert a string ip to long + public static function ip2long($ip) + { + $ip = ip2long($ip); + if ($ip === false) { + return null; + } + + // convert signed int to unsigned int if on 32 bit operating system + if ($ip < 0 && PHP_INT_SIZE == 4) { + $ip = sprintf("%u", $ip); + } + + return $ip; + } + + // read a 4bytes long from a byte buffer + public static function getLong($b, $idx) + { + $val = (ord($b[$idx])) | (ord($b[$idx + 1]) << 8) + | (ord($b[$idx + 2]) << 16) | (ord($b[$idx + 3]) << 24); + + // convert signed int to unsigned int if on 32 bit operating system + if ($val < 0 && PHP_INT_SIZE == 4) { + $val = sprintf("%u", $val); + } + + return $val; + } + + // read a 2bytes short from a byte buffer + public static function getShort($b, $idx) + { + return ((ord($b[$idx])) | (ord($b[$idx + 1]) << 8)); + } + + // load header info from a specified file handle + public static function loadHeader($handle) + { + if (fseek($handle, 0) == -1) { + return null; + } + + $buff = fread($handle, self::HeaderInfoLength); + if ($buff === false) { + return null; + } + + // read bytes length checking + if (strlen($buff) != self::HeaderInfoLength) { + return null; + } + + // return the decoded header info + return [ + 'version' => self::getShort($buff, 0), + 'indexPolicy' => self::getShort($buff, 2), + 'createdAt' => self::getLong($buff, 4), + 'startIndexPtr' => self::getLong($buff, 8), + 'endIndexPtr' => self::getLong($buff, 12) + ]; + } + + // load header info from the specified xdb file path + public static function loadHeaderFromFile($dbFile) + { + $handle = fopen($dbFile, 'r'); + if ($handle === false) { + return null; + } + + $header = self::loadHeader($handle); + fclose($handle); + return $header; + } + + // load vector index from a file handle + public static function loadVectorIndex($handle) + { + if (fseek($handle, self::HeaderInfoLength) == -1) { + return null; + } + + $rLen = self::VectorIndexRows * self::VectorIndexCols * self::SegmentIndexSize; + $buff = fread($handle, $rLen); + if ($buff === false) { + return null; + } + + if (strlen($buff) != $rLen) { + return null; + } + + return $buff; + } + + // load vector index from a specified xdb file path + public static function loadVectorIndexFromFile($dbFile) + { + $handle = fopen($dbFile, 'r'); + if ($handle === false) { + return null; + } + + $vIndex = self::loadVectorIndex($handle); + fclose($handle); + return $vIndex; + } + + // load the xdb content from a file handle + public static function loadContent($handle) + { + if (fseek($handle, 0, SEEK_END) == -1) { + return null; + } + + $size = ftell($handle); + if ($size === false) { + return null; + } + + // seek to the head for reading + if (fseek($handle, 0) == -1) { + return null; + } + + $buff = fread($handle, $size); + if ($buff === false) { + return null; + } + + // read length checking + if (strlen($buff) != $size) { + return null; + } + + return $buff; + } + + // load the xdb content from a file path + public static function loadContentFromFile($dbFile) + { + $str = file_get_contents($dbFile, false); + if ($str === false) { + return null; + } else { + return $str; + } + } + + public static function now() + { + return (microtime(true) * 1000); + } + +} \ No newline at end of file diff --git a/application/read_log.php b/application/viewlog.php old mode 100755 new mode 100644 similarity index 79% rename from application/read_log.php rename to application/viewlog.php index 5187ee9..24921e8 --- a/application/read_log.php +++ b/application/viewlog.php @@ -1,164 +1,184 @@ -日志文件不存在!
'); - } - if (empty($logs)) { - throw new Exception('
没有上传日志!
'); - } -} catch (Exception $e) { - echo $e->getMessage(); - require_once APP_ROOT . '/application/footer.php'; - exit; -} -?> -
-
- -
-
-

建议使用分辨率 ≥ 1366*768px; 当前日志文件:

-
- - - -日志文件不存在!
'); + } + if (empty($logs)) { + throw new Exception('
没有上传日志!
'); + } +} catch (Exception $e) { + echo $e->getMessage(); + require_once APP_ROOT . '/application/footer.php'; + exit; +} +?> +
+
+ +
+
+

建议使用分辨率 ≥ 1366*768px; 当前日志文件:

+
+ + + +1, 'static_cdn'=>0, 'theme'=>'default', - 'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0', + 'static_cdn_url'=>'https://fastly.jsdelivr.net/gh/icret/EasyImages2.0', 'TinyPng_key'=>'', 'checkImg'=>0, 'checkImg_value'=>50, @@ -112,7 +112,7 @@ $config=Array 'guest_path_status'=>0, 'token_path_status'=>0, 'admin_path'=>'u', - 'update'=>'2023-01-30 23:08:30', + 'update'=>'2023-02-01 02:10:54', 'footer'=>'© Since 2018 EasyImage DMCA diff --git a/public/static/EasyImage.js b/public/static/EasyImage.js index c40f72f..eac4a1a 100755 --- a/public/static/EasyImage.js +++ b/public/static/EasyImage.js @@ -185,25 +185,14 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic xhr.onload = function () { var result = JSON.parse(this.responseText); if (result.result === 'success') { - var links = document.getElementById("links"); - links.innerHTML += result.url + "\n"; + document.getElementById("links").innerHTML += result.url + "\r\n"; + document.getElementById("bbscode").innerHTML += "[img]" + result.url + "[/img]\r\n"; + document.getElementById("markdown").innerHTML += "![" + result.srcName + "](" + result.url + ")\r\n"; + document.getElementById("html").innerHTML += '' + result.srcName + '\r\n'; + document.getElementById("thumb").innerHTML += result.thumb + "\r\n"; + document.getElementById("del").innerHTML += result.del + "\r\n"; - var bbscode = document.getElementById("bbscode"); - bbscode.innerHTML += "[img]" + result.url + "[/img]\n"; - - var markdown = document.getElementById("markdown"); - markdown.innerHTML += "![](" + result.url + ")\n"; - - var html = document.getElementById("html"); - html.innerHTML += "<img src=\"" + result.url + "\" />\n"; - - var del = document.getElementById("thumb"); - del.innerHTML += result.thumb + "\n"; - - var del = document.getElementById("del"); - del.innerHTML += result.del + "\n"; - - $.zui.messager.show('粘贴上传成功...', { + $.zui.messager.show(result.srcName + '上传成功', { icon: 'bell', time: 4000, type: 'success', @@ -226,6 +215,7 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic }); } }; + xhr.onerror = function () { $.zui.messager.show('因网络问题导致的上传失败...', { icon: 'bell',
图片名称
图片大小
原始名称
原始大小
是否监黄上传地址
上传来源监黄状态
上传方式
文件路径