调整app列表检索,增加租户限制
This commit is contained in:
parent
e879ea9c5b
commit
ee9af0baf3
|
|
@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.config.TenantContext;
|
||||||
import org.jeecg.common.entity.WxApp;
|
import org.jeecg.common.entity.WxApp;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
|
@ -22,8 +24,9 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: wx_app
|
* @Description: wx_app
|
||||||
* @Author: zy
|
* @Author: zy
|
||||||
* @Date: 2023-06-20
|
* @Date: 2023-06-20
|
||||||
|
|
@ -166,7 +169,16 @@ public class WxAppController extends JeecgController<WxApp, IWxAppService> {
|
||||||
|
|
||||||
@GetMapping("/getAppList")
|
@GetMapping("/getAppList")
|
||||||
public Result getAppList(){
|
public Result getAppList(){
|
||||||
return Result.OK(wxAppService.list(Wrappers.<WxApp>lambdaQuery().eq(WxApp::getIsEnable,1)));
|
//租戶
|
||||||
|
String params="";
|
||||||
|
String tenantId = TenantContext.getTenant();
|
||||||
|
if(StringUtils.isNotBlank(tenantId)){
|
||||||
|
if(!"0".equals(tenantId)){//非0租户检查小程序所属小程序
|
||||||
|
params = tenantId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<WxApp> appList = wxAppService.list(Wrappers.<WxApp>lambdaQuery().eq(StringUtils.isNotBlank(params),WxApp::getTenantId,tenantId).eq(WxApp::getIsEnable,1));
|
||||||
|
return Result.OK(appList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue