Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c71426b4
...
c71426b4e8774cb1fd086eb82c803923af9b2d4e
authored
2022-07-12 17:30:22 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
请求数据
1 parent
ebede106
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
app/Http/Middleware/AuthIdentifier.php
app/Services/IssueService.php
routes/api.php
app/Http/Middleware/AuthIdentifier.php
View file @
c71426b
app/Services/IssueService.php
View file @
c71426b
...
...
@@ -5,7 +5,6 @@ namespace App\Services;
use
App\Helper\AesEncrypt
;
use
App\Helper\ErrorCode
;
use
App\Helper\Response
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\Log
;
/**
...
...
@@ -20,14 +19,11 @@ class IssueService extends Service
*/
public
function
forward
()
{
$client
=
new
Client
([
$client
=
new
\GuzzleHttp\
Client
([
'base_uri'
=>
env
(
'resource_url'
),
'timeout'
=>
3.0
,
]);
$method
=
$this
->
request
->
getMethod
();
$data
=
[];
try
{
$params
[
'data'
]
=
$this
->
request
->
all
();
...
...
@@ -35,10 +31,13 @@ class IssueService extends Service
'user_id'
=>
$this
->
identifier
->
user_id
,
'stakeholder_ids'
=>
$this
->
stakeholder_ids
,
];
$data
[
'json'
]
=
[
'params'
=>
AesEncrypt
::
encrypt
(
json_encode
(
$params
))];
$response
=
$client
->
request
(
$method
,
$this
->
request
->
getRequestUri
(),
$data
);
$data
=
[
'params'
=>
AesEncrypt
::
encrypt
(
json_encode
(
$params
))];
$response
=
$client
->
post
(
'/api/issue/status/album'
,
[
'json'
=>
$data
,
]);
$respArr
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
return
response
()
->
json
(
$respArr
,
200
);
}
catch
(
\Throwable
$throwable
)
{
return
Response
::
error
(
ErrorCode
::
SERVER_ERROR
,
$throwable
->
getMessage
());
...
...
routes/api.php
View file @
c71426b
...
...
@@ -55,7 +55,7 @@ Route::group([], function (){
//发行
Route
::
group
([
"prefix"
=>
"issue"
],
function
(){
Route
::
any
(
'{uri}'
,
'IssueController@index'
)
->
where
([
'uri'
=>
'[\w_]{1,}
'
]);
Route
::
post
(
'{uri}'
,
'IssueController@index'
)
->
where
([
'uri'
=>
'.*+
'
]);
});
...
...
Please
register
or
sign in
to post a comment