diff --git a/file.php b/file.php index 4927bae..dde38fe 100755 --- a/file.php +++ b/file.php @@ -88,20 +88,24 @@ if ($handle->uploaded) { } $reJson = array( - "result" => 'success', + "result" => "success", + "code" => 200, "url" => $imageUrl, "del" => $delUrl, ); echo json_encode($reJson); $handle->clean(); } else { - // 上传错误 返回错误信息 + // 上传错误 code:403 客户端文件有问题 $reJson = array( - "result" => 'failed', + "result" => "failed", + "code" => 403, "message" => $handle->error, - "log" => $handle->log, + //"log" => $handle->log, ); - echo json_encode($reJson, JSON_UNESCAPED_UNICODE); + unset($handle); + header('Content-Type:application/json; charset=utf-8'); + exit(json_encode($reJson, JSON_UNESCAPED_UNICODE)); } // 上传日志控制