增加回调提示与code码

pull/18/head
icret 2022-01-02 20:20:53 +08:00
parent 02d6d5a3f6
commit 15da21aa28
1 changed files with 9 additions and 5 deletions

View File

@ -88,20 +88,24 @@ if ($handle->uploaded) {
} }
$reJson = array( $reJson = array(
"result" => 'success', "result" => "success",
"code" => 200,
"url" => $imageUrl, "url" => $imageUrl,
"del" => $delUrl, "del" => $delUrl,
); );
echo json_encode($reJson); echo json_encode($reJson);
$handle->clean(); $handle->clean();
} else { } else {
// 上传错误 返回错误信息 // 上传错误 code:403 客户端文件有问题
$reJson = array( $reJson = array(
"result" => 'failed', "result" => "failed",
"code" => 403,
"message" => $handle->error, "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));
} }
// 上传日志控制 // 上传日志控制