Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
aea69153
Commit
aea69153
authored
May 28, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在线用户强退方法合并
parent
8c88957b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
18 deletions
+6
-18
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
+4
-13
ruoyi-admin/src/main/resources/templates/monitor/online/online.html
+2
-5
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
View file @
aea69153
package
com
.
ruoyi
.
web
.
controller
.
monitor
;
import
java.util.List
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -9,12 +8,12 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.core.text.Convert
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.enums.OnlineStatus
;
import
com.ruoyi.framework.shiro.session.OnlineSession
;
...
...
@@ -57,21 +56,13 @@ public class SysUserOnlineController extends BaseController
return
getDataTable
(
list
);
}
/**
* 1、删除了 forceLogout 方法
* 2、将 batchForceLogout 和 forceLogout 的权限逻辑 改成了 OR【按需要设定】
* 3、@RequestParam("ids[]") ==> @RequestParam("ids")
* 4、开源拥有者 可以斟酌一下
* @param ids
* @return
*/
@RequiresPermissions
(
value
=
{
"monitor:online:batchForceLogout"
,
"monitor:online:forceLogout"
},
logical
=
Logical
.
OR
)
@RequiresPermissions
(
value
=
{
"monitor:online:batchForceLogout"
,
"monitor:online:forceLogout"
},
logical
=
Logical
.
OR
)
@Log
(
title
=
"在线用户"
,
businessType
=
BusinessType
.
FORCE
)
@PostMapping
(
"/batchForceLogout"
)
@ResponseBody
public
AjaxResult
batchForceLogout
(
@RequestParam
(
"ids"
)
String
[]
ids
)
public
AjaxResult
batchForceLogout
(
String
ids
)
{
for
(
String
sessionId
:
ids
)
for
(
String
sessionId
:
Convert
.
toStrArray
(
ids
)
)
{
SysUserOnline
online
=
userOnlineService
.
selectOnlineById
(
sessionId
);
if
(
online
==
null
)
...
...
ruoyi-admin/src/main/resources/templates/monitor/online/online.html
View file @
aea69153
...
...
@@ -114,9 +114,7 @@
title
:
'操作'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
// 传值改成 array 类型
var
ids
=
[
row
.
sessionId
]
var
msg
=
'<a class="btn btn-danger btn-xs '
+
forceFlag
+
'" href="javascript:void(0)" onclick="forceLogout(
\'
'
+
ids
+
'
\'
)"><i class="fa fa-sign-out"></i>强退</a> '
;
var
msg
=
'<a class="btn btn-danger btn-xs '
+
forceFlag
+
'" href="javascript:void(0)" onclick="forceLogout(
\'
'
+
row
.
sessionId
+
'
\'
)"><i class="fa fa-sign-out"></i>强退</a> '
;
return
msg
;
}
}]
...
...
@@ -125,7 +123,6 @@
});
// 单条强退
// 将该请求并到 batchForceLogout 中
function
forceLogout
(
sessionId
)
{
$
.
modal
.
confirm
(
"确定要强制选中用户下线吗?"
,
function
()
{
var
data
=
{
"ids"
:
sessionId
};
...
...
@@ -142,7 +139,7 @@
}
$
.
modal
.
confirm
(
"确认要强退选中的"
+
rows
.
length
+
"条数据吗?"
,
function
()
{
var
url
=
prefix
+
"/batchForceLogout"
;
var
data
=
{
"ids"
:
rows
};
var
data
=
{
"ids"
:
rows
.
join
()
};
$
.
operate
.
post
(
url
,
data
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment