diff --git a/public/index.php b/public/index.php index f116d60..374b53a 100644 --- a/public/index.php +++ b/public/index.php @@ -145,13 +145,13 @@ function show_index() processData: false, contentType: false, success: function(data) { - if (data.code == 200) { - $("#" + data.id).html(data.src); - $("#" + data.id).prev().text('上传成功'); + if (data.code == 0) { + $("#" + queue[i].id).html(data.data.src); + $("#" + queue[i].id).prev().text('上传成功'); // $("#textareaId").append(data.src + "\n"); } else { - $("#" + data.id).html("上传失败"); - $("#" + data.id).prev().text('上传失败'); + $("#" + queue[i].id).html("上传失败"); + $("#" + queue[i].id).prev().text('上传失败'); } }, error: function(data) { @@ -242,6 +242,17 @@ function api_test() ]); } +function api_upload() +{ + echo_json([ + "code" => 0, + "msg" => "success", + "data" => [ + "src" => 123 + ] + ]); +} + // api func end ?>