Browse Source

增加租户信息获取接口

test
smallchill 5 years ago
parent
commit
3855af45a9
  1. 1
      blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java
  2. 21
      blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java

1
blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java

@ -46,6 +46,7 @@ public class AuthProvider {
defaultSkipUrl.add("/menu/routes"); defaultSkipUrl.add("/menu/routes");
defaultSkipUrl.add("/menu/auth-routes"); defaultSkipUrl.add("/menu/auth-routes");
defaultSkipUrl.add("/menu/top-menu"); defaultSkipUrl.add("/menu/top-menu");
defaultSkipUrl.add("/tenant/info");
defaultSkipUrl.add("/process/resource-view"); defaultSkipUrl.add("/process/resource-view");
defaultSkipUrl.add("/process/diagram-view"); defaultSkipUrl.add("/process/diagram-view");
defaultSkipUrl.add("/manager/check-upload"); defaultSkipUrl.add("/manager/check-upload");

21
blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java

@ -30,6 +30,7 @@ import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant; import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Tenant; import org.springblade.system.entity.Tenant;
import org.springblade.system.service.ITenantService; import org.springblade.system.service.ITenantService;
@ -170,5 +171,25 @@ public class TenantController extends BladeController {
return R.data(list); return R.data(list);
} }
/**
* 根据域名查询信息
*
* @param domain 域名
*/
@GetMapping("/info")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "配置信息", notes = "传入domain")
public R<Kv> info(String domain) {
Tenant tenant = tenantService.getOne(Wrappers.<Tenant>query().lambda().eq(Tenant::getDomain, domain));
Kv kv = Kv.create();
if (tenant != null) {
kv.set("tenantId", tenant.getTenantId())
.set("domain", tenant.getDomain())
.set("backgroundUrl", tenant.getBackgroundUrl());
}
return R.data(kv);
}
} }

Loading…
Cancel
Save