修复API
parent
22c6df735b
commit
6096ffe807
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . './../application/function.php';
|
require_once __DIR__ . '/../application/function.php';
|
||||||
require_once APP_ROOT . '/api/function_API.php';
|
require_once APP_ROOT . '/api/function_API.php';
|
||||||
require_once APP_ROOT . '/application/class.upload.php';
|
require_once APP_ROOT . '/application/class.upload.php';
|
||||||
require_once APP_ROOT . '/application/WaterMask.php';
|
require_once APP_ROOT . '/application/WaterMask.php';
|
||||||
|
@ -84,14 +84,14 @@ if ($handle->uploaded) {
|
||||||
// 上传成功后返回json数据
|
// 上传成功后返回json数据
|
||||||
$imageUrl = $config['imgurl'] . config_path() . $handle->file_dst_name;
|
$imageUrl = $config['imgurl'] . config_path() . $handle->file_dst_name;
|
||||||
$delUrl = $config['domain'] . '/application/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
$delUrl = $config['domain'] . '/application/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
||||||
|
|
||||||
$reJson = array(
|
$reJson = array(
|
||||||
"result" => "success",
|
"result" => "success",
|
||||||
"code" => 200,
|
"code" => 200,
|
||||||
"url" => $imageUrl,
|
"url" => $imageUrl,
|
||||||
|
"thumb" => $config['domain'] . '/application/thumb.php?img=' . config_path() . $handle->file_dst_name . '&width=300&height=300',
|
||||||
"del" => $delUrl,
|
"del" => $delUrl,
|
||||||
);
|
);
|
||||||
echo json_encode($reJson,JSON_UNESCAPED_UNICODE);
|
echo json_encode($reJson, JSON_UNESCAPED_UNICODE);
|
||||||
$handle->clean();
|
$handle->clean();
|
||||||
} else {
|
} else {
|
||||||
// 上传错误 code:403 客户端文件有问题
|
// 上传错误 code:403 客户端文件有问题
|
||||||
|
@ -102,8 +102,6 @@ if ($handle->uploaded) {
|
||||||
//"log" => $handle->log,
|
//"log" => $handle->log,
|
||||||
);
|
);
|
||||||
|
|
||||||
unset($handle);
|
|
||||||
header('Content-Type:application/json; charset=utf-8');
|
|
||||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,9 +111,5 @@ if ($handle->uploaded) {
|
||||||
@write_log(config_path() . $handle->file_dst_name, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, "API upload");
|
@write_log(config_path() . $handle->file_dst_name, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, "API upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建缩略图
|
|
||||||
if ($config['thumbnail']) {
|
|
||||||
@creat_thumbnail_images($handle->file_dst_name);
|
|
||||||
}
|
|
||||||
unset($handle);
|
unset($handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
安装程序锁定文件。
|
Loading…
Reference in New Issue