Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
62e811e0
Commit
62e811e0
authored
Apr 16, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
2a3844a9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
pom.xml
pom.xml
+6
-0
LoginController.java
...nergy/chnmuseum/party/web/controller/LoginController.java
+4
-5
No files found.
pom.xml
View file @
62e811e0
...
@@ -242,6 +242,12 @@
...
@@ -242,6 +242,12 @@
<version>
2.3
</version>
<version>
2.3
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<!-- QR Generator -->
<dependency>
<groupId>
com.google.zxing
</groupId>
<artifactId>
javase
</artifactId>
<version>
3.4.1
</version>
</dependency>
<dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LoginController.java
View file @
62e811e0
...
@@ -21,7 +21,6 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -21,7 +21,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
@@ -154,7 +153,7 @@ public class LoginController extends BaseController {
...
@@ -154,7 +153,7 @@ public class LoginController extends BaseController {
}
}
}
}
//密码解密
//密码解密
password
=
AESUtils
.
aesDecrypt
(
password
);
password
=
AESUtils
.
aesDecrypt
(
password
);
byte
[]
salt
=
user
.
getPasswordSalt
();
byte
[]
salt
=
user
.
getPasswordSalt
();
String
s1
=
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
password
,
salt
));
String
s1
=
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
password
,
salt
));
...
@@ -197,10 +196,10 @@ public class LoginController extends BaseController {
...
@@ -197,10 +196,10 @@ public class LoginController extends BaseController {
// 将token信息存入Redis
// 将token信息存入Redis
stringRedisTemplate
.
opsForValue
().
set
(
SHIRO_JWT_TOKEN
+
token
,
user
.
getId
(),
12
,
TimeUnit
.
HOURS
);
stringRedisTemplate
.
opsForValue
().
set
(
SHIRO_JWT_TOKEN
+
token
,
user
.
getId
(),
12
,
TimeUnit
.
HOURS
);
String
firstPassword
=
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
"gb123456"
,
salt
));
String
firstPassword
=
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
"gb123456"
,
salt
));
if
(
firstPassword
.
equals
(
new
String
(
user
.
getPasswordHash
()))){
if
(
firstPassword
.
equals
(
new
String
(
user
.
getPasswordHash
())))
{
resultMap
.
put
(
"isDefault"
,
true
);
resultMap
.
put
(
"isDefault"
,
true
);
}
}
if
(
user
.
getExiredDate
()
!=
null
)
{
if
(
user
.
getExiredDate
()
!=
null
)
{
Long
i
=
user
.
getExiredDate
().
toEpochDay
()
-
LocalDate
.
now
().
toEpochDay
();
Long
i
=
user
.
getExiredDate
().
toEpochDay
()
-
LocalDate
.
now
().
toEpochDay
();
resultMap
.
put
(
"expireNum"
,
i
);
resultMap
.
put
(
"expireNum"
,
i
);
}
}
...
@@ -307,7 +306,7 @@ public class LoginController extends BaseController {
...
@@ -307,7 +306,7 @@ public class LoginController extends BaseController {
String
regFullUrl
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
+
":"
+
request
.
getServerPort
()
+
"/h5"
;
String
regFullUrl
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
+
":"
+
request
.
getServerPort
()
+
"/h5"
;
QrConfig
config
=
new
QrConfig
(
width
,
height
);
QrConfig
config
=
new
QrConfig
(
width
,
height
);
config
.
setCharset
(
StandardCharsets
.
UTF_8
);
config
.
setCharset
(
StandardCharsets
.
UTF_8
);
config
.
setMargin
(
0
);
config
.
setMargin
(
1
);
config
.
setWidth
(
width
);
config
.
setWidth
(
width
);
config
.
setHeight
(
height
);
config
.
setHeight
(
height
);
final
byte
[]
bytes
=
QrCodeUtil
.
generatePng
(
regFullUrl
,
config
);
final
byte
[]
bytes
=
QrCodeUtil
.
generatePng
(
regFullUrl
,
config
);
...
...
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