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
f87e1204
authored
Dec 23, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
0339e91e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
0 deletions
app/Http/Controllers/NoticeController.php
app/Http/Controllers/NoticeController.php
View file @
f87e1204
...
...
@@ -18,6 +18,7 @@ ini_set("error_reporting","E_ALL & ~E_NOTICE");
// 1. 设置允许跨域的源地址(精准匹配你的前端域名)
$allowedOriginArr
=
explode
(
','
,
env
(
'ALLOWORIGIN'
,
'http://wms.liexin.net,http://order2.xiaokang.liexinlocal.com'
));
// 2. 检查请求头中的Origin是否为允许的域名
if
(
isset
(
$_SERVER
[
'HTTP_ORIGIN'
])
&&
in_array
(
$_SERVER
[
'HTTP_ORIGIN'
],
$allowedOriginArr
))
{
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