Commit 7d47b305 authored by 曲欣亮's avatar 曲欣亮

项目基本完成,达到使用要求

parent a8d6fa2e
...@@ -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;
} }
......
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
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment