Просмотр исходного кода

集团版第一次bug

release_toaliyun_real
xhxu 5 лет назад
Родитель
Сommit
17370fbe52
3 измененных файлов: 8 добавлений и 16 удалений
  1. +4
    -11
      mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
  2. +4
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/sys/HomeController.java
  3. +0
    -2
      mallinkAdmin/src/main/java/com/iformall/shiro/UserSession.java

+ 4
- 11
mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java Просмотреть файл

@@ -7,10 +7,8 @@ import java.util.Date;

import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumGroupSupport;
import com.iformall.shiro.UserSession;
import com.iformall.utils.IPUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.web.bind.WebDataBinder;
@@ -66,18 +64,13 @@ public class BaseController {
* @return
*/
public TenantEntity getTenantInfo(){
TenantEntity tenantEntity = new TenantEntity();
Session session = SecurityUtils.getSubject().getSession();
Boolean isParent = (Boolean)session.getAttribute(UserSession.isParent);
String tenantId = (String)session.getAttribute(UserSession.tenantId);
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId);
if(isParent!= null && isParent){
tenantEntity.setTenantId(null);
tenantEntity.setParentTenantId(tenantId);
}else{
tenantEntity.setTenantId(tenantId);
tenantEntity.setParentTenantId(parentTenantId);
}
TenantEntity tenantEntity = new TenantEntity(){{
setTenantId(tenantId);
setParentTenantId(parentTenantId);
}};
return tenantEntity;
}



+ 4
- 3
mallinkAdmin/src/main/java/com/iformall/controller/sys/HomeController.java Просмотреть файл

@@ -163,7 +163,8 @@ public class HomeController extends BaseController {
StringUtils.isBlank(info.getParentTenantId())) {

Session session = SecurityUtils.getSubject().getSession();
session.setAttribute(UserSession.isParent, true);
session.setAttribute(UserSession.tenantId, null);
session.setAttribute(UserSession.parentTenantId, info.getTenantId());

// 集团用户获取子商场
List<WxMall> mallList = mallService.getSubByParentTenantId(info.getTenantId());
@@ -216,8 +217,8 @@ public class HomeController extends BaseController {
session.setAttribute(UserSession.tenantId, subTenantId);
session.setAttribute(UserSession.parentTenantId, tenantId);
} else {
session.setAttribute(UserSession.tenantId, tenantId);
session.setAttribute(UserSession.parentTenantId, null);
session.setAttribute(UserSession.tenantId, null);
session.setAttribute(UserSession.parentTenantId, tenantId);
}
}
return new ResultData();


+ 0
- 2
mallinkAdmin/src/main/java/com/iformall/shiro/UserSession.java Просмотреть файл

@@ -10,6 +10,4 @@ public class UserSession {

public static String parentTenantId ="PARENT_TENANT_ID";

public static String isParent ="IS_PARENT";

}

Загрузка…
Отмена
Сохранить