Browse Source

1.工厂token验证问题 尝试性提交

training
zhenghaoyu 1 year ago
parent
commit
b470ce1061
  1. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java

@ -1,6 +1,5 @@
package com.logpm.factory.comfac.service.impl;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.comfac.mapper.FactoryTokenMapper;
import com.logpm.factory.comfac.service.IFactoryTokenService;
@ -11,7 +10,6 @@ import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Objects;
@ -26,11 +24,11 @@ public class FactoryTokenServiceImpl extends BaseServiceImpl<FactoryTokenMapper,
public boolean verifyToken(String token, String corpId) throws NoSuchAlgorithmException {
logger.info("#########verifyToken: 验证token开始");
//先生成token摘要
String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
// String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
//编写查询条件
QueryWrapper<FactoryToken> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token_abst",tokenAbst)
queryWrapper.eq("token",token)
.eq("corpid",corpId);
FactoryToken factoryToken = baseMapper.selectOne(queryWrapper);
if(Objects.isNull(factoryToken)){

Loading…
Cancel
Save