mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修正接口token跨域header支持
This commit is contained in:
parent
a46c064d98
commit
6f898e5fdc
@ -39,11 +39,11 @@ class BasicApi
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
ToolsService::corsOptionsHandler();
|
||||
$this->request = app('request');
|
||||
Session::init(config('session.'));
|
||||
ToolsService::corsOptionsHandler();
|
||||
$sessionName = $this->request->header(session_name());
|
||||
empty($sessionName) || session_id($sessionName);
|
||||
$this->request = app('request');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,7 @@ class ToolsService
|
||||
header('Access-Control-Allow-Origin:*');
|
||||
header('Access-Control-Allow-Credentials:true');
|
||||
header('Access-Control-Allow-Methods:GET,POST,OPTIONS');
|
||||
header('Access-Control-Allow-Headers:Accept,Referer,Host,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Cookie');
|
||||
header('Access-Control-Allow-Headers:Accept,Referer,Host,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Cookie,' . session_name());
|
||||
header('Content-Type:text/plain charset=UTF-8');
|
||||
header('Access-Control-Max-Age:1728000');
|
||||
header('HTTP/1.0 204 No Content');
|
||||
|
Loading…
x
Reference in New Issue
Block a user