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
a618453d
Commit
a618453d
authored
6 years ago
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
7ce81cf7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
8 deletions
+20
-8
NoUiContextManager.java
...org/sss/presentation/noui/context/NoUiContextManager.java
+9
-3
TokenInterceptor.java
.../java/org/sss/presentation/noui/jwt/TokenInterceptor.java
+1
-1
NoUiApiInitListener.java
...g/sss/presentation/noui/listener/NoUiApiInitListener.java
+2
-1
NoUiPresentationUtil.java
.../org/sss/presentation/noui/util/NoUiPresentationUtil.java
+1
-1
web.xml
src/main/webapp/WEB-INF/web.xml
+5
-0
HttpTest.java
.../java/org/sss/presentation/noui/api/servlet/HttpTest.java
+2
-2
No files found.
src/main/java/org/sss/presentation/noui/context/NoUiContextManager.java
View file @
a618453d
...
...
@@ -12,18 +12,24 @@ import org.sss.common.model.IModuleSession;
import
org.sss.presentation.noui.api.exception.NoUiException
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
import
cn.com.brilliance.eibs.auth.DatabaseLoginContext
;
import
cn.com.brilliance.eibs.auth.EmptyLoginContext
;
public
class
NoUiContextManager
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
NoUiContextManager
.
class
);
public
static
String
dbType
=
"hibernate"
;
public
static
String
loginContextName
=
"cn.com.brilliance.eibs.auth.DatabaseLoginContext"
;
public
static
NoUiContext
createNoUiContext
(
NoUiRequest
request
)
{
NoUiContext
noUiContext
=
new
NoUiContext
();
ILoginContext
loginContext
=
null
;
if
(
StringUtils
.
isEmpty
(
request
.
getToken
()))
loginContext
=
new
DatabaseLoginContext
();
if
(
StringUtils
.
isEmpty
(
request
.
getToken
()))
{
try
{
loginContext
=
(
ILoginContext
)
Class
.
forName
(
loginContextName
).
newInstance
();
}
catch
(
InstantiationException
|
IllegalAccessException
|
ClassNotFoundException
e
)
{
throw
new
NoUiException
(
"loingConextName class is not found"
,
loginContextName
);
}
}
else
loginContext
=
new
EmptyLoginContext
(
request
.
getUserId
());
loginContext
.
setContext
(
noUiContext
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/sss/presentation/noui/jwt/TokenInterceptor.java
View file @
a618453d
...
...
@@ -40,7 +40,7 @@ public class TokenInterceptor implements HandlerInterceptor {
}
// userId不存在
if
(
StringUtil
.
isEmpty
(
token
))
{
if
(
StringUtil
.
isEmpty
(
userId
))
{
Result
rt
=
new
Result
(
ErrorCodes
.
ERROR
,
"用户id不能为空"
,
null
);
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/sss/presentation/noui/listener/NoUiApiInitListener.java
View file @
a618453d
...
...
@@ -10,6 +10,7 @@ public class NoUiApiInitListener implements ServletContextListener {
private
static
final
String
DATABASE_SUPPORT_TYPE
=
"DbSupportType"
;
private
static
final
String
NOUI_TIMEOUT
=
"nouiTimeout"
;
private
static
final
String
LOGIN_CONTEXT_NAME
=
"loginContextName"
;
@Override
public
void
contextDestroyed
(
ServletContextEvent
arg0
)
{
...
...
@@ -22,6 +23,6 @@ public class NoUiApiInitListener implements ServletContextListener {
String
dbType
=
context
.
getInitParameter
(
DATABASE_SUPPORT_TYPE
);
int
timeout
=
Integer
.
valueOf
(
context
.
getInitParameter
(
NOUI_TIMEOUT
));
NoUiContextManager
.
dbType
=
dbType
;
NoUiContextManager
.
loginContextName
=
context
.
getInitParameter
(
LOGIN_CONTEXT_NAME
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/org/sss/presentation/noui/util/NoUiPresentationUtil.java
View file @
a618453d
...
...
@@ -236,7 +236,7 @@ public class NoUiPresentationUtil {
public
static
Map
<
String
,
Object
>
handleCodeTableReturnData
(
NoUiContext
context
,
Alias
alias
)
{
NoUiPresentation
gui
=
(
NoUiPresentation
)
context
.
getGui
();
Map
<
String
,
Object
>
codeTableMap
=
gui
.
get
Error
();
Map
<
String
,
Object
>
codeTableMap
=
gui
.
get
Codetable
();
for
(
Map
.
Entry
<
String
,
Object
>
errorEntity
:
codeTableMap
.
entrySet
())
{
String
key
=
errorEntity
.
getKey
();
codeTableMap
.
put
(
alias
.
getRevertRel
().
get
(
key
),
errorEntity
.
getValue
());
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/web.xml
View file @
a618453d
...
...
@@ -25,9 +25,14 @@
<param-value>
hibernate
</param-value>
</context-param>
<context-param>
<param-name>
loginContextName
</param-name>
<param-value>
cn.com.brilliance.eibs.auth.DatabaseLoginContext
</param-value>
</context-param>
<context-param>
<param-name>
nouiTimeout
</param-name>
<param-value>
10
</param-value>
</context-param>
<!-- 启动相关Container服务 -->
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/sss/presentation/noui/api/servlet/HttpTest.java
View file @
a618453d
...
...
@@ -20,11 +20,11 @@ public class HttpTest {
Map
<
String
,
Object
>
map2
=
(
Map
<
String
,
Object
>)
map1
.
get
(
"data"
);
String
token
=
(
String
)
map2
.
get
(
"token"
);
//
pxiadd(token, userId, terminalType);
pxiadd
(
token
,
userId
,
terminalType
);
// pxisel(token, userId, terminalType);
// pxiame(token, userId, terminalType);
// check(token, userId, terminalType);
upload
(
token
,
userId
,
terminalType
);
//
upload(token, userId, terminalType);
}
...
...
This diff is collapsed.
Click to expand it.
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