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
1f000d9f
Commit
1f000d9f
authored
Dec 25, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitee.com/y_project/RuoYi
parents
9d5a702e
c628cf7e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
14 deletions
+70
-14
README.md
+1
-1
ruoyi-admin/src/main/resources/static/ruoyi/js/common.js
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysShiroService.java
+62
-0
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java
+4
-10
sql/ry_20181203.sql
+2
-2
No files found.
README.md
View file @
1f000d9f
...
...
@@ -2,7 +2,7 @@
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
寓意:你若不离不弃,我必生死相依
性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依)
若依基于hplus和inspinia两套后台系统模板开发。有需要可自行到群内下载。
...
...
ruoyi-admin/src/main/resources/static/ruoyi/js/common.js
View file @
1f000d9f
...
...
@@ -101,7 +101,7 @@ $(function() {
$
(
"#bootstrap-table"
).
on
(
"check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table"
,
function
()
{
var
ids
=
$
(
"#bootstrap-table"
).
bootstrapTable
(
"getSelections"
);
$
(
'#toolbar .btn-del'
).
toggleClass
(
'disabled'
,
!
ids
.
length
);
$
(
'#toolbar .btn-edit'
).
toggleClass
(
'disabled'
,
ids
.
length
!=
1
);
;
$
(
'#toolbar .btn-edit'
).
toggleClass
(
'disabled'
,
ids
.
length
!=
1
);
});
// tree表格树 展开/折叠
var
expandFlag
=
false
;
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysShiroService.java
0 → 100644
View file @
1f000d9f
package
com
.
ruoyi
.
framework
.
shiro
.
service
;
import
java.io.Serializable
;
import
org.apache.shiro.session.Session
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.shiro.session.OnlineSession
;
import
com.ruoyi.system.domain.SysUserOnline
;
import
com.ruoyi.system.service.ISysUserOnlineService
;
/**
* 会话db操作处理
*
* @author ruoyi
*/
@Component
public
class
SysShiroService
{
@Autowired
private
ISysUserOnlineService
onlineService
;
/**
* 删除会话
*
* @param onlineSession 会话信息
*/
public
void
deleteSession
(
OnlineSession
onlineSession
)
{
onlineService
.
deleteOnlineById
(
String
.
valueOf
(
onlineSession
.
getId
()));
}
/**
* 获取会话信息
*
* @param sessionId
* @return
*/
public
Session
getSession
(
Serializable
sessionId
)
{
SysUserOnline
userOnline
=
onlineService
.
selectOnlineById
(
String
.
valueOf
(
sessionId
));
return
StringUtils
.
isNull
(
userOnline
)
?
null
:
createSession
(
userOnline
);
}
public
Session
createSession
(
SysUserOnline
userOnline
)
{
OnlineSession
onlineSession
=
new
OnlineSession
();
if
(
StringUtils
.
isNotNull
(
userOnline
))
{
onlineSession
.
setId
(
userOnline
.
getSessionId
());
onlineSession
.
setHost
(
userOnline
.
getIpaddr
());
onlineSession
.
setBrowser
(
userOnline
.
getBrowser
());
onlineSession
.
setOs
(
userOnline
.
getOs
());
onlineSession
.
setDeptName
(
userOnline
.
getDeptName
());
onlineSession
.
setLoginName
(
userOnline
.
getLoginName
());
onlineSession
.
setStartTimestamp
(
userOnline
.
getStartTimestamp
());
onlineSession
.
setLastAccessTime
(
userOnline
.
getLastAccessTime
());
onlineSession
.
setTimeout
(
userOnline
.
getExpireTime
());
}
return
onlineSession
;
}
}
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java
View file @
1f000d9f
...
...
@@ -9,8 +9,7 @@ import org.springframework.beans.factory.annotation.Value;
import
com.ruoyi.common.enums.OnlineStatus
;
import
com.ruoyi.framework.manager.AsyncManager
;
import
com.ruoyi.framework.manager.factory.AsyncFactory
;
import
com.ruoyi.system.domain.SysUserOnline
;
import
com.ruoyi.system.service.ISysUserOnlineService
;
import
com.ruoyi.framework.shiro.service.SysShiroService
;
/**
* 针对自定义的ShiroSession的db操作
...
...
@@ -31,7 +30,7 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
private
static
final
String
LAST_SYNC_DB_TIMESTAMP
=
OnlineSessionDAO
.
class
.
getName
()
+
"LAST_SYNC_DB_TIMESTAMP"
;
@Autowired
private
ISysUserOnlineService
online
Service
;
private
SysShiroService
sysShiro
Service
;
public
OnlineSessionDAO
()
{
...
...
@@ -52,12 +51,7 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
@Override
protected
Session
doReadSession
(
Serializable
sessionId
)
{
SysUserOnline
userOnline
=
onlineService
.
selectOnlineById
(
String
.
valueOf
(
sessionId
));
if
(
userOnline
==
null
)
{
return
null
;
}
return
super
.
doReadSession
(
sessionId
);
return
sysShiroService
.
getSession
(
sessionId
);
}
/**
...
...
@@ -109,6 +103,6 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
return
;
}
onlineSession
.
setStatus
(
OnlineStatus
.
off_line
);
onlineService
.
deleteOnlineById
(
String
.
valueOf
(
onlineSession
.
getId
())
);
sysShiroService
.
deleteSession
(
onlineSession
);
}
}
sql/ry_20181203.sql
View file @
1f000d9f
...
...
@@ -604,8 +604,8 @@ drop table if exists sys_notice;
create
table
sys_notice
(
notice_id
int
(
4
)
not
null
auto_increment
comment
'公告ID'
,
notice_title
varchar
(
50
)
not
null
comment
'公告标题'
,
notice_type
char
(
2
)
not
null
comment
'公告类型(1通知 2公告)'
,
notice_content
varchar
(
500
)
not
null
comment
'公告内容'
,
notice_type
char
(
1
)
not
null
comment
'公告类型(1通知 2公告)'
,
notice_content
varchar
(
500
)
default
''
comment
'公告内容'
,
status
char
(
1
)
default
'0'
comment
'公告状态(0正常 1关闭)'
,
create_by
varchar
(
64
)
default
''
comment
'创建者'
,
create_time
datetime
comment
'创建时间'
,
...
...
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