Browse Source

Merge pull request #49 from colinin/3.0

add the organization structure API
pull/81/head
cKey 5 years ago
committed by GitHub
parent
commit
f0665f1812
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      aspnet-core/database/ApiGateway-Init.sql
  2. 29
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
  3. 2
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs
  4. 8
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs
  5. 7
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs
  6. 9
      vueJs/src/api/organizationunit.ts
  7. 48
      vueJs/src/views/admin/organization-unit/components/EditOrganizationUint.vue

30
aspnet-core/database/ApiGateway-Init.sql

@ -11,7 +11,7 @@
Target Server Version : 80020 Target Server Version : 80020
File Encoding : 65001 File Encoding : 65001
Date: 05/08/2020 15:56:55 Date: 07/08/2020 08:04:44
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -89,7 +89,7 @@ CREATE TABLE `appapigatewayauthoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 106 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayauthoptions -- Records of appapigatewayauthoptions
@ -173,6 +173,7 @@ INSERT INTO `appapigatewayauthoptions` VALUES (101, 1290849478956199936, '', '')
INSERT INTO `appapigatewayauthoptions` VALUES (102, 1290849628051124224, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (102, 1290849628051124224, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (103, 1290849798553776128, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (103, 1290849798553776128, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (104, 1290849978032238592, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (104, 1290849978032238592, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (105, 1291259822512693248, '', '');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaybalanceroptions -- Table structure for appapigatewaybalanceroptions
@ -190,7 +191,7 @@ CREATE TABLE `appapigatewaybalanceroptions` (
UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 109 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaybalanceroptions -- Records of appapigatewaybalanceroptions
@ -275,6 +276,7 @@ INSERT INTO `appapigatewaybalanceroptions` VALUES (104, NULL, 129084947895619993
INSERT INTO `appapigatewaybalanceroptions` VALUES (105, NULL, 1290849628051124224, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (105, NULL, 1290849628051124224, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (106, NULL, 1290849798553776128, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (106, NULL, 1290849798553776128, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (107, NULL, 1290849978032238592, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (107, NULL, 1290849978032238592, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (108, NULL, 1291259822512693248, '', '', 0);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaycacheoptions -- Table structure for appapigatewaycacheoptions
@ -288,7 +290,7 @@ CREATE TABLE `appapigatewaycacheoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 106 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaycacheoptions -- Records of appapigatewaycacheoptions
@ -372,6 +374,7 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (101, 1290849478956199936, NULL,
INSERT INTO `appapigatewaycacheoptions` VALUES (102, 1290849628051124224, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (102, 1290849628051124224, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (103, 1290849798553776128, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (103, 1290849798553776128, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (104, 1290849978032238592, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (104, 1290849978032238592, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (105, 1291259822512693248, 0, '');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaydiscovery -- Table structure for appapigatewaydiscovery
@ -481,7 +484,7 @@ CREATE TABLE `appapigatewayhttpoptions` (
UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 109 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayhttpoptions -- Records of appapigatewayhttpoptions
@ -566,6 +569,7 @@ INSERT INTO `appapigatewayhttpoptions` VALUES (104, NULL, 1290849478956199936, 0
INSERT INTO `appapigatewayhttpoptions` VALUES (105, NULL, 1290849628051124224, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (105, NULL, 1290849628051124224, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (106, NULL, 1290849798553776128, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (106, NULL, 1290849798553776128, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (107, NULL, 1290849978032238592, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (107, NULL, 1290849978032238592, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (108, NULL, 1291259822512693248, 0, 0, 0, 0, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayqosoptions -- Table structure for appapigatewayqosoptions
@ -583,7 +587,7 @@ CREATE TABLE `appapigatewayqosoptions` (
UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 109 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayqosoptions -- Records of appapigatewayqosoptions
@ -668,6 +672,7 @@ INSERT INTO `appapigatewayqosoptions` VALUES (104, NULL, 1290849478956199936, 50
INSERT INTO `appapigatewayqosoptions` VALUES (105, NULL, 1290849628051124224, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (105, NULL, 1290849628051124224, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (106, NULL, 1290849798553776128, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (106, NULL, 1290849798553776128, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (107, NULL, 1290849978032238592, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (107, NULL, 1290849978032238592, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (108, NULL, 1291259822512693248, 50, 60000, 30000);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayratelimitoptions -- Table structure for appapigatewayratelimitoptions
@ -709,7 +714,7 @@ CREATE TABLE `appapigatewayratelimitrule` (
UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 106 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayratelimitrule -- Records of appapigatewayratelimitrule
@ -793,6 +798,7 @@ INSERT INTO `appapigatewayratelimitrule` VALUES (101, 1290849478956199936, NULL,
INSERT INTO `appapigatewayratelimitrule` VALUES (102, 1290849628051124224, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (102, 1290849628051124224, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (103, 1290849798553776128, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (103, 1290849798553776128, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (104, 1290849978032238592, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (104, 1290849978032238592, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (105, 1291259822512693248, NULL, '', 0, NULL, NULL, NULL);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayreroute -- Table structure for appapigatewayreroute
@ -832,7 +838,7 @@ CREATE TABLE `appapigatewayreroute` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 108 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 113 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayreroute -- Records of appapigatewayreroute
@ -916,6 +922,7 @@ INSERT INTO `appapigatewayreroute` VALUES (108, '{}', '417a4518e0da4db0a2704511d
INSERT INTO `appapigatewayreroute` VALUES (109, '{}', 'e937ff4ea11e4f0ca39d079c7a83b960', 1290849628051124224, '【平台服务】- 用户配置', '/api/settings/by-user', '', '', '/api/settings/by-user', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (109, '{}', 'e937ff4ea11e4f0ca39d079c7a83b960', 1290849628051124224, '【平台服务】- 用户配置', '/api/settings/by-user', '', '', '/api/settings/by-user', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (110, '{}', '22212bc751b743678d9c2f095d05ce25', 1290849798553776128, '【平台服务】- 当前用户配置', '/api/settings/by-current-user', '', '', '/api/settings/by-current-user', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (110, '{}', '22212bc751b743678d9c2f095d05ce25', 1290849798553776128, '【平台服务】- 当前用户配置', '/api/settings/by-current-user', '', '', '/api/settings/by-current-user', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (111, '{}', '8dfa430d752a4b4a869ad401b3802a62', 1290849978032238592, '【平台服务】- 配置管理', '/api/settings', '', '', '/api/settings', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (111, '{}', '8dfa430d752a4b4a869ad401b3802a62', 1290849978032238592, '【平台服务】- 配置管理', '/api/settings', '', '', '/api/settings', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (112, '{}', '9844fed6507844f2ac64bd08649bd3a6', 1291259822512693248, '【身份认证服务】- 查询组织机构根节点', '/api/identity/organization-units/root-node', '', '', '/api/identity/organization-units/root-node', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayroutegroup -- Table structure for appapigatewayroutegroup
@ -959,7 +966,7 @@ CREATE TABLE `appapigatewaysecurityoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 106 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaysecurityoptions -- Records of appapigatewaysecurityoptions
@ -1043,6 +1050,7 @@ INSERT INTO `appapigatewaysecurityoptions` VALUES (101, 1290849478956199936, '',
INSERT INTO `appapigatewaysecurityoptions` VALUES (102, 1290849628051124224, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (102, 1290849628051124224, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (103, 1290849798553776128, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (103, 1290849798553776128, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (104, 1290849978032238592, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (104, 1290849978032238592, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (105, 1291259822512693248, '', '');
-- ---------------------------- -- ----------------------------
-- Table structure for cap.published -- Table structure for cap.published
@ -1061,6 +1069,10 @@ CREATE TABLE `cap.published` (
INDEX `IX_ExpiresAt`(`ExpiresAt`) USING BTREE INDEX `IX_ExpiresAt`(`ExpiresAt`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of cap.published
-- ----------------------------
INSERT INTO `cap.published` VALUES (1291259823775178752, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1291259823775178752\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/8/6 14:28:27 +08:00\",\"cap-corr-id\":\"1291259823775178752\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-08-06T14:28:27.0879956+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-08-06 14:28:27', '2020-08-07 14:28:27', 'Succeeded');
-- ---------------------------- -- ----------------------------
-- Table structure for cap.received -- Table structure for cap.received

29
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs

@ -49,22 +49,25 @@ namespace LINGYUN.Abp.Account
var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code); var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code);
var user = await UserManager.FindByLoginAsync("WeChat", wehchatOpenId.OpenId); var user = await UserManager.FindByLoginAsync("WeChat", wehchatOpenId.OpenId);
if (user == null) if (user != null)
{ {
var userName = input.UserName ?? wehchatOpenId.OpenId; // 应该要抛出微信号已注册异常,而不是直接返回注册用户数据,否则造成用户信息泄露
var userEmail = input.EmailAddress ?? $"{userName}@{new Random().Next(1000, 99999)}.com";//如果邮件地址不验证,随意写入一个 throw new UserFriendlyException(L["DuplicateWeChat"]);
}
user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id) var userName = input.UserName ?? wehchatOpenId.OpenId;
{ var userEmail = input.EmailAddress ?? $"{userName}@{new Random().Next(1000, 99999)}.com";//如果邮件地址不验证,随意写入一个
Name = input.Name ?? userName
};
(await UserManager.CreateAsync(user, input.Password)).CheckErrors();
(await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id)
{
Name = input.Name ?? userName
};
(await UserManager.CreateAsync(user, input.Password)).CheckErrors();
(await UserManager.AddDefaultRolesAsync(user)).CheckErrors();
var userLogin = new UserLoginInfo("WeChat", wehchatOpenId.OpenId, "微信认证登录");
(await UserManager.AddLoginAsync(user, userLogin)).CheckErrors();
var userLogin = new UserLoginInfo("WeChat", wehchatOpenId.OpenId, "微信认证登录");
(await UserManager.AddLoginAsync(user, userLogin)).CheckErrors();
}
return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user); return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
} }
/// <summary> /// <summary>

2
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs

@ -18,6 +18,8 @@ namespace LINGYUN.Abp.Identity
Task MoveAsync(Guid id, OrganizationUnitMoveDto input); Task MoveAsync(Guid id, OrganizationUnitMoveDto input);
Task<ListResultDto<OrganizationUnitDto>> GetRootAsync();
Task<ListResultDto<OrganizationUnitDto>> FindChildrenAsync(OrganizationUnitGetChildrenDto input); Task<ListResultDto<OrganizationUnitDto>> FindChildrenAsync(OrganizationUnitGetChildrenDto input);
Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(OrganizationUnitGetRoleByPagedDto input); Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(OrganizationUnitGetRoleByPagedDto input);

8
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs

@ -58,6 +58,14 @@ namespace LINGYUN.Abp.Identity
await OrganizationUnitManager.DeleteAsync(id); await OrganizationUnitManager.DeleteAsync(id);
} }
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetRootAsync()
{
var rootOriganizationUnits = await OrganizationUnitManager.FindChildrenAsync(null, recursive: false);
return new ListResultDto<OrganizationUnitDto>(
ObjectMapper.Map<List<OrganizationUnit>, List<OrganizationUnitDto>>(rootOriganizationUnits));
}
public virtual async Task<ListResultDto<OrganizationUnitDto>> FindChildrenAsync(OrganizationUnitGetChildrenDto input) public virtual async Task<ListResultDto<OrganizationUnitDto>> FindChildrenAsync(OrganizationUnitGetChildrenDto input)
{ {
var origanizationUnitChildren = await OrganizationUnitManager.FindChildrenAsync(input.Id, input.Recursive); var origanizationUnitChildren = await OrganizationUnitManager.FindChildrenAsync(input.Id, input.Recursive);

7
aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs

@ -64,6 +64,13 @@ namespace LINGYUN.Abp.Identity
return await OrganizationUnitAppService.GetAsync(id); return await OrganizationUnitAppService.GetAsync(id);
} }
[HttpGet]
[Route("root-node")]
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetRootAsync()
{
return await OrganizationUnitAppService.GetRootAsync();
}
[HttpGet] [HttpGet]
[Route("last-children")] [Route("last-children")]
public virtual async Task<OrganizationUnitDto> GetLastChildOrNullAsync(Guid? parentId) public virtual async Task<OrganizationUnitDto> GetLastChildOrNullAsync(Guid? parentId)

9
vueJs/src/api/organizationunit.ts

@ -18,6 +18,15 @@ export default class OrganizationUnitService {
return ApiService.Post<OrganizationUnit>(_url, payload, serviceUrl) return ApiService.Post<OrganizationUnit>(_url, payload, serviceUrl)
} }
/**
*
* @returns OrganizationUnit
*/
public static getRootOrganizationUnits() {
const _url = '/api/identity/organization-units/root-node'
return ApiService.Get<PagedResultDto<OrganizationUnit>>(_url, serviceUrl)
}
/** /**
* *
* @param payload * @param payload

48
vueJs/src/views/admin/organization-unit/components/EditOrganizationUint.vue

@ -48,7 +48,8 @@
<script lang="ts"> <script lang="ts">
import { Component, Vue } from 'vue-property-decorator' import { Component, Vue } from 'vue-property-decorator'
import OrganizationUnitService, { OrganizationUnitCreate } from '@/api/organizationunit' import { ListResultDto } from '@/api/types'
import OrganizationUnitService, { OrganizationUnitCreate, OrganizationUnit } from '@/api/organizationunit'
class OrganizationUnitTree { class OrganizationUnitTree {
id?: string id?: string
@ -86,38 +87,29 @@ export default class extends Vue {
rootOrganizationUnit.displayName = '组织机构' rootOrganizationUnit.displayName = '组织机构'
return resolve([rootOrganizationUnit]) return resolve([rootOrganizationUnit])
} }
let organizationUnitItems = new ListResultDto<OrganizationUnit>()
if (node.data.id === undefined) { if (node.data.id === undefined) {
const result = await OrganizationUnitService.findOrganizationUnitLastChildren(node.data.id) //
if (result) { organizationUnitItems = await OrganizationUnitService.getRootOrganizationUnits()
} else {
//
organizationUnitItems = await OrganizationUnitService.findOrganizationUnitChildren(node.data.id, undefined)
}
if (organizationUnitItems.items.length !== 0) {
const organizationUnits = new Array<OrganizationUnitTree>()
organizationUnitItems.items.map((item) => {
const organizationUnit = new OrganizationUnitTree() const organizationUnit = new OrganizationUnitTree()
organizationUnit.id = result.id organizationUnit.id = item.id
organizationUnit.parentId = result.parentId organizationUnit.parentId = item.parentId
organizationUnit.code = result.code organizationUnit.code = item.code
organizationUnit.displayName = result.displayName organizationUnit.displayName = item.displayName
organizationUnits.push(organizationUnit)
const children = node.data.children as OrganizationUnitTree[] const children = node.data.children as OrganizationUnitTree[]
if (!children.every(x => x.id === result.id)) { if (!children.every(x => x.id === item.id)) {
children.push(organizationUnit) children.push(organizationUnit)
} }
return resolve([organizationUnit]) })
} return resolve(organizationUnits)
} else {
const result = await OrganizationUnitService.findOrganizationUnitChildren(node.data.id, undefined)
if (result.items.length !== 0) {
const organizationUnits = new Array<OrganizationUnitTree>()
result.items.map((item) => {
const organizationUnit = new OrganizationUnitTree()
organizationUnit.id = item.id
organizationUnit.parentId = item.parentId
organizationUnit.code = item.code
organizationUnit.displayName = item.displayName
organizationUnits.push(organizationUnit)
const children = node.data.children as OrganizationUnitTree[]
if (!children.every(x => x.id === item.id)) {
children.push(organizationUnit)
}
})
return resolve(organizationUnits)
}
} }
return resolve([]) return resolve([])
} }

Loading…
Cancel
Save