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();