Skip to content

Commit 8700951

Browse files
committed
fix: 应用无法单独设置 cors Origin 导致的跨域问题
1 parent 5e5afa3 commit 8700951

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/Traits/ResponseTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function success($data = [], $err_msg = 'success', $err_code = 200, $head
3333
\json_encode($res, \JSON_UNESCAPED_SLASHES|\JSON_UNESCAPED_UNICODE),
3434
Response::HTTP_OK,
3535
array_merge([
36-
'Access-Control-Allow-Origin' => '*',
3736
'Content-Type' => 'application/json',
3837
], $headers)
3938
);
@@ -49,7 +48,6 @@ public function fail($err_msg = 'unknown error', $err_code = 400, $data = []) {
4948
$err_msg,
5049
$err_code,
5150
array_merge([
52-
'Access-Control-Allow-Origin' => '*',
5351
], $headers)
5452
);
5553
}

src/Traits/WebmanResponseTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function success($data = [], $err_msg = 'success', $err_code = 200, $head
3333
\json_encode($res, \JSON_UNESCAPED_SLASHES|\JSON_UNESCAPED_UNICODE),
3434
Response::HTTP_OK,
3535
array_merge([
36-
'Access-Control-Allow-Origin' => '*',
3736
'Content-Type' => 'application/json',
3837
], $headers)
3938
);
@@ -50,7 +49,6 @@ public function fail($err_msg = 'unknown error', $err_code = 400, $data = [], $h
5049
$err_msg,
5150
$err_code,
5251
array_merge([
53-
'Access-Control-Allow-Origin' => '*',
5452
], $headers)
5553
);
5654
}

0 commit comments

Comments
 (0)