Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
70b100cb
authored
Dec 23, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
9f423879
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
app/Http/Controllers/NoticeController.php
app/Http/Controllers/NoticeController.php
View file @
70b100cb
...
@@ -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'
]
}
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment