From a4330baa146c4ff65157b2b0286e734562a4f43c Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 27 Jun 2024 23:47:27 +0800 Subject: [PATCH] Update api.php --- src/admin/api.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/admin/api.php b/src/admin/api.php index e95aa8c8..79684003 100644 --- a/src/admin/api.php +++ b/src/admin/api.php @@ -353,7 +353,15 @@ if ($action === 'is_need_check_code') { )); exit; } else if($action === 'upload_image') { - checkLogin(); + $cuserLogin = new userLogin(); + if ($cuserLogin->getUserID() <= 0) { + echo json_encode(array( + "code" => -1, + "msg" => "登录系统后才能上传图片", + "data" => null, + )); + exit; + } $imgfile_name = $_FILES["file"]['name']; $activepath = $cfg_image_dir; $allowedTypes = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/webp");