Browse Source

improve user login

master
filesite 7 months ago
parent
commit
0952cbdf40
  1. 10
      themes/tajian/controller/FrontapiController.php

10
themes/tajian/controller/FrontapiController.php

@ -490,6 +490,9 @@ eof; @@ -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; @@ -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)) {

Loading…
Cancel
Save