更新docker-compose文件
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
package com.ai.da.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.constant.TokenConstant;
|
||||
import com.ai.da.common.enums.LoginTypeEnum;
|
||||
import com.ai.da.common.enums.OperationTypeEnum;
|
||||
import com.ai.da.common.httpdata.token.TokenQuery;
|
||||
import com.ai.da.common.security.jwt.JWTTokenHelper;
|
||||
import com.ai.da.common.utils.*;
|
||||
import com.ai.da.mapper.AccountMapper;
|
||||
@@ -19,25 +16,18 @@ import com.ai.da.model.vo.AuthPrincipalVo;
|
||||
import com.ai.da.service.AccountLoginLogService;
|
||||
import com.ai.da.service.AccountService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.util.RequestUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -75,6 +65,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
/*发送邮件*/
|
||||
OperationTypeEnum operationTypeEnum = OperationTypeEnum.of(accountDTO.getOperationType());
|
||||
log.info(account.getUserEmail());
|
||||
log.info(accountDTO.getEmail());
|
||||
Assert.isTrue(account.getUserEmail().equals(accountDTO.getEmail()), "Email error !");
|
||||
Assert.notNull(operationTypeEnum, "Unknown operation type!");
|
||||
String randomVerifyCode = RandomsUtil.generateVerifyCode(100000L, 999999L);
|
||||
LocalCacheUtils.setVerifyCodeCache(
|
||||
@@ -161,6 +154,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
calculateExceptionIp(RequestInfoUtil.getIpAddress(request), account);
|
||||
return response;
|
||||
}
|
||||
|
||||
private void validateUserValidaExpire(Account account) {
|
||||
Long currentTime = new Date().getTime();
|
||||
if (Objects.nonNull(account.getValidStartTime())) {
|
||||
@@ -170,6 +164,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
Assert.isTrue(currentTime <= account.getValidEndTime(), "User expired !");
|
||||
}
|
||||
}
|
||||
|
||||
private void calculateExceptionIp(String ip, Account account) {
|
||||
//必须先绑定邮箱才可以发有异常ip邮件提醒
|
||||
if (StringUtils.isNotBlank(account.getUserEmail())) {
|
||||
@@ -189,6 +184,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
//保存登入日志
|
||||
accountLoginLogService.saveLoginLog(ip, account.getId());
|
||||
}
|
||||
|
||||
private String createAccountToken(Long userId, String userName) {
|
||||
String token = LocalCacheUtils.getTokenCache(String.valueOf(userId));
|
||||
if (StringUtils.isNotBlank(token)) {
|
||||
@@ -237,6 +233,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
accountNew.setUserPassword(pwd);
|
||||
accountMapper.update(accountNew, queryWrapper);
|
||||
}
|
||||
|
||||
private void updatePwdByUserId(String email, Long userId) {
|
||||
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", userId);
|
||||
@@ -258,6 +255,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
queryWrapper.eq("user_name", userName);
|
||||
return accountMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
private Account getOneByUserId(Long userId) {
|
||||
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", userId);
|
||||
|
||||
@@ -41,26 +41,6 @@
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties"
|
||||
},
|
||||
{
|
||||
"name": "file.linux.path",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
||||
},
|
||||
{
|
||||
"name": "file.mac.path",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
||||
},
|
||||
{
|
||||
"name": "file.sys.path",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
||||
},
|
||||
{
|
||||
"name": "file.windows.path",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.auth-api",
|
||||
"type": "java.lang.String",
|
||||
|
||||
@@ -3,8 +3,8 @@ server.port=5567
|
||||
#datasource
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://18.167.251.121:33006/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
spring.datasource.username=nacos
|
||||
spring.datasource.password=nacos
|
||||
|
||||
#security
|
||||
spring.security.jwtSecret=JWTSECRET
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user