强退删除用户会话

pull/197/MERGE
RuoYi 2020-08-16 11:03:17 +08:00
parent 4b8d578f4d
commit a4b0a7c0bb
3 changed files with 7 additions and 11 deletions

View File

@ -19,10 +19,6 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.FileUtils;
import java.io.File;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
/** /**
* *
* *

View File

@ -78,8 +78,7 @@ public class SysUserOnlineController extends BaseController
{ {
return error("当前登陆用户无法强退"); return error("当前登陆用户无法强退");
} }
onlineSession.setStatus(OnlineStatus.off_line); onlineSessionDAO.delete(onlineSession);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line); online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online); userOnlineService.saveOnline(online);
userOnlineService.removeUserCache(online.getLoginName(), sessionId); userOnlineService.removeUserCache(online.getLoginName(), sessionId);

View File

@ -149,7 +149,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils
* @param realFileName * @param realFileName
* @return * @return
*/ */
public static void setAttachmentResponseHeader(HttpServletResponse response,String realFileName) throws UnsupportedEncodingException { public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException
{
String percentEncodedFileName = percentEncode(realFileName); String percentEncodedFileName = percentEncode(realFileName);
StringBuilder contentDispositionValue = new StringBuilder(); StringBuilder contentDispositionValue = new StringBuilder();
@ -160,8 +161,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils
.append("utf-8''") .append("utf-8''")
.append(percentEncodedFileName); .append(percentEncodedFileName);
response.setHeader("Content-disposition", response.setHeader("Content-disposition", contentDispositionValue.toString());
contentDispositionValue.toString());
} }
/** /**
@ -170,8 +170,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils
* @param s * @param s
* @return * @return
*/ */
public static String percentEncode(String s) throws UnsupportedEncodingException { public static String percentEncode(String s) throws UnsupportedEncodingException
{
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
return encode .replaceAll("\\+", "%20"); return encode.replaceAll("\\+", "%20");
} }
} }