From 42f7966364e9d4d5487d3ac981820a2a64bc157e Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 2 May 2018 12:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/upload.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/functions/upload.php b/functions/upload.php index 362793e..316726b 100644 --- a/functions/upload.php +++ b/functions/upload.php @@ -36,17 +36,6 @@ //上传路径:目录 + 时间 $handle->process('../'.$updir.'/'.$current_time."/"); if ($handle->processed) { - //图片添加水印 - // if(($handle->image_dst_x >= 400) && ($handle->image_dst_y >= 400) && ($config['watermark'] != '')){ - // $handle->image_text = 'dsdsdds'; - // $handle->image_text_color = '#979797'; - // $handle->image_text_opacity = 50; - // $handle->image_text_font = './Arial Monospaced.ttf'; - // $handle->image_text_size = 16; - // $handle->image_text_x = 5; - // $handle->image_text_y = 5; - - // } //获取站点域名 $domain = $config['domain']; //生成文件hash @@ -95,7 +84,12 @@ echo $redata = json_encode($redata); $handle->clean(); } else { - echo 'error : ' . $handle->error; + //上传出现错误,返回报错信息 + $redata = array( + "code" => 0, + "msg" => $handle->error + ); + echo json_encode($redata); } } ?> \ No newline at end of file