From 00d8d2d8f5e32fd942ac0af021581c1b2f776fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=A7=80=E9=92=A2?= Date: Sun, 6 Oct 2019 17:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=94=A8=E6=88=B7/?= =?UTF-8?q?=E5=BA=94=E7=94=A8=20=E6=93=8D=E4=BD=9C=E6=97=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/App.php | 11 +++++++++++ application/admin/controller/User.php | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/application/admin/controller/App.php b/application/admin/controller/App.php index 9f98cd4..ff148d0 100644 --- a/application/admin/controller/App.php +++ b/application/admin/controller/App.php @@ -148,6 +148,10 @@ class App extends Base { } else { $appInfo = AdminApp::get($id); cache('AccessToken:' . $appInfo['app_secret'], null); + if($oldWiki = cache('WikiLogin:' . $id)) { + cache('WikiLogin:' . $oldWiki, null); + } + return $this->buildSuccess(); } } @@ -180,6 +184,10 @@ class App extends Base { } else { $appInfo = AdminApp::get($postData['id']); cache('AccessToken:' . $appInfo['app_secret'], null); + if($oldWiki = cache('WikiLogin:' . $postData['id'])) { + cache('WikiLogin:' . $oldWiki, null); + } + return $this->buildSuccess(); } } @@ -198,6 +206,9 @@ class App extends Base { cache('AccessToken:' . $appInfo['app_secret'], null); AdminApp::destroy($id); + if($oldWiki = cache('WikiLogin:' . $id)) { + cache('WikiLogin:' . $oldWiki, null); + } return $this->buildSuccess(); } diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index 4a1c225..97e1401 100644 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -162,6 +162,10 @@ class User extends Base { if ($res === false) { return $this->buildFailed(ReturnCode::DB_SAVE_ERROR); } else { + if($oldAdmin = cache('Login:' . $id)) { + cache('Login:' . $oldAdmin, null); + } + return $this->buildSuccess(); } } @@ -201,6 +205,9 @@ class User extends Base { 'group_id' => $groups ]); } + if($oldAdmin = cache('Login:' . $postData['id'])) { + cache('Login:' . $oldAdmin, null); + } return $this->buildSuccess(); } @@ -237,6 +244,9 @@ class User extends Base { $userData = AdminUserData::get(['uid' => $postData['id']]); $userData->head_img = $headImg; $userData->save(); + if($oldWiki = cache('WikiLogin:' . $postData['id'])) { + cache('WikiLogin:' . $oldWiki, null); + } return $this->buildSuccess(); } @@ -259,6 +269,9 @@ class User extends Base { } AdminUser::destroy($id); AdminAuthGroupAccess::destroy(['uid' => $id]); + if($oldAdmin = cache('Login:' . $id)) { + cache('Login:' . $oldAdmin, null); + } return $this->buildSuccess();