Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
d57c59e6
Commit
d57c59e6
authored
May 31, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
40e4487d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
HttpDaprUtil.java
...ifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
+8
-1
PermitAllUrlProperties.java
...ifu/common/security/component/PermitAllUrlProperties.java
+6
-6
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
View file @
d57c59e6
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
cn.hutool.json.JSONUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -67,8 +69,13 @@ public class HttpDaprUtil {
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
""
);
ResponseEntity
<
T
>
res
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
add
(
"Authorization"
,
null
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
(
param
,
headers
);
try
{
res
=
restTemplate
.
postForEntity
(
URI
.
create
(
stringBuffer
.
toString
()),
param
,
cs
);
res
=
restTemplate
.
postForEntity
(
URI
.
create
(
stringBuffer
.
toString
()),
entity
,
cs
);
}
catch
(
Exception
e
)
{
return
R
.
failed
(
"获取信息失败:"
+
e
.
getMessage
());
}
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/component/PermitAllUrlProperties.java
View file @
d57c59e6
...
...
@@ -65,16 +65,16 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
// 获取方法上边的注解 替代path variable 为 *
Inner
method
=
AnnotationUtils
.
findAnnotation
(
handlerMethod
.
getMethod
(),
Inner
.
class
);
if
(
null
!=
method
&&
null
!=
info
.
getPatternsCondition
()){
Optional
.
ofNullable
(
method
).
ifPresent
(
inner
->
info
.
getPatternsCondition
().
getPatterns
()
.
forEach
(
url
->
urls
.
add
(
ReUtil
.
replaceAll
(
url
,
PATTERN
,
"*"
))));
if
(
null
!=
method
&&
null
!=
info
.
getPat
hPat
ternsCondition
()){
Optional
.
ofNullable
(
method
).
ifPresent
(
inner
->
info
.
getPat
hPat
ternsCondition
().
getPatterns
()
.
forEach
(
url
->
urls
.
add
(
ReUtil
.
replaceAll
(
url
.
toString
()
,
PATTERN
,
"*"
))));
}
// 获取类上边的注解, 替代path variable 为 *
Inner
controller
=
AnnotationUtils
.
findAnnotation
(
handlerMethod
.
getBeanType
(),
Inner
.
class
);
if
(
null
!=
controller
&&
null
!=
info
.
getPatternsCondition
())
Optional
.
ofNullable
(
controller
).
ifPresent
(
inner
->
info
.
getPatternsCondition
().
getPatterns
()
.
forEach
(
url
->
urls
.
add
(
ReUtil
.
replaceAll
(
url
,
PATTERN
,
"*"
))));
if
(
null
!=
controller
&&
null
!=
info
.
getPat
hPat
ternsCondition
())
Optional
.
ofNullable
(
controller
).
ifPresent
(
inner
->
info
.
getPat
hPat
ternsCondition
().
getPatterns
()
.
forEach
(
url
->
urls
.
add
(
ReUtil
.
replaceAll
(
url
.
toString
()
,
PATTERN
,
"*"
))));
});
}
...
...
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