This commit is contained in:
commie
2026-01-12 12:42:08 +08:00
parent c153975eed
commit 61c5192018
27 changed files with 1283 additions and 112 deletions
+11 -5
View File
@@ -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);
}
//直接登录会员