更新网关
parent
e00d68ef89
commit
0a15f6acdd
|
@ -11,7 +11,7 @@ public class TokenConstants
|
|||
* 令牌自定义标识
|
||||
*/
|
||||
public static final String AUTHENTICATION = "Authorization";
|
||||
public static final String SESSIONID = "SESSIONID";
|
||||
public static final String SESSIONID = "Sessionid";
|
||||
|
||||
/**
|
||||
* 令牌前缀
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
@ -122,13 +123,9 @@ public class AuthFilter implements GlobalFilter, Ordered
|
|||
private String getToken(ServerHttpRequest request)
|
||||
{
|
||||
String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION);
|
||||
if (StringUtils.isNotEmpty(token))
|
||||
if (StringUtils.isEmpty(token))
|
||||
{
|
||||
token = request.getQueryParams().getFirst(TokenConstants.SESSIONID);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(token)){
|
||||
//TODO 解决报错问题
|
||||
request.getHeaders().set(TokenConstants.SESSIONID,token);
|
||||
token = request.getHeaders().getFirst(TokenConstants.SESSIONID);
|
||||
}
|
||||
// 如果前端设置了令牌前缀,则裁剪掉前缀
|
||||
if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX))
|
||||
|
|
|
@ -19,6 +19,7 @@ import doctor.util.OssUtil;
|
|||
import doctor.util.RSAUtils;
|
||||
import doctor.util.RsaKey;
|
||||
import doctor.util.SendEmail;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
|
|
@ -20,7 +20,7 @@ import doctor.system.service.ISysDictTypeService;
|
|||
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
|
@ -43,7 +43,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 根据字典类型查询字典数据
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
|
@ -89,7 +89,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
*
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
|
@ -101,7 +101,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
|
@ -113,7 +113,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 批量删除字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictIds 需要删除的字典ID
|
||||
*/
|
||||
@Override
|
||||
|
@ -167,7 +167,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 新增保存字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -184,7 +184,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 修改保存字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -205,13 +205,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
*
|
||||
*
|
||||
* @param dict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDictTypeUnique(SysDictType dict)
|
||||
{
|
||||
public boolean checkDictTypeUnique(SysDictType dict) {
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
|
||||
|
|
Loading…
Reference in New Issue