diff --git a/application/admin/controller/AppManager.php b/application/admin/controller/AppManager.php index 93a2163..861539b 100644 --- a/application/admin/controller/AppManager.php +++ b/application/admin/controller/AppManager.php @@ -137,6 +137,10 @@ class AppManager extends Base { $this->success('操作成功!', url('AppManager/index')); } }else{ + $auth = cache(CacheType::AUTH_LIST_KEY); +// if( !$auth ){ +// $this->error('请先配置认证方式!', url('OAuth/index')); +// } $form = [ 'formTitle' => $this->menuInfo['name'], 'tempType' => 'add', @@ -179,6 +183,16 @@ class AppManager extends Base { ] ] ], + [ + 'module' => 'select', + 'description' => '', + 'info' => '认证方式:', + 'attr' => [ + 'name' => 'oauth', + 'value' => '', + 'options' => $auth + ] + ], [ 'module' => 'textarea', 'description' => '', @@ -244,6 +258,10 @@ class AppManager extends Base { $appMemberModel->update($data); $this->success('操作成功!', url('AppManager/index')); }else{ + $auth = cache(CacheType::AUTH_LIST_KEY); +// if( !$auth ){ +// $this->error('请先配置认证方式!', url('OAuth/index')); +// } $detail = App::get($this->request->get($this->primaryKey))->toArray(); $form = [ 'formTitle' => $this->menuInfo['name'], @@ -297,6 +315,16 @@ class AppManager extends Base { ] ] ], + [ + 'module' => 'select', + 'description' => '', + 'info' => '认证方式:', + 'attr' => [ + 'name' => 'oauth', + 'value' => '', + 'options' => $auth + ] + ], [ 'module' => 'textarea', 'description' => '', diff --git a/application/admin/controller/Base.php b/application/admin/controller/Base.php index 8af6043..dfaad66 100644 --- a/application/admin/controller/Base.php +++ b/application/admin/controller/Base.php @@ -129,7 +129,7 @@ class Base extends Controller { $sidOld = cache($this->uid); if( isset($sidOld) && !empty($sidOld) ){ if( $sidOld != $sidNow ){ - $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login')); + $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login'), ReturnCode::ERROR_BY_REFRESH_PAGE); }else{ cache($this->uid, $sidNow, config('online_time')); $this->userInfo = User::get([ $this->primaryKey => $this->uid ])->toArray(); @@ -142,7 +142,7 @@ class Base extends Controller { // } } }else{ - $this->error("登录超时,请重新登录!", url('User/login')); + $this->error("登录超时,请重新登录!", url('User/login'), ReturnCode::ERROR_BY_REFRESH_PAGE); } }else{ $this->redirect('User/login'); diff --git a/application/admin/controller/CacheType.php b/application/admin/controller/CacheType.php index 5afc0d4..a9eb5ff 100644 --- a/application/admin/controller/CacheType.php +++ b/application/admin/controller/CacheType.php @@ -12,5 +12,6 @@ class CacheType { const FILTER_LIST_KEY = 'ApiAdmin:FilterList'; const APP_LIST_KEY = 'ApiAdmin:AppList'; + const AUTH_LIST_KEY = 'ApiAdmin:AuthList'; } \ No newline at end of file diff --git a/application/admin/controller/ReturnCode.php b/application/admin/controller/ReturnCode.php index 48dbce8..34b2dc5 100644 --- a/application/admin/controller/ReturnCode.php +++ b/application/admin/controller/ReturnCode.php @@ -15,4 +15,7 @@ class ReturnCode { const ERROR = 0; const GET_TEMPLATE_ERROR = 404; + const ERROR_BY_REFRESH_PAGE = 302; + + } \ No newline at end of file diff --git a/public/admin/static/js/template.js b/public/admin/static/js/template.js index 73d4955..f4b8fd8 100644 --- a/public/admin/static/js/template.js +++ b/public/admin/static/js/template.js @@ -96,7 +96,11 @@ $.alertMsg(data.msg); setTimeout(function() { if (data.url) { - location.href = data.url; + if( data.data == 302 ){ + location.href = data.url; + }else{ + $.refresh(data.url); + } } }, 1000*data.wait); }