后台封禁 让登录失效

This commit is contained in:
2026-01-03 14:17:47 +08:00
parent fce818807e
commit 630e67693f

View File

@@ -9,6 +9,7 @@ use think\Db;
use think\Hook;
use think\Session;
use think\Validate;
use app\common\library\Token as TokenLib;
/**
* 后台首页
@@ -272,6 +273,9 @@ class User extends adminApi
Db::name('block')->where($map)->delete();
Db::name('sms_error')->where(['mobile' => $user_info['mobile']])->delete();
}
$token = db::name('user_token')->where('user_id', $user_id)->value('token');
// 删除这个Token使其失效
TokenLib::delete($token);
return V(1,"成功", null);
}