Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
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
曲欣亮
sentinel
Commits
7d47b305
Commit
7d47b305
authored
Aug 28, 2018
by
曲欣亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目基本完成,达到使用要求
parent
a8d6fa2e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
75 deletions
+146
-75
LanguageController.java
src/main/java/com/egolm/lang/LanguageController.java
+114
-68
ExceptionHandler.java
src/main/java/com/egolm/lang/config/ExceptionHandler.java
+3
-5
ContentArgs.java
src/main/java/com/egolm/lang/model/ContentArgs.java
+29
-0
common.js
src/main/resources/static/assets/common.js
+0
-2
No files found.
src/main/java/com/egolm/lang/LanguageController.java
View file @
7d47b305
This diff is collapsed.
Click to expand it.
src/main/java/com/egolm/lang/config/ExceptionHandler.java
View file @
7d47b305
...
@@ -3,8 +3,7 @@ package com.egolm.lang.config;
...
@@ -3,8 +3,7 @@ package com.egolm.lang.config;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.logging.Log
;
import
org.apache.log4j.Logger
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
...
@@ -15,10 +14,11 @@ import com.egolm.common.bean.Rjx;
...
@@ -15,10 +14,11 @@ import com.egolm.common.bean.Rjx;
@Component
@Component
public
class
ExceptionHandler
implements
HandlerExceptionResolver
{
public
class
ExceptionHandler
implements
HandlerExceptionResolver
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ExceptionHandler
.
class
);
private
Logger
logger
=
Logger
.
getLogger
(
ExceptionHandler
.
class
);
@Override
@Override
public
ModelAndView
resolveException
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
public
ModelAndView
resolveException
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
logger
.
error
(
""
,
ex
);
ModelAndView
mav
=
new
ModelAndView
(
new
MappingJackson2JsonView
());
ModelAndView
mav
=
new
ModelAndView
(
new
MappingJackson2JsonView
());
try
{
try
{
response
.
setContentType
(
"application/json"
);
response
.
setContentType
(
"application/json"
);
...
@@ -29,8 +29,6 @@ public class ExceptionHandler implements HandlerExceptionResolver {
...
@@ -29,8 +29,6 @@ public class ExceptionHandler implements HandlerExceptionResolver {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
mav
.
addAllObjects
(
Rjx
.
jsonErr
().
setMessage
(
"异常处理失败"
));
mav
.
addAllObjects
(
Rjx
.
jsonErr
().
setMessage
(
"异常处理失败"
));
}
finally
{
logger
.
error
(
""
,
ex
);
}
}
return
mav
;
return
mav
;
}
}
...
...
src/main/java/com/egolm/lang/model/ContentArgs.java
0 → 100644
View file @
7d47b305
package
com
.
egolm
.
lang
.
model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@ApiModel
public
class
ContentArgs
{
@ApiModelProperty
(
"翻译节点目录"
)
private
String
sLink
;
@ApiModelProperty
(
"sCaption"
)
private
String
sCaption
;
@ApiModelProperty
(
"要翻译的文档"
)
private
String
[]
sDocuments
;
public
String
getsLink
()
{
return
sLink
;
}
public
String
getsCaption
()
{
return
sCaption
;
}
public
String
[]
getsDocuments
()
{
return
sDocuments
;
}
}
\ No newline at end of file
src/main/resources/static/assets/common.js
View file @
7d47b305
...
@@ -48,8 +48,6 @@ $(document).ajaxSuccess(function(event, xhr, options) {
...
@@ -48,8 +48,6 @@ $(document).ajaxSuccess(function(event, xhr, options) {
var
message
=
xhr
.
responseJSON
.
message
;
var
message
=
xhr
.
responseJSON
.
message
;
if
(
code
==
300
)
{
if
(
code
==
300
)
{
window
.
location
.
href
=
"/lang/login.html"
;
window
.
location
.
href
=
"/lang/login.html"
;
}
else
if
(
code
==
500
&&
message
)
{
alert
(
message
);
}
}
}
}
});
});
\ No newline at end of file
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