mirror of https://gitee.com/stylefeng/roses
Merge remote-tracking branch 'origin/dev-7.1.6' into dev-7.1.6
commit
455c9c9b93
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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_code中的app code和当前启动的app 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
|
||||
|
|
Loading…
Reference in New Issue