Commit b46c9865 by 肖康

Merge branch 'feature/20251222/notice' of…

Merge branch 'feature/20251222/notice' of http://git.ichunt.net/liyang/CMS-Message into feature/20251222/notice
parents 0848f05b 0339e91e
Showing with 1 additions and 3 deletions
...@@ -17,9 +17,7 @@ use Illuminate\Routing\Controller; ...@@ -17,9 +17,7 @@ use Illuminate\Routing\Controller;
ini_set("error_reporting","E_ALL & ~E_NOTICE"); ini_set("error_reporting","E_ALL & ~E_NOTICE");
// 1. 设置允许跨域的源地址(精准匹配你的前端域名) // 1. 设置允许跨域的源地址(精准匹配你的前端域名)
$allowedOriginArr = [ $allowedOriginArr = explode(',',env('ALLOWORIGIN','http://wms.liexin.net,http://order2.xiaokang.liexinlocal.com'));
'http://wms.liexin.net','http://order2.xiaokang.liexinlocal.com'
];
// 2. 检查请求头中的Origin是否为允许的域名 // 2. 检查请求头中的Origin是否为允许的域名
if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'],$allowedOriginArr)) { if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'],$allowedOriginArr)) {
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment