From b2408075c56bc810b1087148069474609e8daa9a Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 6 Mar 2023 17:32:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=92=A4=E9=94=80=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E4=BB=A4=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/User/Http/Controllers/UserController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/User/Http/Controllers/UserController.php b/modules/User/Http/Controllers/UserController.php index c62cbf1..bc19287 100644 --- a/modules/User/Http/Controllers/UserController.php +++ b/modules/User/Http/Controllers/UserController.php @@ -82,7 +82,12 @@ class UserController extends Controller */ public function destroy($id) { - return $this->user->deleteBy($id); + if ($this->user->deleteBy($id)) { + // 撤销用户的所有令牌 + $this->user->tokens()->delete(); + } + + return true; } /**