mirror of https://gitee.com/stylefeng/roses
【7.0.2】删除sql,去除没用配置
parent
507408463a
commit
bb8dfbb659
|
@ -134,24 +134,6 @@ public class AuthConfigExpander {
|
|||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_PARAM_NAME", String.class, DEFAULT_AUTH_PARAM_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会话信息是否增加保存在 cookie 中
|
||||
* <p>
|
||||
* 如果开启此开关,会发生两件事:
|
||||
* <p>
|
||||
* 1.则登录过程中创建会话时,会HttpServletResponse对象进行addCookie()操作
|
||||
* <p>
|
||||
* 2.获取当前用户token会多一个从cookie中获取token这个方式
|
||||
* <p>
|
||||
* 一般这个开关的开启,用在单体不分离的版本中
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 13:15
|
||||
*/
|
||||
public static Boolean getSessionAddToCookie() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SESSION_ADD_TO_COOKIE", Boolean.class, Boolean.FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会话保存在cookie中时,cooke的name
|
||||
*
|
||||
|
|
|
@ -72,7 +72,6 @@ public class LoginUserImpl implements LoginUserApi {
|
|||
}
|
||||
|
||||
// 3. 从cookie中获取token
|
||||
if (AuthConfigExpander.getSessionAddToCookie()) {
|
||||
String sessionCookieName = AuthConfigExpander.getSessionCookieName();
|
||||
Cookie[] cookies = request.getCookies();
|
||||
if (cookies != null && cookies.length > 0) {
|
||||
|
@ -85,7 +84,6 @@ public class LoginUserImpl implements LoginUserApi {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取不到token,直接告诉用户
|
||||
throw new AuthException(TOKEN_GET_ERROR);
|
||||
|
|
|
@ -193,13 +193,11 @@ public class DefaultSessionManager implements SessionManagerApi {
|
|||
@Override
|
||||
public void destroySessionCookie() {
|
||||
// 如果开启了cookie存储会话信息,则需要给HttpServletResponse添加一个cookie
|
||||
if (AuthConfigExpander.getSessionAddToCookie()) {
|
||||
String sessionCookieName = AuthConfigExpander.getSessionCookieName();
|
||||
Cookie cookie = sessionCookieCreator.createCookie(sessionCookieName, null, 0);
|
||||
HttpServletResponse response = HttpServletUtil.getResponse();
|
||||
response.addCookie(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LoginUser> onlineUserList() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,15 +0,0 @@
|
|||
-- 分离版本唯一区别是这个配置的值是false
|
||||
UPDATE `sys_config`
|
||||
SET `config_name` = '会话信息是否增加保存在cookie中',
|
||||
`config_code` = 'SYS_SESSION_ADD_TO_COOKIE',
|
||||
`config_value` = 'false',
|
||||
`sys_flag` = 'Y',
|
||||
`remark` = NULL,
|
||||
`status_flag` = 1,
|
||||
`group_code` = 'auth_config',
|
||||
`del_flag` = 'N',
|
||||
`create_time` = NULL,
|
||||
`create_user` = NULL,
|
||||
`update_time` = NULL,
|
||||
`update_user` = NULL
|
||||
WHERE `config_id` = 13;
|
Loading…
Reference in New Issue