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
f91e80ae
authored
Dec 23, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
19505988
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
app/Http/Controllers/NoticeController.php
app/Http/Controllers/NoticeController.php
View file @
f91e80ae
...
...
@@ -63,13 +63,6 @@ class NoticeController extends Controller
}
private
function
codeExport
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
return
response
()
->
json
([
'code'
=>
$errcode
,
'msg'
=>
$errmsg
,
'data'
=>
$data
])
// 允许的源(生产环境替换为你的前端域名,如 https://www.example.com)
->
header
(
'Access-Control-Allow-Origin'
,
'*'
)
// 允许的请求方法
->
header
(
'Access-Control-Allow-Methods'
,
'GET, POST, PUT, DELETE, OPTIONS'
)
// 允许的请求头(包含前端常用的 Token/Content-Type 等)
->
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Authorization, X-Requested-With'
)
// 允许前端携带 Cookie(如需跨域传 Cookie 则添加)
->
header
(
'Access-Control-Allow-Credentials'
,
'true'
);
return
response
()
->
json
([
'code'
=>
$errcode
,
'msg'
=>
$errmsg
,
'data'
=>
$data
]);
}
}
\ No newline at end of file
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