From c3ab15dddcfa2a8f26956d434b799372a0e90774 Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 7 Feb 2020 23:35:56 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=80=89=E6=8B=A9=E5=A2=9E=E5=8A=A0=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 6 ++- doc/sql/update/mysql-update-2.2.2~2.3.0.sql | 32 --------------- doc/sql/update/oracle-update-2.2.2~2.3.0.sql | 40 ------------------- .../update/postgresql-update-2.2.2~2.3.0.sql | 39 ------------------ 4 files changed, 4 insertions(+), 113 deletions(-) delete mode 100644 doc/sql/update/mysql-update-2.2.2~2.3.0.sql delete mode 100644 doc/sql/update/oracle-update-2.2.2~2.3.0.sql delete mode 100644 doc/sql/update/postgresql-update-2.2.2~2.3.0.sql diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java index 55b1fb15..b06a9eb3 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java @@ -29,6 +29,7 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.annotation.PreAuth; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.RoleConstant; @@ -203,8 +204,9 @@ public class UserController { @GetMapping("/user-list") @ApiOperationSupport(order = 10) @ApiOperation(value = "用户列表", notes = "传入user") - public R> userList(User user) { - List list = userService.list(Condition.getQueryWrapper(user)); + public R> userList(User user, BladeUser bladeUser) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(user); + List list = userService.list((!AuthUtil.isAdministrator()) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper); return R.data(list); } diff --git a/doc/sql/update/mysql-update-2.2.2~2.3.0.sql b/doc/sql/update/mysql-update-2.2.2~2.3.0.sql deleted file mode 100644 index 0e373de0..00000000 --- a/doc/sql/update/mysql-update-2.2.2~2.3.0.sql +++ /dev/null @@ -1,32 +0,0 @@ --- ---------------------------- --- 增加租户表字段 --- ---------------------------- -ALTER TABLE `blade_tenant` - ADD COLUMN `domain` varchar(255) NULL COMMENT '域名地址' AFTER `tenant_name`, - ADD COLUMN `background_url` varchar(1000) NULL COMMENT '系统背景' AFTER `domain`, - ADD COLUMN `account_number` int(0) NULL DEFAULT -1 COMMENT '账号额度' AFTER `address`, - ADD COLUMN `expire_time` datetime(0) NULL COMMENT '过期时间' AFTER `account_number`; - --- ---------------------------- --- 增加对象存储表字段 --- ---------------------------- -ALTER TABLE `blade_oss` - ADD COLUMN `app_id` varchar(255) NULL COMMENT '应用ID' AFTER `bucket_name`, - ADD COLUMN `region` varchar(255) NULL COMMENT '地域简称' AFTER `app_id`; - --- ---------------------------- --- 插入菜单数据 --- ---------------------------- -INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) -VALUES ('1164733389658963251', '1123598815738675298', 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', 'iconfont iconicon_cspace', 2, 1, 0, 2, '', 0); - --- ---------------------------- --- 插入角色权限数据 --- ---------------------------- -INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) -VALUES ('1161272893873322991', '1164733389658963251', '1123598816738675201'); - --- ---------------------------- --- 新增腾讯云存储字典 --- ---------------------------- -INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`) VALUES (1123598814738676228, 1123598814738676224, 'oss', 4, 'tencent', 4, NULL, 0, 0); diff --git a/doc/sql/update/oracle-update-2.2.2~2.3.0.sql b/doc/sql/update/oracle-update-2.2.2~2.3.0.sql deleted file mode 100644 index 10a60df8..00000000 --- a/doc/sql/update/oracle-update-2.2.2~2.3.0.sql +++ /dev/null @@ -1,40 +0,0 @@ - --- ---------------------------- --- 增加租户表字段 --- ---------------------------- -ALTER TABLE "BLADEX"."BLADE_TENANT" - ADD ("DOMAIN" VARCHAR2(255) ) - ADD ("BACKGROUND_URL" VARCHAR2(1000) ) - ADD ("ACCOUNT_NUMBER" NUMBER DEFAULT -1 ) - ADD ("EXPIRE_TIME" DATE ); -COMMENT ON COLUMN "BLADEX"."BLADE_TENANT"."DOMAIN" IS '域名地址'; -COMMENT ON COLUMN "BLADEX"."BLADE_TENANT"."BACKGROUND_URL" IS '系统背景'; -COMMENT ON COLUMN "BLADEX"."BLADE_TENANT"."ACCOUNT_NUMBER" IS '账号额度'; -COMMENT ON COLUMN "BLADEX"."BLADE_TENANT"."EXPIRE_TIME" IS '过期时间'; - --- ---------------------------- --- 增加对象存储表字段 --- ---------------------------- -ALTER TABLE "BLADEX"."BLADE_OSS" - ADD ("APP_ID" VARCHAR2(255) ) - ADD ("REGION" VARCHAR2(255) ); -COMMENT ON COLUMN "BLADEX"."BLADE_OSS"."APP_ID" IS '应用ID'; -COMMENT ON COLUMN "BLADEX"."BLADE_OSS"."REGION" IS '地域简称'; - - --- ---------------------------- --- 插入菜单数据 --- ---------------------------- -INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED") -VALUES ('1164733389658963251', '1123598815738675298', 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', 'iconfont iconicon_cspace', 2, 1, 0, 2, '', 0); - --- ---------------------------- --- 插入角色权限数据 --- ---------------------------- -INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID) -VALUES ('1161272893873322991', '1164733389658963251', '1123598816738675201'); - --- ---------------------------- --- 新增腾讯云存储字典 --- ---------------------------- -INSERT INTO "BLADEX"."BLADE_DICT"(ID, PARENT_ID, CODE, DICT_KEY, DICT_VALUE, SORT, REMARK, IS_SEALED, IS_DELETED) VALUES (1123598814738676228, 1123598814738676224, 'oss', 4, 'tencent', 4, NULL, 0, 0); diff --git a/doc/sql/update/postgresql-update-2.2.2~2.3.0.sql b/doc/sql/update/postgresql-update-2.2.2~2.3.0.sql deleted file mode 100644 index 530ace36..00000000 --- a/doc/sql/update/postgresql-update-2.2.2~2.3.0.sql +++ /dev/null @@ -1,39 +0,0 @@ - --- ---------------------------- --- 增加租户表字段 --- ---------------------------- -ALTER TABLE "public"."blade_tenant" - ADD COLUMN "domain" varchar(255) COLLATE "pg_catalog"."default", - ADD COLUMN "background_url" varchar(1000) COLLATE "pg_catalog"."default", - ADD COLUMN "account_number" int2 DEFAULT -1, - ADD COLUMN "expire_time" timestamp(6); -COMMENT ON COLUMN "public"."blade_tenant"."domain" IS '域名地址'; -COMMENT ON COLUMN "public"."blade_tenant"."background_url" IS '系统背景'; -COMMENT ON COLUMN "public"."blade_tenant"."account_number" IS '账号额度'; -COMMENT ON COLUMN "public"."blade_tenant"."expire_time" IS '过期时间'; - --- ---------------------------- --- 增加租户表字段 --- ---------------------------- -ALTER TABLE "public"."blade_oss" - ADD COLUMN "app_id" varchar(255) COLLATE "pg_catalog"."default", - ADD COLUMN "region" varchar(255) COLLATE "pg_catalog"."default"; -COMMENT ON COLUMN "public"."blade_tenant"."app_id" IS '应用ID'; -COMMENT ON COLUMN "public"."blade_tenant"."region" IS '地域简称'; - --- ---------------------------- --- 插入菜单数据 --- ---------------------------- -INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "remark", "is_deleted") -VALUES ('1164733389658963251', '1123598815738675298', 'xxljob', '任务调度', 'menu', 'http://localhost:7009/xxl-job-admin', 'iconfont iconicon_cspace', 2, 1, 0, 2, '', 0); - --- ---------------------------- --- 插入角色权限数据 --- ---------------------------- -INSERT INTO "blade_role_menu"("id","menu_id","role_id") -VALUES ('1161272893873322991', '1164733389658963251', '1123598816738675201'); - --- ---------------------------- --- 新增腾讯云存储字典 --- ---------------------------- -INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_sealed", "is_deleted") VALUES (1123598814738676228, 1123598814738676224, 'oss', 4, 'tencent', 4, NULL, 0, 0);