|
@@ -25,6 +25,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.zskk.shop.controller.bean.ControllerResult;
|
|
import com.zskk.shop.controller.bean.ControllerResult;
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
|
|
+import com.zskk.shop.exception.ZSKKError;
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
import com.zskk.shop.utils.LogUtil;
|
|
import com.zskk.shop.utils.LogUtil;
|
|
|
|
|
|
@@ -55,10 +56,14 @@ public class GlobalErrorController {
|
|
if (accept.contains(MediaType.TEXT_HTML_VALUE)){
|
|
if (accept.contains(MediaType.TEXT_HTML_VALUE)){
|
|
//为登录 跳转到登录页面
|
|
//为登录 跳转到登录页面
|
|
if (e instanceof ZSKKException){
|
|
if (e instanceof ZSKKException){
|
|
|
|
+ ZSKKError error = ((ZSKKException)e).getError();
|
|
if (((ZSKKException)e).getError().getCode() == ErrorConstant.NO_LOGIN_ERROR.getCode()){
|
|
if (((ZSKKException)e).getError().getCode() == ErrorConstant.NO_LOGIN_ERROR.getCode()){
|
|
String redirect = this.getRequestUrl();
|
|
String redirect = this.getRequestUrl();
|
|
return new ModelAndView("redirect:" + uccenter + "/login/authorize?redirect=" + redirect);
|
|
return new ModelAndView("redirect:" + uccenter + "/login/authorize?redirect=" + redirect);
|
|
}
|
|
}
|
|
|
|
+ if (((ZSKKException)e).getError().getCode() == ErrorConstant.H5NO_LOGIN_ERROR.getCode()){
|
|
|
|
+ return new ModelAndView("redirect:" + error.getMsg());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
String errorPath = "/error";
|
|
String errorPath = "/error";
|