Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
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
gechengyang
nouiWithSpringMVC
Commits
69049793
Commit
69049793
authored
Dec 07, 2018
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'完善sysmod模块'
parent
4ff1ccdf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletions
+23
-1
CpdOpnController.java
...rg/sss/presentation/noui/controller/CpdOpnController.java
+15
-0
LoginController.java
...org/sss/presentation/noui/controller/LoginController.java
+2
-1
StringUtil.java
src/main/java/org/sss/presentation/noui/util/StringUtil.java
+6
-0
No files found.
src/main/java/org/sss/presentation/noui/controller/CpdOpnController.java
View file @
69049793
...
...
@@ -14,7 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.sss.common.model.EventType
;
import
org.sss.common.model.IBaseObject
;
import
org.sss.common.model.IDatafield
;
import
org.sss.common.model.IModule
;
import
org.sss.presentation.noui.api.exception.NoUiException
;
import
org.sss.presentation.noui.api.model.Alias
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
...
...
@@ -22,7 +24,10 @@ import org.sss.presentation.noui.api.response.ErrorCodes;
import
org.sss.presentation.noui.api.response.ResultUtil
;
import
org.sss.presentation.noui.context.NoUiContext
;
import
org.sss.presentation.noui.context.NoUiContextManager
;
import
org.sss.presentation.noui.jwt.RedisLoginInfo
;
import
org.sss.presentation.noui.util.NoUiPresentationUtil
;
import
org.sss.presentation.noui.util.RedisUtil
;
import
org.sss.presentation.noui.util.StringUtil
;
@Controller
public
class
CpdOpnController
{
...
...
@@ -41,6 +46,10 @@ public class CpdOpnController {
for
(
String
key
:
paramsMap
.
keySet
())
{
context
.
getSession
().
storeData
(
key
,
paramsMap
.
get
(
key
));
}
// 设置old sysmod
RedisLoginInfo
redisLoginInfo
=
(
RedisLoginInfo
)
RedisUtil
.
get
(
StringUtil
.
userUniqueId
(
noUiRequest
));
NoUiPresentationUtil
.
setSysmod
(
context
,
(
IModule
)
redisLoginInfo
.
getSysmod
());
// 交易跳转
context
.
getSession
().
chain
(
true
,
trnName
);
try
{
...
...
@@ -55,6 +64,12 @@ public class CpdOpnController {
if
(
dataField
instanceof
IDatafield
)
((
IDatafield
<?>)
dataField
).
invokeEventRules
(
context
,
EventType
.
ON_CLICK
,
null
);
}
// 保存新的RedisLoginInfo
IBaseObject
sysmod
=
context
.
getSession
().
getBaseObject
(
context
.
getRoot
(),
"sysmod"
);
redisLoginInfo
.
setSysmod
(
sysmod
);
RedisUtil
.
set
(
StringUtil
.
userUniqueId
(
noUiRequest
),
redisLoginInfo
);
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
NoUiPresentationUtil
.
handleEventReturnData
(
context
,
noUiRequest
,
alias
),
NoUiPresentationUtil
.
handleErrorReturnData
(
context
,
alias
),
NoUiPresentationUtil
.
handleCodeTableReturnData
(
context
,
alias
));
...
...
src/main/java/org/sss/presentation/noui/controller/LoginController.java
View file @
69049793
...
...
@@ -28,6 +28,7 @@ import org.sss.presentation.noui.jwt.JwtLogin;
import
org.sss.presentation.noui.jwt.RedisLoginInfo
;
import
org.sss.presentation.noui.util.NumericUtil
;
import
org.sss.presentation.noui.util.RedisUtil
;
import
org.sss.presentation.noui.util.StringUtil
;
@Controller
public
class
LoginController
{
...
...
@@ -63,7 +64,7 @@ public class LoginController {
IBaseObject
sysmod
=
context
.
getSession
().
getBaseObject
(
context
.
getRoot
(),
"sysmod"
);
// redis中存储用户相关信息
RedisLoginInfo
redisLoginInfo
=
new
RedisLoginInfo
(
userId
,
token
,
NumericUtil
.
sessionTimeOut
(),
sysmod
);
RedisUtil
.
set
(
userId
+
"."
+
noUiRequest
.
getTerminalType
(
),
redisLoginInfo
);
RedisUtil
.
set
(
StringUtil
.
userUniqueId
(
noUiRequest
),
redisLoginInfo
);
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
retDatamap
);
}
...
...
src/main/java/org/sss/presentation/noui/util/StringUtil.java
View file @
69049793
package
org
.
sss
.
presentation
.
noui
.
util
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
public
class
StringUtil
{
public
static
boolean
isEmpty
(
String
str
)
{
...
...
@@ -8,4 +10,8 @@ public class StringUtil {
return
false
;
}
public
static
String
userUniqueId
(
NoUiRequest
request
)
{
return
request
.
getUserId
()
+
"."
+
request
.
getTerminalType
();
}
}
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