Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
think-gem committed May 11, 2024
1 parent ad29250 commit 3cd5b23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ public void setCustomIndexView(String customIndexView) {
* 获取当前编辑的站点编号
*/
public static String getCurrentSiteCode() {
String siteCode = (String) UserUtils.getCache("currentSiteCode");
String defaultSiteCode = MAIN_SITE_CODE;
return StringUtils.isNotBlank(siteCode) ? siteCode : defaultSiteCode;
String siteCode = UserUtils.getCache("currentSiteCode");
return StringUtils.isNotBlank(siteCode) ? siteCode : MAIN_SITE_CODE;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ public String select(String siteCode, String redirect, HttpServletRequest reques
return REDIRECT + adminPath + "/cms/index";
}
UserUtils.putCache("currentSiteCode", siteCode);
// 保存到Cookie中,下次登录后自动切换到该站点
String cookieName = "siteCode";
if (Global.isUseCorpModel()){
cookieName = CorpUtils.getCurrentCorpCode() + "_" + cookieName;
}
CookieUtils.setCookie(response, cookieName, siteCode);
if (StringUtils.isNotBlank(redirect)){
return REDIRECT + redirect;
}
Expand Down

0 comments on commit 3cd5b23

Please sign in to comment.