Commit 62e811e0 authored by liqin's avatar liqin 💬

bug fixed

parent 2a3844a9
......@@ -242,6 +242,12 @@
<version>2.3</version>
<scope>provided</scope>
</dependency>
<!-- QR Generator -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
......
......@@ -21,7 +21,6 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
......@@ -154,7 +153,7 @@ public class LoginController extends BaseController {
}
}
//密码解密
password=AESUtils.aesDecrypt(password);
password = AESUtils.aesDecrypt(password);
byte[] salt = user.getPasswordSalt();
String s1 = new String(SHA256PasswordEncryptionService.createPasswordHash(password, salt));
......@@ -197,10 +196,10 @@ public class LoginController extends BaseController {
// 将token信息存入Redis
stringRedisTemplate.opsForValue().set(SHIRO_JWT_TOKEN + token, user.getId(), 12, TimeUnit.HOURS);
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);
}
if (user.getExiredDate()!=null){
if (user.getExiredDate() != null) {
Long i = user.getExiredDate().toEpochDay() - LocalDate.now().toEpochDay();
resultMap.put("expireNum", i);
}
......@@ -307,7 +306,7 @@ public class LoginController extends BaseController {
String regFullUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/h5";
QrConfig config = new QrConfig(width, height);
config.setCharset(StandardCharsets.UTF_8);
config.setMargin(0);
config.setMargin(1);
config.setWidth(width);
config.setHeight(height);
final byte[] bytes = QrCodeUtil.generatePng(regFullUrl, config);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment