From 3855af45a9c275ec5d9777255a0dfa94aac2f240 Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 6 Jan 2020 13:34:58 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E5=A2=9E=E5=8A=A0=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/provider/AuthProvider.java | 1 + .../system/controller/TenantController.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java b/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java index f9bd0512..f9065f26 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java +++ b/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/auth-routes"); defaultSkipUrl.add("/menu/top-menu"); + defaultSkipUrl.add("/tenant/info"); defaultSkipUrl.add("/process/resource-view"); defaultSkipUrl.add("/process/diagram-view"); defaultSkipUrl.add("/manager/check-upload"); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java index 155a8a9a..6994c0cd 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java +++ b/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.constant.BladeConstant; import org.springblade.core.tool.constant.RoleConstant; +import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Tenant; import org.springblade.system.service.ITenantService; @@ -170,5 +171,25 @@ public class TenantController extends BladeController { return R.data(list); } + /** + * 根据域名查询信息 + * + * @param domain 域名 + */ + @GetMapping("/info") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "配置信息", notes = "传入domain") + public R info(String domain) { + Tenant tenant = tenantService.getOne(Wrappers.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); + } + + }