Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
Easy Http SDK
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Back End
Easy Http SDK
Commits
7aad9780
Commit
7aad9780
authored
Mar 06, 2023
by
谢宇轩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改中间件接口描述,更新通用的401判断
parent
33d738fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Application.php
src/Application.php
+7
-0
MiddlewareInterface.php
src/Middleware/MiddlewareInterface.php
+5
-1
No files found.
src/Application.php
View file @
7aad9780
...
@@ -244,6 +244,13 @@ class Application implements ClientInterface
...
@@ -244,6 +244,13 @@ class Application implements ClientInterface
throw
new
ApplicationException
(
"SDK Upstream Failed"
,
$request
,
[]);
throw
new
ApplicationException
(
"SDK Upstream Failed"
,
$request
,
[]);
}
}
if
(
$response
->
getStatusCode
()
==
401
)
{
if
(
$this
->
logger
)
{
$this
->
logger
->
error
(
"sdk error, auth fail"
,
$context
);
}
throw
new
ApplicationException
(
"auth Failed"
,
$request
,
[]);
}
try
{
try
{
$rpcResult
=
$this
->
option
->
handlingPolicy
()
->
process
(
$response
);
$rpcResult
=
$this
->
option
->
handlingPolicy
()
->
process
(
$response
);
}
catch
(
GuiltyResultException
$exception
)
{
}
catch
(
GuiltyResultException
$exception
)
{
...
...
src/Middleware/MiddlewareInterface.php
View file @
7aad9780
...
@@ -5,5 +5,9 @@ namespace Jiwei\EasyHttpSdk\Middleware;
...
@@ -5,5 +5,9 @@ namespace Jiwei\EasyHttpSdk\Middleware;
interface
MiddlewareInterface
interface
MiddlewareInterface
{
{
/**
* @param callable $handler
* @return callable
*/
public
function
__invoke
(
callable
$handler
)
:
callable
;
}
}
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