diff --git a/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs b/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs index 82b79243a..b70f9ad10 100644 --- a/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs +++ b/aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs @@ -1,6 +1,5 @@ using DotNetCore.CAP; using LINGYUN.Abp.EventBus.CAP; -using LINGYUN.Abp.IdentityServer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; @@ -8,23 +7,17 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; using StackExchange.Redis; using System; using System.Linq; using Volo.Abp; -using Volo.Abp.Account; -using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.Authentication.JwtBearer; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.Auditing; using Volo.Abp.Autofac; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.MySQL; -using Volo.Abp.Identity; +using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Localization; @@ -34,28 +27,19 @@ using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.TenantManagement.EntityFrameworkCore; using Volo.Abp.Threading; -using Volo.Abp.UI.Navigation.Urls; namespace AuthServer.Host { [DependsOn( - typeof(AbpIdentityServerApplicationModule), - typeof(AbpIdentityServerHttpApiModule), - typeof(AbpAccountApplicationModule), - typeof(AbpAccountWebIdentityServerModule), - typeof(AbpAspNetCoreMvcUiMultiTenancyModule), - typeof(AbpAspNetCoreMvcModule), - typeof(AbpAspNetCoreMvcUiBasicThemeModule), + typeof(AbpAspNetCoreMultiTenancyModule), typeof(AbpAutofacModule), typeof(AbpCAPEventBusModule), + typeof(AbpIdentityAspNetCoreModule), typeof(AbpEntityFrameworkCoreMySQLModule), - typeof(AbpIdentityHttpApiModule), - typeof(AbpIdentityApplicationModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpAspNetCoreAuthenticationJwtBearerModule) + typeof(AbpPermissionManagementEntityFrameworkCoreModule) )] public class AuthIdentityServerModule : AbpModule { @@ -86,14 +70,6 @@ namespace AuthServer.Host options.UseMySQL(); }); - context.Services.AddSwaggerGen( - options => - { - options.SwaggerDoc("v1", new OpenApiInfo { Title = "AuthServer API", Version = "v1" }); - options.DocInclusionPredicate((docName, description) => true); - options.CustomSchemaIds(type => type.FullName); - }); - Configure(options => { options.Languages.Add(new LanguageInfo("en", "en", "English")); @@ -106,18 +82,14 @@ namespace AuthServer.Host options.ApplicationName = "AuthServer"; }); - Configure(options => - { - options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; - }); - - context.Services.AddAuthentication() - .AddIdentityServerAuthentication(options => - { - options.Authority = configuration["AuthServer:Authority"]; - options.RequireHttpsMetadata = false; - options.ApiName = configuration["AuthServer:ApiName"]; - }); + // context.Services.AddAuthentication(); + //context.Services.AddAuthentication() + // .AddIdentityServerAuthentication(options => + // { + // options.Authority = configuration["AuthServer:Authority"]; + // options.RequireHttpsMetadata = false; + // options.ApiName = configuration["AuthServer:ApiName"]; + // }); Configure(options => { @@ -167,17 +139,9 @@ namespace AuthServer.Host app.UseAbpRequestLocalization(); app.UseRouting(); app.UseCors(DefaultCorsPolicyName); - app.UseAuthentication(); - app.UseJwtTokenMiddleware(); app.UseMultiTenancy(); app.UseIdentityServer(); - app.UseSwagger(); - app.UseSwaggerUI(options => - { - options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support AuthServer API"); - }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); SeedData(context); } diff --git a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj index 900ac7701..0d343a9f4 100644 --- a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj +++ b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj @@ -14,25 +14,17 @@ - - all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + - - @@ -42,17 +34,6 @@ - - - - - - - Always - - - Always - diff --git a/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml b/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml deleted file mode 100644 index af68a4616..000000000 --- a/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page -@using AuthServer.Host.Pages -@using Volo.Abp.Users -@model IndexModel -@inject ICurrentUser CurrentUser -@if (CurrentUser.IsAuthenticated) -{ -
- - - - Logout - - -

@CurrentUser.UserName

-
@CurrentUser.Email
-
- Roles: @CurrentUser.Roles.JoinAsString(", ") -
- Claims:
- @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString("
")) -
-
-
-
-} - -@if (!CurrentUser.IsAuthenticated) -{ -
-

- Login -
-} \ No newline at end of file diff --git a/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml.cs b/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml.cs deleted file mode 100644 index 61b644778..000000000 --- a/aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace AuthServer.Host.Pages -{ - public class IndexModel : AbpPageModel - { - public void OnGet() - { - } - } -} \ No newline at end of file diff --git a/aspnet-core/services/account/AuthServer.Host/Pages/_ViewImports.cshtml b/aspnet-core/services/account/AuthServer.Host/Pages/_ViewImports.cshtml deleted file mode 100644 index c1da1f5f1..000000000 --- a/aspnet-core/services/account/AuthServer.Host/Pages/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj index 0a21e6354..c0aa074f3 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj @@ -23,12 +23,18 @@ + - + + + + + + @@ -37,7 +43,8 @@ - + + @@ -45,4 +52,8 @@ + + + + diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs index 8d9419dc0..04a4bade1 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs @@ -17,11 +17,15 @@ using StackExchange.Redis; using System; using System.Collections.Generic; using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.Autofac; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; @@ -41,18 +45,25 @@ namespace LINGYUN.Platform typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityServerModule), typeof(ApiGatewayApplicationContractsModule), - typeof(AbpIdentityApplicationContractsModule), - typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpAccountApplicationModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityServerApplicationModule), + typeof(AbpIdentityServerHttpApiModule), typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementHttpApiModule), typeof(AbpPermissionManagementApplicationModule), + typeof(AbpPermissionManagementHttpApiModule), typeof(AbpTenantManagementApplicationModule), typeof(AbpTenantManagementHttpApiModule), - typeof(AbpPermissionManagementHttpApiModule), typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpCAPEventBusModule), typeof(AbpAutofacModule) )] @@ -151,6 +162,8 @@ namespace LINGYUN.Platform app.UseRouting(); // 认证 app.UseAuthentication(); + // jwt + app.UseJwtTokenMiddleware(); // 多租户 app.UseMultiTenancy(); // Swagger diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/tempkey.rsa b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/tempkey.rsa new file mode 100644 index 000000000..8679359d2 --- /dev/null +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/tempkey.rsa @@ -0,0 +1 @@ +{"KeyId":"UADq2_DSLpd3I00K3XOjqg","Parameters":{"D":"Byaqj2nCKV84tk4UcqS+s/X8aHpltuzywIOgB5ZIHEPPpYOyY053IA7Xs3CQFTo0/kRlcEmhOu4X4ctYbcDCNeUia2BEKQ3P7FQe/A8c+qkjAl7agTVoFlfwjtK/7z6rIi2WGLYMGL7oR7AjPUNDB7lTmmN5RDpPM+uCyetFp3S8cjimWiPi8miye6tpnNqYyNSah7rubTBNlgbjnZW0syfzm0zwY4ICh1vUHqYVk9yDfrSoco/j190z0Na6s0q4Kwbrz3zpAdGXWDnm1dAeJFIXwbTrv2eoAvFHSuh0/R3bldJOrorU/cE71+6TDwz6XCTCOa3+BEdu/ynDmSoV4Q==","DP":"hrKts8OotUvhGQfRyOFkyhJflqqqgy78YXZ5tOoyQsodZU4/cOfgLw7Ob9Buz305qHZEvb1SQhUCCgY52GDW7m9wTaldLNQ+g/9I4qVj5QtUxtH4xv4Ss3lmM2ZoAWD1vQJtTcUxFIcTlceuLp3FnuVWX05h3Pr7LuQOuC5rZ0c=","DQ":"C5df7OfbZyR5oRrLnjL6XpypKn3QnaQD3Sv5a7fJx9Y8wFFCC7w70raZtp9/7o9wWXMI38/6mGJ14XObZJDO7yjVOMg3X1SOAUkNd/Xxs67ibDCgcpWkW6mvDJwih2JH0emLUWHaIpmMjBWQbLQFCpkYE8SjCh69VcB1JKz8HTU=","Exponent":"AQAB","InverseQ":"XI07h975yuQgPyElSCIMCbNq+ZHX/7ue+YH+57OGRn83f+QWeJRaEOEtt0E0Y8D49yecdrZMntORCCD3/+HRpdUwX6ZXtSSuhnPiG4gV1/kqs1mNyg5HxDqwwUQje1HGnR8MvbTSkN6uIXwDSgHkrLjU3prlSSNQAVZxToDTNjk=","Modulus":"03z2iUdYKNL0n76zYEDZRAHkGNCoWuDFe6dXPqZRn2nPK9K0GfnPxYqZrccbeGiwkxs6w9H3SO7D6jE9H48+sHG2H7uOejh9Az1hD33PORT8tVsiM76ISfApcg6kvF93UWljnZcysN3sbgbOt71+CNIsykpbdcjx7sEBjS08YyvczNKmsSZZjEb6gnmQFwvN3Ih9PUIQYd+QqWbNWEuFYTvLIpIX7I3lAe9qBKWgg4wER+aLgiJ5YHxD0p3QXGJGsFmjp9zh2SKa6b/Y5jRwkAop5PAYZHW8lIkIaH9DYBk0D4b2wPifQQTL5QPTpdUrBXVNrSL5HftcB4TkDL/qVQ==","P":"12DITugP/tRWZhNxOTahc+ZNZJqhZIY72dFpu5T9if4dahvse4oPPuvENK7mr1jeCgfKNePOWp+IeQWaC8WCXaP9gi5MucLsdUiwWIfmu1vxzD0h1whGHQtCYUb0rMRj2LOyLXK5M3+PdFzJ4Zt0i80kNh55h0W5S7oBloOfhjM=","Q":"+2Bch4Vc7dx8fb+uFTp/4Wvnh/YZB1a0B3DjAJxWCSaCVY9dGRk08Mmmpcy2ItkcB73IVMjNX3mrR8rfUNUX4tbcuiZNjtGFfiQmtu2scTmc+lQWotMDVGB2c9EqfBZL6xthqrWU9lDpmtz46CYZS+nc1TI3zgBK7ViD6HX8dVc="}} \ No newline at end of file diff --git a/vueJs/src/api/roles.ts b/vueJs/src/api/roles.ts index 4e1464791..e80d45f97 100644 --- a/vueJs/src/api/roles.ts +++ b/vueJs/src/api/roles.ts @@ -1,7 +1,7 @@ import ApiService from './serviceBase' import { ListResultDto } from './types' -const IdentityServiceUrl = process.env.VUE_APP_BASE_IDENTITY_SERVICE +const IdentityServiceUrl = process.env.VUE_APP_BASE_API export default class RoleService { public static getRoles() { diff --git a/vueJs/src/api/users.ts b/vueJs/src/api/users.ts index fc9693a5e..f31625227 100644 --- a/vueJs/src/api/users.ts +++ b/vueJs/src/api/users.ts @@ -3,7 +3,7 @@ import { pagerFormat } from '@/utils/index' import { PagedAndSortedResultRequestDto, FullAuditedEntityDto, PagedResultDto } from '@/api/types' import ApiService from './serviceBase' -const IdentityServiceUrl = process.env.VUE_APP_BASE_IDENTITY_SERVICE +const IdentityServiceUrl = process.env.VUE_APP_BASE_API const IdentityServerUrl = process.env.VUE_APP_BASE_IDENTITY_SERVER export default class UserApiService { diff --git a/vueJs/src/lang/zh.ts b/vueJs/src/lang/zh.ts index f8751b75b..ab337103a 100644 --- a/vueJs/src/lang/zh.ts +++ b/vueJs/src/lang/zh.ts @@ -290,6 +290,8 @@ export default { updateRoute: '编辑路由', updateRouteByApp: '编辑路由 {name}', deleteRoute: '删除路由', + deleteRouteByName: '删除路由 {name}', + deleteRouteSuccess: '路由 {name} 已删除!', groupName: '路由组名', pleaseInputGroupName: '请输入路由组名称', appId: '应用标识', @@ -555,7 +557,7 @@ export default { deleteConnection: '删除连接', setTenantConnectionSuccess: '租户连接 {name} 已添加!', deleteTenantConnectionName: '删除租户连接 {name}', - deleteTenantConnectionSuccess: '租户连接 {name} 已删除!', + deleteTenantConnectionSuccess: '租户连接 {name} 已删除!' }, global: { name: '名称', diff --git a/vueJs/src/router/index.ts b/vueJs/src/router/index.ts index 6229de4ed..38763a00f 100644 --- a/vueJs/src/router/index.ts +++ b/vueJs/src/router/index.ts @@ -9,6 +9,10 @@ import Layout from '@/layout/index.vue' // import chartsRouter from './modules/charts' // import tableRouter from './modules/table' // import nestedRouter from './modules/nested' +import taskRouter from './modules/task' +import adminRouter from './modules/admin' +import apigatewayRouter from './modules/apigateway' +import identityServerRouter from './modules/identityServer' Vue.use(Router) @@ -88,273 +92,10 @@ export const constantRoutes: RouteConfig[] = [ } } ] - }, - // // { - // // path: '/documentation', - // // component: Layout, - // // children: [ - // // { - // // path: 'index', - // // component: () => import(/* webpackChunkName: "documentation" */ '@/views/documentation/index.vue'), - // // name: 'Documentation', - // // meta: { title: 'documentation', icon: 'documentation', affix: true } - // // } - // // ] - // // }, - // { - // path: '/guide', - // component: Layout, - // redirect: '/guide/index', - // children: [ - // { - // path: 'index', - // component: () => import(/* webpackChunkName: "guide" */ '@/views/guide/index.vue'), - // name: 'Guide', - // meta: { - // title: 'guide', - // icon: 'guide', - // noCache: true - // } - // } - // ] - // }, - { - path: '/icon', - component: Layout, - children: [ - { - path: 'index', - component: () => import(/* webpackChunkName: "icons" */ '@/views/icons/index.vue'), - name: 'Icons', - meta: { - title: 'icons', - icon: 'icon', - noCache: true - } - } - ] - }, - /** when your routing map is too long, you can split it into small modules **/ - // componentsRouter, - // chartsRouter, - // nestedRouter, - // tableRouter, - { - path: '/error', - component: Layout, - redirect: 'noredirect', - meta: { - title: 'errorPages', - icon: '404' - }, - children: [ - { - path: '401', - component: () => import(/* webpackChunkName: "error-page-401" */ '@/views/error-page/401.vue'), - name: 'Page401', - meta: { - title: 'page401', - noCache: true - } - }, - { - path: '404', - component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'), - name: 'Page404', - meta: { - title: 'page404', - noCache: true - } - } - ] } ] export const asyncRoutes: RouteConfig[] = [ - { - path: '/task', - component: Layout, - redirect: '/task', - meta: { - title: 'tasks', - icon: 'lock', - roles: ['AbpIdentity.Roles', 'TaskManagement.Task'], // you can set roles in root nav - alwaysShow: true // will always show the root menu - }, - children: [ - { - path: 'list', - component: () => import(/* webpackChunkName: "permission-page" */ '@/views/task/index.vue'), - name: 'tasks', - meta: { - title: 'tasks', - roles: ['AbpIdentity.Roles', 'TaskManagement.Task'] // or you can only set roles in sub nav - } - } - ] - }, - { - path: '/permission', - component: Layout, - redirect: '/permission/directive', - meta: { - title: 'permission', - icon: 'lock', - roles: ['admin', 'editor', 'AbpIdentity.Roles'], // you can set roles in root nav - alwaysShow: true // will always show the root menu - }, - children: [ - { - path: 'page', - component: () => import(/* webpackChunkName: "permission-page" */ '@/views/permission/page.vue'), - name: 'PagePermission', - meta: { - title: 'pagePermission', - roles: ['admin'] // or you can only set roles in sub nav - } - }, - { - path: 'directive', - component: () => import(/* webpackChunkName: "permission-directive" */ '@/views/permission/directive.vue'), - name: 'DirectivePermission', - meta: { - title: 'directivePermission' - // if do not set roles, means: this page does not require permission - } - }, - { - path: 'role', - component: () => import(/* webpackChunkName: "permission-role" */ '@/views/permission/role.vue'), - name: 'RolePermission', - meta: { - title: 'rolePermission', - roles: ['admin'] - } - } - ] - }, - { - path: '/i18n', - component: Layout, - meta: { - roles: ['AbpIdentity.Roles'] - }, - children: [ - { - path: 'index', - component: () => import('@/views/i18n-demo/index.vue'), - name: 'I18n', - meta: { - title: 'i18n', - icon: 'international' - } - } - ] - }, - { - path: '/apigateway', - component: Layout, - meta: { - title: 'apigateway', - icon: 'manager', - roles: ['ApiGateway.RouteGroup', 'ApiGateway.Global', 'ApiGateway.Route', 'ApiGateway.DynamicRoute', 'ApiGateway.AggregateRoute'], - alwaysShow: true - }, - children: [ - { - path: 'group', - component: () => import('@/views/admin/apigateway/group.vue'), - name: 'group', - meta: { - title: 'group', - icon: 'group', - roles: ['ApiGateway.RouteGroup'] - } - }, - { - path: 'global', - component: () => import('@/views/admin/apigateway/global.vue'), - name: 'global', - meta: { - title: 'global', - icon: 'global', - roles: ['ApiGateway.Global'] - } - }, - { - path: 'route', - component: () => import('@/views/admin/apigateway/route.vue'), - name: 'route', - meta: { - title: 'route', - icon: 'route', - roles: ['ApiGateway.Route'] - } - }, - { - path: 'aggregateRoute', - component: () => import('@/views/admin/apigateway/aggregateRoute.vue'), - name: 'aggregateRoute', - meta: { - title: 'aggregateRoute', - icon: 'aggregateRoute', - roles: ['ApiGateway.AggregateRoute'] - } - } - ] - }, - { - path: '/admin', - component: Layout, - meta: { - title: 'admin', - icon: 'manager', - roles: ['AbpIdentity.Users', 'AbpIdentity.Roles', 'AbpSettingManagement.Settings', 'AbpTenantManagement.Tenants'], // you can set roles in root nav - alwaysShow: true // will always show the root menu - }, - children: [ - { - path: 'settings', - component: () => import('@/views/admin/settings/index.vue'), - name: 'settings', - meta: { - title: 'settings', - icon: 'setting', - roles: ['AbpSettingManagement.Settings'] - } - }, - { - path: 'users', - component: () => import('@/views/admin/users/index.vue'), - name: 'users', - meta: { - title: 'users', - icon: 'user', - roles: ['AbpIdentity.Users'] - } - }, - { - path: 'roles', - component: () => import('@/views/admin/roles/index.vue'), - name: 'roles', - meta: { - title: 'roles', - icon: 'role', - roles: ['AbpIdentity.Roles'] - } - }, - { - path: 'tenants', - component: () => import('@/views/admin/tenants/index.vue'), - name: 'tenants', - meta: { - title: 'tenants', - icon: 'tenants', - roles: ['AbpTenantManagement.Tenants'] - } - } - ] - }, { path: '/profile', component: Layout, @@ -373,48 +114,10 @@ export const asyncRoutes: RouteConfig[] = [ } ] }, - { - path: '/identityServer', - component: Layout, - meta: { - title: 'identityServer', - icon: 'manager', - roles: ['IdentityServer.Clients', 'IdentityServer.ApiResources', 'IdentityServer.IdentityResources'], - alwaysShow: true - }, - children: [ - { - path: 'clients', - component: () => import('@/views/admin/identityServer/client/index.vue'), - name: 'clients', - meta: { - title: 'clients', - icon: 'clients', - roles: ['IdentityServer.Clients'] - } - }, - { - path: 'apiresources', - component: () => import('@/views/admin/identityServer/api-resources/index.vue'), - name: 'apiresources', - meta: { - title: 'apiresources', - icon: 'apiresources', - roles: ['IdentityServer.ApiResources'] - } - }, - { - path: 'identityresources', - component: () => import('@/views/admin/identityServer/identity-resources/index.vue'), - name: 'identityresources', - meta: { - title: 'identityresources', - icon: 'identityresources', - roles: ['IdentityServer.IdentityResources'] - } - } - ] - }, + taskRouter, + adminRouter, + apigatewayRouter, + identityServerRouter, { path: '*', component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'), diff --git a/vueJs/src/router/modules/admin.ts b/vueJs/src/router/modules/admin.ts new file mode 100644 index 000000000..c12e7a889 --- /dev/null +++ b/vueJs/src/router/modules/admin.ts @@ -0,0 +1,57 @@ +import { RouteConfig } from 'vue-router' +import Layout from '@/layout/index.vue' + +const adminRouter: RouteConfig = { + path: '/admin', + component: Layout, + meta: { + title: 'admin', + icon: 'manager', + roles: ['AbpIdentity.Users', 'AbpIdentity.Roles', 'AbpSettingManagement.Settings', 'AbpTenantManagement.Tenants'], // you can set roles in root nav + alwaysShow: true // will always show the root menu + }, + children: [ + { + path: 'settings', + component: () => import('@/views/admin/settings/index.vue'), + name: 'settings', + meta: { + title: 'settings', + icon: 'setting', + roles: ['AbpSettingManagement.Settings'] + } + }, + { + path: 'users', + component: () => import('@/views/admin/users/index.vue'), + name: 'users', + meta: { + title: 'users', + icon: 'user', + roles: ['AbpIdentity.Users'] + } + }, + { + path: 'roles', + component: () => import('@/views/admin/roles/index.vue'), + name: 'roles', + meta: { + title: 'roles', + icon: 'role', + roles: ['AbpIdentity.Roles'] + } + }, + { + path: 'tenants', + component: () => import('@/views/admin/tenants/index.vue'), + name: 'tenants', + meta: { + title: 'tenants', + icon: 'tenants', + roles: ['AbpTenantManagement.Tenants'] + } + } + ] +} + +export default adminRouter diff --git a/vueJs/src/router/modules/apigateway.ts b/vueJs/src/router/modules/apigateway.ts new file mode 100644 index 000000000..e171fb849 --- /dev/null +++ b/vueJs/src/router/modules/apigateway.ts @@ -0,0 +1,57 @@ +import { RouteConfig } from 'vue-router' +import Layout from '@/layout/index.vue' + +const apigatewayRouter: RouteConfig = { + path: '/apigateway', + component: Layout, + meta: { + title: 'apigateway', + icon: 'manager', + roles: ['ApiGateway.RouteGroup', 'ApiGateway.Global', 'ApiGateway.Route', 'ApiGateway.DynamicRoute', 'ApiGateway.AggregateRoute'], + alwaysShow: true + }, + children: [ + { + path: 'group', + component: () => import('@/views/admin/apigateway/group.vue'), + name: 'group', + meta: { + title: 'group', + icon: 'group', + roles: ['ApiGateway.RouteGroup'] + } + }, + { + path: 'global', + component: () => import('@/views/admin/apigateway/global.vue'), + name: 'global', + meta: { + title: 'global', + icon: 'global', + roles: ['ApiGateway.Global'] + } + }, + { + path: 'route', + component: () => import('@/views/admin/apigateway/route.vue'), + name: 'route', + meta: { + title: 'route', + icon: 'route', + roles: ['ApiGateway.Route'] + } + }, + { + path: 'aggregateRoute', + component: () => import('@/views/admin/apigateway/aggregateRoute.vue'), + name: 'aggregateRoute', + meta: { + title: 'aggregateRoute', + icon: 'aggregateRoute', + roles: ['ApiGateway.AggregateRoute'] + } + } + ] +} + +export default apigatewayRouter diff --git a/vueJs/src/router/modules/identityServer.ts b/vueJs/src/router/modules/identityServer.ts new file mode 100644 index 000000000..6de3f64be --- /dev/null +++ b/vueJs/src/router/modules/identityServer.ts @@ -0,0 +1,47 @@ +import { RouteConfig } from 'vue-router' +import Layout from '@/layout/index.vue' + +const identityServerRouter: RouteConfig = { + path: '/identityServer', + component: Layout, + meta: { + title: 'identityServer', + icon: 'manager', + roles: ['IdentityServer.Clients', 'IdentityServer.ApiResources', 'IdentityServer.IdentityResources'], + alwaysShow: true + }, + children: [ + { + path: 'clients', + component: () => import('@/views/admin/identityServer/client/index.vue'), + name: 'clients', + meta: { + title: 'clients', + icon: 'clients', + roles: ['IdentityServer.Clients'] + } + }, + { + path: 'apiresources', + component: () => import('@/views/admin/identityServer/api-resources/index.vue'), + name: 'apiresources', + meta: { + title: 'apiresources', + icon: 'apiresources', + roles: ['IdentityServer.ApiResources'] + } + }, + { + path: 'identityresources', + component: () => import('@/views/admin/identityServer/identity-resources/index.vue'), + name: 'identityresources', + meta: { + title: 'identityresources', + icon: 'identityresources', + roles: ['IdentityServer.IdentityResources'] + } + } + ] +} + +export default identityServerRouter diff --git a/vueJs/src/router/modules/task.ts b/vueJs/src/router/modules/task.ts new file mode 100644 index 000000000..7ff30a247 --- /dev/null +++ b/vueJs/src/router/modules/task.ts @@ -0,0 +1,27 @@ +import { RouteConfig } from 'vue-router' +import Layout from '@/layout/index.vue' + +const taskRouter: RouteConfig = { + path: '/task', + component: Layout, + redirect: '/task', + meta: { + title: 'tasks', + icon: 'lock', + roles: ['AbpIdentity.Roles', 'TaskManagement.Task'], // you can set roles in root nav + alwaysShow: true // will always show the root menu + }, + children: [ + { + path: 'list', + component: () => import(/* webpackChunkName: "permission-page" */ '@/views/task/index.vue'), + name: 'tasks', + meta: { + title: 'tasks', + roles: ['AbpIdentity.Roles', 'TaskManagement.Task'] // or you can only set roles in sub nav + } + } + ] +} + +export default taskRouter diff --git a/vueJs/src/views/admin/apigateway/route.vue b/vueJs/src/views/admin/apigateway/route.vue index 73f0c58a5..4a72abab5 100644 --- a/vueJs/src/views/admin/apigateway/route.vue +++ b/vueJs/src/views/admin/apigateway/route.vue @@ -178,7 +178,7 @@ :disabled="!checkPermission(['ApiGateway.Route.Delete'])" size="mini" type="warning" - @click="handleCreateOrEditRoute(row.reRouteId, row.reRouteName)" + @click="handleDeleteRoute(row.reRouteId, row.reRouteName)" > {{ $t('apiGateWay.deleteRoute') }} @@ -290,6 +290,20 @@ export default class extends Vue { this.routeGetPagedFilter.sorting = column.prop } + private handleDeleteRoute(reRouteId: number, reRouteName: string) { + this.$confirm(this.l('apiGateWay.deleteRouteByName', { name: reRouteName }), + this.l('apiGateWay.deleteRoute'), { + callback: (action) => { + if (action === 'confirm') { + ApiGatewayService.deleteReRoute(reRouteId).then(() => { + this.$message.success(this.l('apiGateWay.deleteRouteSuccess', { name: reRouteName })) + this.handleGetRoutes() + }) + } + } + }) + } + private handleCreateOrEditRoute(reRouteId: number, reRouteName: string) { this.editRouteId = reRouteId this.editRouteTitle = this.$t('apiGateWay.createRoute') @@ -307,5 +321,9 @@ export default class extends Vue { this.handleGetRoutes() } } + + private l(name: string, values?: any[] | { [key: string]: any }) { + return this.$t(name, values).toString() + } } diff --git a/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue b/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue index 5c1c0eb85..bf792b7be 100644 --- a/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue +++ b/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue @@ -21,7 +21,7 @@ > @@ -176,6 +176,8 @@ export default class extends Vue { public resetFields() { this.identityResource = IdentityResource.empty() + const frmIdentityResource = this.$refs.formIdentityResource as any + frmIdentityResource.resetFields() } private l(name: string, values?: any[] | { [key: string]: any }) {