feat: 删除用户后,撤销用户的令牌

This commit is contained in:
JaguarJack 2023-03-06 17:32:28 +08:00
parent b495c80509
commit b2408075c5

View File

@ -82,7 +82,12 @@ class UserController extends Controller
*/ */
public function destroy($id) public function destroy($id)
{ {
return $this->user->deleteBy($id); if ($this->user->deleteBy($id)) {
// 撤销用户的所有令牌
$this->user->tokens()->delete();
}
return true;
} }
/** /**