From c64590c75e9d6119e2f6529bd711afdd3148a3c7 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sun, 2 Aug 2020 00:15:33 +0800 Subject: [PATCH] =?UTF-8?q?API=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 api/api.php diff --git a/api/api.php b/api/api.php new file mode 100644 index 0000000..1425895 --- /dev/null +++ b/api/api.php @@ -0,0 +1,29 @@ +set_url($_GET['url'], $config['length']); + } else if(strstr($_GET['url'], $_SERVER['HTTP_HOST'])) { + $opt['content'] = '链接已经是短地址了。'; + } else if(!$is_link) { + $opt['content'] = '请输入正确格式的网址。'; + } + } else { + $opt['content'] = '调用参数不能为空。'; + } + // 输出 + echo json_encode($opt); +?>