调整app列表检索,增加租户限制

This commit is contained in:
zy 2026-05-07 15:19:06 +08:00
parent e879ea9c5b
commit ee9af0baf3
1 changed files with 14 additions and 2 deletions

View File

@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.entity.WxApp;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
@ -22,8 +24,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
/**
* @Description: wx_app
* @Author: zy
* @Date: 2023-06-20
@ -166,7 +169,16 @@ public class WxAppController extends JeecgController<WxApp, IWxAppService> {
@GetMapping("/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);
}
}