Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-app-report
Overview
Overview
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
Administrator
xzxt-app-report
Commits
183ddadc
Commit
183ddadc
authored
Jan 16, 2024
by
liulianglang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印调试
parent
764332a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
pom.xml
+2
-2
src/main/java/org/springblade/founder/forward/controller/ForwardController.java
+9
-3
No files found.
pom.xml
View file @
183ddadc
...
...
@@ -112,9 +112,9 @@
</dependency>
<!-- 数据库驱动包 -->
<dependency>
<groupId>
org
.oracle
</groupId>
<groupId>
com
.oracle
</groupId>
<artifactId>
ojdbc6
</artifactId>
<version>
1
0
</version>
<version>
1
1.2.0.3
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
<dependency>
...
...
src/main/java/org/springblade/founder/forward/controller/ForwardController.java
View file @
183ddadc
...
...
@@ -6,6 +6,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springblade.founder.log.LogOper
;
import
org.springblade.founder.utils.HttpUtil
;
import
org.springblade.founder.utils.R
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.context.request.RequestContextHolder
;
...
...
@@ -34,8 +35,8 @@ import java.util.Map;
@RestController
@RequestMapping
(
"/forward"
)
public
class
ForwardController
{
// @Value("httpUrl
")
private
String
host
=
"http://127.0.0.1:902
2
/"
;
@Value
(
"${httpUrl}
"
)
private
String
host
=
"http://127.0.0.1:902
6
/"
;
@RequestMapping
(
"/method"
)
public
R
method
(
HttpServletRequest
request
)
{
...
...
@@ -43,7 +44,11 @@ public class ForwardController {
if
(
StringUtils
.
isEmpty
(
url
))
{
return
R
.
error
(
"url不能为空"
);
}
System
.
out
.
println
(
"url:=="
+
url
);
System
.
out
.
println
(
"host:=="
+
host
);
String
type
=
request
.
getMethod
();
System
.
out
.
println
(
"url:=="
+
url
+
"type:==="
+
type
);
HashMap
<
String
,
String
>
headers
=
new
HashMap
<>();
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
while
(
headerNames
.
hasMoreElements
())
{
...
...
@@ -51,6 +56,7 @@ public class ForwardController {
if
(
"blade-auth"
.
equals
(
element
)
||
"authorization"
.
equals
(
element
))
{
String
header
=
request
.
getHeader
(
element
);
headers
.
put
(
element
,
header
);
System
.
out
.
println
(
"header:=="
+
element
);
}
}
if
(
"post"
.
equalsIgnoreCase
(
type
))
{
...
...
@@ -117,7 +123,7 @@ public class ForwardController {
if
(
StringUtils
.
isEmpty
(
url
))
{
return
R
.
error
(
"url不能为空"
);
}
System
.
out
.
println
(
"url:=="
+
url
);
HashMap
<
String
,
String
>
headers
=
new
HashMap
<>();
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
while
(
headerNames
.
hasMoreElements
())
{
...
...
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