【8.0】【auth】移除auth模块的两个配置

pull/57/head
fengshuonan 2023-08-09 23:13:02 +08:00
parent 0d46cba194
commit ff527561d9
3 changed files with 6 additions and 33 deletions

View File

@ -114,36 +114,6 @@ public class AuthConfigExpander {
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SINGLE_ACCOUNT_LOGIN_FLAG", Boolean.class, false); return ConfigContext.me().getSysConfigValueWithDefault("SYS_SINGLE_ACCOUNT_LOGIN_FLAG", Boolean.class, false);
} }
/**
* tokenheader
*
* @author fengshuonan
* @since 2020/10/22 14:11
*/
public static String getAuthTokenHeaderName() {
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_HEADER_NAME", String.class, DEFAULT_AUTH_HEADER_NAME);
}
/**
* tokenparam
*
* @author fengshuonan
* @since 2020/10/22 14:11
*/
public static String getAuthTokenParamName() {
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_PARAM_NAME", String.class, DEFAULT_AUTH_PARAM_NAME);
}
/**
* cookiecookename
*
* @author fengshuonan
* @since 2020/12/27 13:18
*/
public static String getSessionCookieName() {
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SESSION_COOKIE_NAME", String.class, DEFAULT_AUTH_HEADER_NAME);
}
/** /**
* jwtssotoken * jwtssotoken
* *

View File

@ -1,9 +1,9 @@
package cn.stylefeng.roses.kernel.auth.api.loginuser; package cn.stylefeng.roses.kernel.auth.api.loginuser;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.auth.api.constants.AuthConstants;
import cn.stylefeng.roses.kernel.auth.api.exception.AuthException; import cn.stylefeng.roses.kernel.auth.api.exception.AuthException;
import cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum; import cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum;
import cn.stylefeng.roses.kernel.auth.api.expander.AuthConfigExpander;
import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil; import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -28,7 +28,7 @@ public class CommonLoginUserUtil {
HttpServletRequest request = HttpServletUtil.getRequest(); HttpServletRequest request = HttpServletUtil.getRequest();
// 1. 优先从param参数中获取token // 1. 优先从param参数中获取token
String parameterToken = request.getParameter(AuthConfigExpander.getAuthTokenParamName()); String parameterToken = request.getParameter(AuthConstants.DEFAULT_AUTH_PARAM_NAME);
// 不为空则直接返回param的token // 不为空则直接返回param的token
if (StrUtil.isNotBlank(parameterToken)) { if (StrUtil.isNotBlank(parameterToken)) {
@ -36,7 +36,7 @@ public class CommonLoginUserUtil {
} }
// 2. 从header中获取token // 2. 从header中获取token
String authToken = request.getHeader(AuthConfigExpander.getAuthTokenHeaderName()); String authToken = request.getHeader(AuthConstants.DEFAULT_AUTH_HEADER_NAME);
if (StrUtil.isNotBlank(authToken)) { if (StrUtil.isNotBlank(authToken)) {
return authToken; return authToken;
} }

View File

@ -0,0 +1,3 @@
delete from sys_config where config_code = 'SYS_AUTH_PARAM_NAME';
delete from sys_config where config_code = 'SYS_AUTH_HEADER_NAME';
delete from sys_config where config_code = 'SYS_SESSION_COOKIE_NAME';