Merge remote-tracking branch 'origin/dev-7.1.6' into dev-7.1.6

pull/25/head
xixiaowei 2021-12-23 09:13:54 +08:00
commit 455c9c9b93
3 changed files with 20 additions and 12 deletions

View File

@ -195,6 +195,9 @@ public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLo
queryWrapper.ge(StrUtil.isNotBlank(sysLoginLogRequest.getBeginTime()), SysLoginLog::getCreateTime, beginDate);
queryWrapper.le(StrUtil.isNotBlank(sysLoginLogRequest.getEndTime()), SysLoginLog::getCreateTime, endDate);
// 根据创建时间降序排列
queryWrapper.orderByDesc(SysLoginLog::getCreateTime);
return queryWrapper;
}

View File

@ -364,17 +364,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
// 获取当前登录用户
Long userId = LoginContext.me().getLoginUser().getUserId();
return this.createOrUpdateCustomerSecret(userId);
}
@Override
public String createOrUpdateCustomerSecret(Long customerId) {
if (customerId == null) {
return null;
}
// 查看当前用户是否有秘钥
Customer customer = this.getById(customerId);
Customer customer = this.getById(userId);
if (StrUtil.isEmpty(customer.getSecretKey())) {
throw new CustomerException(CustomerExceptionEnum.NO_SECRET);
}
@ -384,6 +375,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
throw new CustomerException(CustomerExceptionEnum.SECRET_EXPIRED);
}
return this.createOrUpdateCustomerSecret(userId);
}
@Override
public String createOrUpdateCustomerSecret(Long customerId) {
if (customerId == null) {
return null;
}
// 重新生成秘钥
String randomString = RandomUtil.randomString(32);

View File

@ -2,13 +2,18 @@ package cn.stylefeng.roses.kernel.system.modular.resource.framework;
import cn.stylefeng.roses.kernel.system.modular.resource.service.ApiResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
* <p>
* resource_codeapp codeapp code
*
* @author majianguo
* @date 2021/12/2 11:58
*/
@ -17,7 +22,7 @@ import org.springframework.stereotype.Component;
@Order(Integer.MAX_VALUE - 1)
public class ApiResourceApplicationRunner implements ApplicationRunner {
@Autowired
@Resource
private ApiResourceService apiResourceService;
@Override