8
This commit is contained in:
+11
-5
@@ -122,9 +122,11 @@ class Jwt
|
||||
*
|
||||
* @param string $account 账号,用户名、邮箱、手机号
|
||||
* @param string $password 密码
|
||||
* @param string $type 登录方式
|
||||
* @param string $verifyType 验证方式
|
||||
* @return boolean
|
||||
*/
|
||||
public static function login($account, $password,$type=''): array|bool
|
||||
public static function login($account, $password='',$type='',$verifyType='password'): array|bool
|
||||
{
|
||||
if($type){
|
||||
$field = $type;
|
||||
@@ -150,10 +152,14 @@ class Jwt
|
||||
self::setError('Account is locked');
|
||||
return false;
|
||||
}
|
||||
//if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
self::setError('Password is incorrect');
|
||||
return false;
|
||||
if($verifyType == 'password'){
|
||||
//if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
self::setError('Password is incorrect');
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
captcha_verfiy($type,'login',$account);
|
||||
}
|
||||
|
||||
//直接登录会员
|
||||
|
||||
Reference in New Issue
Block a user