优化代码

pull/376/MERGE
RuoYi 2 weeks ago
parent bec5600f16
commit 856c471472

@ -20,7 +20,7 @@ public class SecurityConstants
/**
*
*/
public static final String AUTHORIZATION_HEADER = "authorization";
public static final String AUTHORIZATION_HEADER = "Authorization";
/**
*

@ -7,11 +7,6 @@ package com.ruoyi.common.core.constant;
*/
public class TokenConstants
{
/**
*
*/
public static final String AUTHENTICATION = "Authorization";
/**
*
*/

@ -62,7 +62,7 @@ public class SecurityUtils
public static String getToken(HttpServletRequest request)
{
// 从header获取token标识
String token = request.getHeader(TokenConstants.AUTHENTICATION);
String token = request.getHeader(SecurityConstants.AUTHORIZATION_HEADER);
return replaceTokenPrefix(token);
}

@ -118,7 +118,7 @@ public class AuthFilter implements GlobalFilter, Ordered
*/
private String getToken(ServerHttpRequest request)
{
String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION);
String token = request.getHeaders().getFirst(SecurityConstants.AUTHORIZATION_HEADER);
// 如果前端设置了令牌前缀,则裁剪掉前缀
if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX))
{

@ -130,7 +130,7 @@ export default {
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
this.$modal.msgError(`文件格式不正确请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (file.name.includes(',')) {

Loading…
Cancel
Save