From 0952cbdf40b589ff1b696e1c0a111326502af6ca Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 5 May 2024 15:08:27 +0000 Subject: [PATCH] improve user login --- themes/tajian/controller/FrontapiController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 9d4f2f6..6b23688 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -490,6 +490,9 @@ eof; if (!empty($userDataDir) && $action == 'register') { $err = '你已经注册,请直接登录'; return $this->renderJson(compact('code', 'msg', 'err')); + }else if (empty($userDataDir) && $action == 'login') { + $err = '你还没注册,请先注册'; + return $this->renderJson(compact('code', 'msg', 'err')); } @@ -630,6 +633,13 @@ eof; $err = "{$sms_code} 验证码已过期或错误,请检查是否输入正确"; } + if (empty($err)) { + $userDataDir = Common::getUserDataDir($cellphone); + if (empty($userDataDir)) { + $err = '你还没注册,请先注册'; + } + } + if (empty($err)) { //如果数据检查通过,尝试登录 $newUser = Common::saveUserIntoSession($cellphone); if (!empty($newUser)) {