This commit is contained in:
thinkgem
2024-05-27 15:30:14 +08:00
parent 5a4c03332a
commit 0a29bed4ad
2 changed files with 4 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ public class FrontController extends BaseController {
if (category.getHref().startsWith(request.getContextPath())) {
category.setHref(category.getHref().replaceFirst(request.getContextPath(), ""));
}
return "redirect:" + category.getHref();
return REDIRECT + category.getHref();
}
// 获取站点信息
@@ -269,7 +269,7 @@ public class FrontController extends BaseController {
if (article.getHref().startsWith(request.getContextPath())) {
article.setHref(article.getHref().replaceFirst(request.getContextPath(), ""));
}
return "redirect:" + article.getHref();
return REDIRECT + article.getHref();
}
model.addAttribute("article", article);

View File

@@ -4,6 +4,7 @@
*/
package com.jeesite.modules.sys.interceptor;
import com.jeesite.common.web.BaseController;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -32,7 +33,7 @@ public class MobileInterceptor extends BaseService implements HandlerInterceptor
ModelAndView modelAndView) throws Exception {
if (modelAndView != null){
// 如果是手机或平板访问的话,则跳转到手机视图页面。
if(UserAgentUtils.isMobileOrTablet(request) && !StringUtils.startsWithIgnoreCase(modelAndView.getViewName(), "redirect:")){
if(UserAgentUtils.isMobileOrTablet(request) && !StringUtils.startsWithIgnoreCase(modelAndView.getViewName(), BaseController.REDIRECT)){
modelAndView.setViewName("mobile/" + modelAndView.getViewName());
}
}