This commit is contained in:
icret
2022-04-29 08:47:23 +00:00
parent 03a19b33bd
commit 1e8dbef50a
17 changed files with 601 additions and 342 deletions

View File

@@ -1,4 +1,7 @@
<?php
namespace Verot\Upload;
require_once __DIR__ . '/../application/function.php';
require_once APP_ROOT . '/application/class.upload.php';
require_once APP_ROOT . '/config/api_key.php';
@@ -38,7 +41,7 @@ if ($handle->uploaded) {
// 允许上传的mime类型
$handle->allowed = array('image/*');
// 文件命名
$handle->file_new_name_body = imgName($handle->file_src_name_body) . '_' . $tokenID;
$handle->file_new_name_body = imgName($handle->file_src_name_body) . '-' . $tokenID;
// 最大上传限制
$handle->file_max_sizes = $config['maxSize'];
// 最大宽度
@@ -67,8 +70,8 @@ if ($handle->uploaded) {
$pathIMG = config_path() . $handle->file_dst_name;
$imageUrl = $config['imgurl'] . $pathIMG;
// 原图保护 key值是由crc32加密的登录密码
$hide_original = $config['hide'] == 1 ? $config['domain'] . '/application/hide.php?key=' . urlHash($pathIMG, 0, crc32($config['password'])) : $imageUrl;
// 原图保护 key值是由crc32加密的hide_key
$hide_original = $config['hide'] == 1 ? $config['domain'] . '/application/hide.php?key=' . urlHash($pathIMG, 0, crc32($config['hide_key'])) : $imageUrl;
// 关闭上传后显示加密删除链接
if ($config['show_user_hash_del']) {