Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
60fd1b79
Commit
60fd1b79
authored
Sep 25, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
户用光伏科士达获取token调整
parent
f84ef9ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
KSolarRequestUtil.java
...eejoin/amos/api/householdapi/Utils/KSolarRequestUtil.java
+4
-3
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/KSolarRequestUtil.java
View file @
60fd1b79
...
...
@@ -32,16 +32,17 @@ public class KSolarRequestUtil {
public
HashMap
<
String
,
Object
>
getHeader
()
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
requsetParams
=
new
HashMap
<>();
String
requestParam
=
""
;
HashMap
<
String
,
String
>
hashMaphead
=
new
HashMap
<>();
requsetParams
.
put
(
"username"
,
KSolarConstant
.
account
);
try
{
requsetParams
.
put
(
"password"
,
AESUtils
.
Encrypt
(
KSolarConstant
.
password
,
AESUtils
.
DEFAULT_SECRET_KEY
)
);
requestParam
=
"username="
+
KSolarConstant
.
account
+
"&password="
+
AESUtils
.
Encrypt
(
KSolarConstant
.
password
,
AESUtils
.
DEFAULT_SECRET_KEY
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
String
url
=
KSolarConstant
.
baseurl
+
KSolarConstant
.
tokenUrl
;
hashMaphead
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
);
hashMaphead
.
put
(
"Authorization"
,
"Basic "
+
Base64
.
getUrlEncoder
().
encodeToString
((
KSolarConstant
.
authUsername
+
":"
+
KSolarConstant
.
authPassword
).
getBytes
(
StandardCharsets
.
UTF_8
)));
String
ResPonse
=
HttpUtil
.
createPost
(
url
).
headerMap
(
hashMaphead
,
false
).
body
(
JSONObject
.
toJSONString
(
requsetParams
)
).
execute
().
body
();
String
ResPonse
=
HttpUtil
.
createPost
(
url
).
headerMap
(
hashMaphead
,
false
).
body
(
requestParam
).
execute
().
body
();
return
hashMap
;
}
...
...
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