新增首页跳转

This commit is contained in:
wenc000 2020-10-21 19:07:21 +08:00
parent 71e7b5ed3d
commit 781b42cbdc
2 changed files with 16 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import com.cm.common.config.properties.OauthProperties;
import com.cm.common.config.properties.SystemProperties; import com.cm.common.config.properties.SystemProperties;
import com.cm.common.exception.SearchException; import com.cm.common.exception.SearchException;
import com.cm.common.pojo.bos.UserInfoBO; import com.cm.common.pojo.bos.UserInfoBO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -37,7 +38,12 @@ public class RouteController {
ModelAndView mv = new ModelAndView("index"); ModelAndView mv = new ModelAndView("index");
UserInfoBO userInfoBO = securityComponent.getCurrentUser(); UserInfoBO userInfoBO = securityComponent.getCurrentUser();
mv.addObject("userUsername", userInfoBO.getUserUsername()); mv.addObject("userUsername", userInfoBO.getUserUsername());
mv.addObject("oauthServer", oauthProperties.getOauthServer()); // 门户URL不存在跳转统一用户
if (StringUtils.isBlank(systemProperties.getPortalUrl())) {
mv.addObject("oauthServer", oauthProperties.getOauthServer());
} else {
mv.addObject("oauthServer", systemProperties.getPortalUrl());
}
mv.addObject("title", systemProperties.getTitle()); mv.addObject("title", systemProperties.getTitle());
return mv; return mv;
} }

View File

@ -20,6 +20,7 @@ public class SystemProperties {
private Integer port; private Integer port;
private String url; private String url;
private String title; private String title;
private String portalUrl;
private String loginPageName; private String loginPageName;
public Integer getPort() { public Integer getPort() {
@ -46,6 +47,14 @@ public class SystemProperties {
this.title = title; this.title = title;
} }
public String getPortalUrl() {
return portalUrl == null ? "" : portalUrl.trim();
}
public void setPortalUrl(String portalUrl) {
this.portalUrl = portalUrl;
}
public String getLoginPageName() { public String getLoginPageName() {
return loginPageName == null ? "" : loginPageName.trim(); return loginPageName == null ? "" : loginPageName.trim();
} }