优化获取租户信息接口

This commit is contained in:
gxwebsoft
2024-03-04 20:45:16 +08:00
parent 4f9eaab0e2
commit 4193392c00
2 changed files with 5 additions and 6 deletions

View File

@@ -237,8 +237,6 @@ public class FileController extends BaseController {
return fail("删除失败");
}
@PreAuthorize("hasAuthority('sys:file:list')")
@OperationLog
@ApiOperation("分页查询文件")
@GetMapping("/page")
public ApiResult<PageResult<FileRecord>> page(FileRecordParam param, HttpServletRequest request) {
@@ -257,8 +255,6 @@ public class FileController extends BaseController {
return success(result);
}
@PreAuthorize("hasAuthority('sys:file:list')")
@OperationLog
@ApiOperation("查询全部文件")
@GetMapping("/list")
public ApiResult<List<FileRecord>> list(FileRecordParam param, HttpServletRequest request) {

View File

@@ -158,14 +158,17 @@ public class MainController extends BaseController {
public ApiResult<?> tenant() {
Integer tenantId = getTenantId();
if (tenantId == null) {
throw new BusinessException("缺少参数tenantId");
return fail("缺少参数tenantId",null);
}
Tenant tenant = tenantService.getByIdRel(tenantId);
if (tenant == null) {
throw new BusinessException("该租户不存在");
return fail("该租户不存在或已过期",null);
}
// 企业信息
Company company = companyService.getByTenantIdRel(tenantId);
if(company == null){
return fail("该租户不存在或已过期",null);
}
company.setBusinessEntity(null);
company.setPhone(null);
company.setCompanyCode(null);