mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
fix: 修复接口模式不能退出的问题
This commit is contained in:
@@ -463,9 +463,8 @@ class AdminControllerBase extends BaseController
|
||||
{
|
||||
$adminConfig = config('admin');
|
||||
|
||||
$header_authorization = $this->request->header('Authorization');
|
||||
if (!empty($header_authorization)) {
|
||||
$token = explode(' ', $header_authorization)[1];
|
||||
$token = $this->readHeaderToken();
|
||||
if (!empty($token)) {
|
||||
$admin = Cache::get($token);
|
||||
} else {
|
||||
$admin = session('admin');
|
||||
@@ -528,6 +527,15 @@ class AdminControllerBase extends BaseController
|
||||
$this->assign('session_admin', $model_admin, -1);
|
||||
}
|
||||
|
||||
protected function readHeaderToken(){
|
||||
$header_authorization = $this->request->header('Authorization');
|
||||
if (!empty($header_authorization)) {
|
||||
$token = explode(' ', $header_authorization)[1];
|
||||
return $token;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 严格校验接口是否为POST请求
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user