feat: 删除用户后,撤销用户的令牌
This commit is contained in:
parent
b495c80509
commit
b2408075c5
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user