Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
cf191ace
Commit
cf191ace
authored
Dec 09, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上报错误方法改变
parent
799fad48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
AuthManager.java
...e/src/main/java/iot/sixiang/license/auth/AuthManager.java
+14
-9
No files found.
license/src/main/java/iot/sixiang/license/auth/AuthManager.java
View file @
cf191ace
...
...
@@ -80,9 +80,14 @@ public class AuthManager {
log
.
info
(
"in black..."
);
return
false
;
}
Apply
apply
=
allApply
.
get
(
appId
);
String
theAppId
=
device
.
getAppId
();
if
(
theAppId
==
null
)
{
log
.
info
(
"no real valid appId..."
);
return
false
;
}
Apply
apply
=
allApply
.
get
(
theAppId
);
String
appKey
=
apply
.
getAppKey
();
String
input
=
"app_id="
+
a
ppId
+
"&sn="
+
sn
;
String
input
=
"app_id="
+
theA
ppId
+
"&sn="
+
sn
;
String
valSHA1
=
HmacUtil
.
encrypt
(
input
,
appKey
,
HmacUtil
.
HMAC_SHA1
).
toUpperCase
();
if
(
CommonUtil
.
toUpperCaseByEnglish
(
sign
).
equals
(
CommonUtil
.
toUpperCaseByEnglish
(
valSHA1
)))
{
return
true
;
...
...
@@ -102,11 +107,6 @@ public class AuthManager {
return
false
;
}
DeviceVo
device
=
deviceManager
.
getDevice
(
sn
);
String
tempAppId
=
device
.
getAppId
();
if
(!
appId
.
equals
(
tempAppId
))
{
log
.
info
(
"appId and sn no matching ..."
);
return
false
;
}
// 未绑定
if
(
device
.
getSnBind
()
==
null
)
{
log
.
info
(
"bind sn null..."
);
...
...
@@ -117,9 +117,14 @@ public class AuthManager {
log
.
info
(
"in black..."
);
return
false
;
}
Apply
apply
=
allApply
.
get
(
appId
);
String
theAppId
=
device
.
getAppId
();
if
(
theAppId
==
null
)
{
log
.
info
(
"no real valid appId..."
);
return
false
;
}
Apply
apply
=
allApply
.
get
(
theAppId
);
String
appKey
=
apply
.
getAppKey
();
String
input
=
"app_id="
+
a
ppId
+
"&sn="
+
sn
+
"&sn_bind="
+
device
.
getSnBind
();
String
input
=
"app_id="
+
theA
ppId
+
"&sn="
+
sn
+
"&sn_bind="
+
device
.
getSnBind
();
String
valSHA1
=
HmacUtil
.
encrypt
(
input
,
appKey
,
HmacUtil
.
HMAC_SHA1
).
toUpperCase
();
if
(
CommonUtil
.
toUpperCaseByEnglish
(
sign
).
equals
(
CommonUtil
.
toUpperCaseByEnglish
(
valSHA1
)))
{
return
true
;
...
...
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