diff --git a/apps/vben5/apps/app-antd/package.json b/apps/vben5/apps/app-antd/package.json index 8b95e821b..5a2f778b9 100644 --- a/apps/vben5/apps/app-antd/package.json +++ b/apps/vben5/apps/app-antd/package.json @@ -30,6 +30,7 @@ "@abp/auditing": "workspace:*", "@abp/core": "workspace:*", "@abp/identity": "workspace:*", + "@abp/openiddict": "workspace:*", "@abp/request": "workspace:*", "@abp/ui": "workspace:*", "@vben/access": "workspace:*", diff --git a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json index f995ca518..b042b148c 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json @@ -11,5 +11,12 @@ "organizationUnits": "Organization Units", "auditLogs": "Audit Logs" } + }, + "openiddict": { + "title": "OpenIddict", + "applications": "Applications", + "authorizations": "Authorizations", + "scopes": "Scopes", + "tokens": "Tokens" } } diff --git a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json index 3f6b04aa2..8159d12af 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json @@ -11,5 +11,12 @@ "organizationUnits": "组织机构", "auditLogs": "审计日志" } + }, + "openiddict": { + "title": "OpenIddict", + "applications": "应用管理", + "authorizations": "授权管理", + "scopes": "范围管理", + "tokens": "授权令牌" } } diff --git a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts index 457a439c5..680cfeeb4 100644 --- a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts +++ b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts @@ -92,6 +92,54 @@ const routes: RouteRecordRaw[] = [ }, ], }, + { + meta: { + title: $t('abp.openiddict.title'), + icon: 'mdi:openid', + }, + name: 'OpenIddict', + path: '/openiddict', + children: [ + { + meta: { + title: $t('abp.openiddict.applications'), + icon: 'carbon:application', + }, + name: 'OpenIddictApplications', + path: '/openiddict/applications', + component: () => + import('#/views/openiddict/applications/index.vue'), + }, + { + meta: { + title: $t('abp.openiddict.authorizations'), + icon: 'arcticons:ente-authenticator', + }, + name: 'OpenIddictAuthorizations', + path: '/openiddict/authorizations', + component: () => + import('#/views/openiddict/authorizations/index.vue'), + }, + { + meta: { + title: $t('abp.openiddict.scopes'), + icon: 'et:scope', + }, + name: 'OpenIddictScopes', + path: '/openiddict/scopes', + component: () => import('#/views/openiddict/scopes/index.vue'), + }, + { + meta: { + title: $t('abp.openiddict.tokens'), + icon: 'oui:token-key', + }, + name: 'OpenIddictTokens', + path: '/openiddict/tokens', + component: () => import('#/views/openiddict/tokens/index.vue'), + }, + ], + }, ], }, ]; diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue new file mode 100644 index 000000000..1e347ea86 --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue @@ -0,0 +1,15 @@ + + + + + + + diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue new file mode 100644 index 000000000..cb96f15fd --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue @@ -0,0 +1,15 @@ + + + + + + + diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/scopes/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/scopes/index.vue new file mode 100644 index 000000000..6b73e3266 --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/scopes/index.vue @@ -0,0 +1,15 @@ + + + + + + + diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/tokens/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/tokens/index.vue new file mode 100644 index 000000000..c575482e4 --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/tokens/index.vue @@ -0,0 +1,15 @@ + + + + + + + diff --git a/apps/vben5/apps/app-antd/vite.config.mts b/apps/vben5/apps/app-antd/vite.config.mts index 4ccb102a9..9ac834557 100644 --- a/apps/vben5/apps/app-antd/vite.config.mts +++ b/apps/vben5/apps/app-antd/vite.config.mts @@ -6,6 +6,13 @@ export default defineConfig(async () => { vite: { server: { proxy: { + '/.well-known': { + changeOrigin: true, + // rewrite: (path) => path.replace(/^\/api/, ''), + // mock代理目标地址 + target: 'http://127.0.0.1:30001/', + ws: true, + }, '/api': { changeOrigin: true, // rewrite: (path) => path.replace(/^\/api/, ''), diff --git a/apps/vben5/packages/@abp/core/src/types/index.ts b/apps/vben5/packages/@abp/core/src/types/index.ts index cde3fc4a5..b34d7c5f1 100644 --- a/apps/vben5/packages/@abp/core/src/types/index.ts +++ b/apps/vben5/packages/@abp/core/src/types/index.ts @@ -1,6 +1,7 @@ export * from './dto'; export * from './global'; export * from './localization'; +export * from './openid'; export * from './rules'; export * from './settings'; export * from './table'; diff --git a/apps/vben5/packages/@abp/core/src/types/openid.ts b/apps/vben5/packages/@abp/core/src/types/openid.ts new file mode 100644 index 000000000..e5bfca3f8 --- /dev/null +++ b/apps/vben5/packages/@abp/core/src/types/openid.ts @@ -0,0 +1,28 @@ +interface OpenIdConfiguration { + authorization_endpoint: string; + backchannel_logout_session_supported: boolean; + backchannel_logout_supported: boolean; + check_session_iframe: string; + claims_supported: string[]; + code_challenge_methods_supported: string[]; + device_authorization_endpoint: string; + end_session_endpoint: string; + frontchannel_logout_session_supported: boolean; + frontchannel_logout_supported: boolean; + grant_types_supported: string[]; + id_token_signing_alg_values_supported: string[]; + introspection_endpoint: string; + issuer: string; + jwks_uri: string; + request_parameter_supported: boolean; + response_modes_supported: string[]; + response_types_supported: string[]; + revocation_endpoint: string; + scopes_supported: string[]; + subject_types_supported: string[]; + token_endpoint: string; + token_endpoint_auth_methods_supported: string[]; + userinfo_endpoint: string; +} + +export type { OpenIdConfiguration }; diff --git a/apps/vben5/packages/@abp/identity/src/api/index.ts b/apps/vben5/packages/@abp/identity/src/api/index.ts new file mode 100644 index 000000000..fe13a9e18 --- /dev/null +++ b/apps/vben5/packages/@abp/identity/src/api/index.ts @@ -0,0 +1 @@ +export * as userLookupApi from './users-lookup'; diff --git a/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts b/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts new file mode 100644 index 000000000..443970ece --- /dev/null +++ b/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts @@ -0,0 +1,55 @@ +import type { ListResultDto } from '@abp/core'; + +import type { + IdentityUserDto, + UserLookupCountInput, + UserLookupSearchInput, +} from '../types/users'; + +import { requestClient } from '@abp/request'; + +/** + * 通过id查询用户 + * @param id 用户id + * @returns 用户实体数据传输对象 + */ +export function findByIdApi(id: string): Promise { + return requestClient.get(`/api/identity/users/lookup/${id}`); +} + +/** + * 通过用户名查询用户 + * @param userName 用户名 + * @returns 用户实体数据传输对象 + */ +export function findByUserNameApi(userName: string): Promise { + return requestClient.get( + `/api/identity/users/lookup/by-username/${userName}`, + ); +} + +/** + * 搜索用户列表 + * @param input 搜索过滤条件 + * @returns 用户实体数据传输对象列表 + */ +export function searchApi( + input?: UserLookupSearchInput, +): Promise> { + return requestClient.get>( + `/api/identity/users/lookup/search`, + { + params: input, + }, + ); +} + +/** + * 搜索用户数量 + * @param input 搜索过滤条件 + */ +export function countApi(input?: UserLookupCountInput): Promise { + return requestClient.get(`/api/identity/users/lookup/count`, { + params: input, + }); +} diff --git a/apps/vben5/packages/@abp/identity/src/constants/permissions.ts b/apps/vben5/packages/@abp/identity/src/constants/permissions.ts index 23faa1206..3d58d9e4b 100644 --- a/apps/vben5/packages/@abp/identity/src/constants/permissions.ts +++ b/apps/vben5/packages/@abp/identity/src/constants/permissions.ts @@ -45,3 +45,11 @@ export const SecurityLogPermissions = { /** 删除 */ Delete: 'AbpAuditing.SecurityLog.Delete', }; +/** + * 搜索用户权限 + * @deprecated 后台服务删除权限后将无法使用. + * @todo 需要检查abp框架权限定义 + */ +export const UserLookupPermissions = { + Default: 'AbpIdentity.UserLookup', +}; diff --git a/apps/vben5/packages/@abp/identity/src/index.ts b/apps/vben5/packages/@abp/identity/src/index.ts index c688f3a89..f43dbaee0 100644 --- a/apps/vben5/packages/@abp/identity/src/index.ts +++ b/apps/vben5/packages/@abp/identity/src/index.ts @@ -1,3 +1,4 @@ +export * from './api'; export * from './components'; export * from './constants'; export * from './types'; diff --git a/apps/vben5/packages/@abp/identity/src/types/users.ts b/apps/vben5/packages/@abp/identity/src/types/users.ts index 9c718cd88..b0d821947 100644 --- a/apps/vben5/packages/@abp/identity/src/types/users.ts +++ b/apps/vben5/packages/@abp/identity/src/types/users.ts @@ -90,6 +90,14 @@ interface GetUserPagedListInput extends PagedAndSortedResultRequestDto { type IdentityUserCreateDto = IdentityUserCreateOrUpdateDto; type IdentityUserUpdateDto = IdentityUserCreateOrUpdateDto; +interface UserLookupCountInput { + filter?: string; +} + +interface UserLookupSearchInput + extends UserLookupCountInput, + PagedAndSortedResultRequestDto {} + export type { ChangeMyPasswordInput, ChangeUserPasswordInput, @@ -98,4 +106,6 @@ export type { IdentityUserDto, IdentityUserOrganizationUnitUpdateDto, IdentityUserUpdateDto, + UserLookupCountInput, + UserLookupSearchInput, }; diff --git a/apps/vben5/packages/@abp/openiddict/package.json b/apps/vben5/packages/@abp/openiddict/package.json new file mode 100644 index 000000000..c5e925adc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -0,0 +1,43 @@ +{ + "name": "@abp/openiddict", + "version": "8.3.2", + "homepage": "https://github.com/colinin/abp-next-admin", + "bugs": "https://github.com/colinin/abp-next-admin/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/colinin/abp-next-admin.git", + "directory": "packages/@abp/openiddict" + }, + "license": "MIT", + "type": "module", + "sideEffects": [ + "**/*.css" + ], + "exports": { + ".": { + "types": "./src/index.ts", + "default": "./src/index.ts" + } + }, + "dependencies": { + "@abp/core": "workspace:*", + "@abp/identity": "workspace:*", + "@abp/permission": "workspace:*", + "@abp/request": "workspace:*", + "@abp/ui": "workspace:*", + "@ant-design/icons-vue": "catalog:", + "@vben/access": "workspace:*", + "@vben/common-ui": "workspace:*", + "@vben/hooks": "workspace:*", + "@vben/icons": "workspace:*", + "@vben/layouts": "workspace:*", + "@vben/locales": "workspace:*", + "ant-design-vue": "catalog:", + "lodash.debounce": "catalog:", + "vue": "catalog:*", + "vxe-table": "catalog:" + }, + "devDependencies": { + "@types/lodash.debounce": "catalog:" + } +} diff --git a/apps/vben5/packages/@abp/openiddict/src/api/applications.ts b/apps/vben5/packages/@abp/openiddict/src/api/applications.ts new file mode 100644 index 000000000..43aff5d92 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/applications.ts @@ -0,0 +1,74 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictApplicationCreateDto, + OpenIddictApplicationDto, + OpenIddictApplicationGetListInput, + OpenIddictApplicationUpdateDto, +} from '../types/applications'; + +import { requestClient } from '@abp/request'; + +/** + * 新增应用 + * @param input 参数 + * @returns 应用实体数据传输对象 + */ +export function createApi( + input: OpenIddictApplicationCreateDto, +): Promise { + return requestClient.post( + '/api/openiddict/applications', + input, + ); +} + +/** + * 删除应用 + * @param id 应用id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/applications/${id}`); +} + +/** + * 查询应用 + * @param id 应用id + * @returns 应用实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get( + `/api/openiddict/applications/${id}`, + ); +} + +/** + * 更新应用 + * @param id 应用id + * @returns 应用实体数据传输对象 + */ +export function updateApi( + id: string, + input: OpenIddictApplicationUpdateDto, +): Promise { + return requestClient.put( + `/api/openiddict/applications/${id}`, + input, + ); +} + +/** + * 查询应用分页列表 + * @param input 过滤参数 + * @returns 应用实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictApplicationGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/applications`, + { + params: input, + }, + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts b/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts new file mode 100644 index 000000000..94540540d --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts @@ -0,0 +1,43 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictAuthorizationDto, + OpenIddictAuthorizationGetListInput, +} from '../types/authorizations'; + +import { requestClient } from '@abp/request'; + +/** + * 删除授权 + * @param id 授权id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/authorizations/${id}`); +} + +/** + * 查询授权 + * @param id 授权id + * @returns 授权实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get( + `/api/openiddict/authorizations/${id}`, + ); +} + +/** + * 查询授权分页列表 + * @param input 过滤参数 + * @returns 授权实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictAuthorizationGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/authorizations`, + { + params: input, + }, + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/api/index.ts b/apps/vben5/packages/@abp/openiddict/src/api/index.ts new file mode 100644 index 000000000..620ac6955 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/index.ts @@ -0,0 +1,4 @@ +export * as applicationsApi from './applications'; +export * as authorizationsApi from './authorizations'; +export * as scopesApi from './scopes'; +export * as tokensApi from './tokens'; diff --git a/apps/vben5/packages/@abp/openiddict/src/api/openid.ts b/apps/vben5/packages/@abp/openiddict/src/api/openid.ts new file mode 100644 index 000000000..b9eec4dc6 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/openid.ts @@ -0,0 +1,13 @@ +import type { OpenIdConfiguration } from '@abp/core'; + +import { requestClient } from '@abp/request'; + +/** + * openid发现端点 + * @returns OpenId配置数据 + */ +export function discoveryApi(): Promise { + return requestClient.get( + '/.well-known/openid-configuration', + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts b/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts new file mode 100644 index 000000000..db1dd2f29 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/scopes.ts @@ -0,0 +1,72 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictScopeCreateDto, + OpenIddictScopeDto, + OpenIddictScopeGetListInput, + OpenIddictScopeUpdateDto, +} from '../types/scopes'; + +import { requestClient } from '@abp/request'; + +/** + * 新增范围 + * @param input 参数 + * @returns 范围实体数据传输对象 + */ +export function createApi( + input: OpenIddictScopeCreateDto, +): Promise { + return requestClient.post( + '/api/openiddict/scopes', + input, + ); +} + +/** + * 删除范围 + * @param id 范围id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/scopes/${id}`); +} + +/** + * 查询范围 + * @param id 范围id + * @returns 范围实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get(`/api/openiddict/scopes/${id}`); +} + +/** + * 更新范围 + * @param id 范围id + * @returns 范围实体数据传输对象 + */ +export function updateApi( + id: string, + input: OpenIddictScopeUpdateDto, +): Promise { + return requestClient.put( + `/api/openiddict/scopes/${id}`, + input, + ); +} + +/** + * 查询范围分页列表 + * @param input 过滤参数 + * @returns 范围实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictScopeGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/scopes`, + { + params: input, + }, + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/api/tokens.ts b/apps/vben5/packages/@abp/openiddict/src/api/tokens.ts new file mode 100644 index 000000000..1927d80a6 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/tokens.ts @@ -0,0 +1,41 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictTokenDto, + OpenIddictTokenGetListInput, +} from '../types/tokens'; + +import { requestClient } from '@abp/request'; + +/** + * 删除令牌 + * @param id 令牌id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/tokens/${id}`); +} + +/** + * 查询令牌 + * @param id 令牌id + * @returns 令牌实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get(`/api/openiddict/tokens/${id}`); +} + +/** + * 查询令牌分页列表 + * @param input 过滤参数 + * @returns 令牌实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictTokenGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/tokens`, + { + params: input, + }, + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue new file mode 100644 index 000000000..48234d459 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('AbpOpenIddict.Endpoints') }} + + + + + + {{ $t('AbpOpenIddict.DisplayName:RedirectUris') }} + + + {{ $t('AbpOpenIddict.DisplayName:PostLogoutRedirectUris') }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue new file mode 100644 index 000000000..cae8093ea --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue @@ -0,0 +1,82 @@ + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue new file mode 100644 index 000000000..93ca585da --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue @@ -0,0 +1,287 @@ + + + + + + + {{ $t('AbpOpenIddict.Applications:AddNew') }} + + + + + + + + + + + + + + + + + + + {{ $t('AbpUi.Edit') }} + + + + + {{ $t('AbpUi.Delete') }} + + + + + + onMenuClick(row, info)"> + + {{ $t('AbpOpenIddict.GenerateSecret') }} + + + {{ $t('AbpOpenIddict.ManagePermissions') }} + + + + + + + + + + query()" /> + query()" /> + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue new file mode 100644 index 000000000..cac36ece7 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue new file mode 100644 index 000000000..eb0e28715 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('AbpUi.Edit') }} + + + + + {{ $t('AbpUi.Delete') }} + + + + + + gridApi.query()" /> + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue new file mode 100644 index 000000000..1ad77f819 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue @@ -0,0 +1,81 @@ + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue new file mode 100644 index 000000000..2ac62bac1 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue @@ -0,0 +1,103 @@ + + + + + + + {{ $t('AbpOpenIddict.DisplayName:AddNew') }} + + + + + + + {{ $t('AbpUi.Delete') }} + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts b/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts new file mode 100644 index 000000000..709e230cb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts @@ -0,0 +1,11 @@ +import type { Dictionary } from '@abp/core'; + +interface DisplayNameInfo { + culture: string; + displayName: string; +} +interface DisplayNameProps { + data?: Dictionary; +} + +export type { DisplayNameInfo, DisplayNameProps }; diff --git a/apps/vben5/packages/@abp/openiddict/src/components/index.ts b/apps/vben5/packages/@abp/openiddict/src/components/index.ts new file mode 100644 index 000000000..53149584a --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/index.ts @@ -0,0 +1,4 @@ +export { default as ApplicationTable } from './applications/ApplicationTable.vue'; +export { default as AuthorizationTable } from './authorizations/AuthorizationTable.vue'; +export { default as ScopeTable } from './scopes/ScopeTable.vue'; +export { default as TokenTable } from './tokens/TokenTable.vue'; diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue new file mode 100644 index 000000000..2e58c12ee --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue @@ -0,0 +1,66 @@ + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue new file mode 100644 index 000000000..cd535e0fc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue @@ -0,0 +1,101 @@ + + + + + + + {{ $t('AbpOpenIddict.Propertites:New') }} + + + + + + + {{ $t('AbpUi.Delete') }} + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts b/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts new file mode 100644 index 000000000..5ab5c256b --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts @@ -0,0 +1,11 @@ +import type { Dictionary } from '@abp/core'; + +interface PropertyInfo { + key: string; + value: string; +} +interface PropertyProps { + data?: Dictionary; +} + +export type { PropertyInfo, PropertyProps }; diff --git a/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeModal.vue new file mode 100644 index 000000000..4d82b2a30 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeModal.vue @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeTable.vue new file mode 100644 index 000000000..e99d399bc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/scopes/ScopeTable.vue @@ -0,0 +1,199 @@ + + + + + + + {{ $t('AbpOpenIddict.Scopes:AddNew') }} + + + + + + + + + + + + + + + + + + + {{ $t('AbpUi.Edit') }} + + + + + {{ $t('AbpUi.Delete') }} + + + + + + query()" /> + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenModal.vue new file mode 100644 index 000000000..24fd7a822 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenModal.vue @@ -0,0 +1,165 @@ + + + + + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenTable.vue new file mode 100644 index 000000000..5b9e826fb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/tokens/TokenTable.vue @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('AbpUi.Edit') }} + + + + + {{ $t('AbpUi.Delete') }} + + + + + + gridApi.query()" /> + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue new file mode 100644 index 000000000..4302457f6 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue @@ -0,0 +1,52 @@ + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue new file mode 100644 index 000000000..956dea577 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue @@ -0,0 +1,106 @@ + + + + + + {{ title }} + + + + {{ $t('AbpOpenIddict.Uri:AddNew') }} + + + + + + + {{ $t('AbpUi.Delete') }} + + + + + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/constants/index.ts b/apps/vben5/packages/@abp/openiddict/src/constants/index.ts new file mode 100644 index 000000000..c85954d3e --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/constants/index.ts @@ -0,0 +1 @@ +export * from './permissions'; diff --git a/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts new file mode 100644 index 000000000..97604afae --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts @@ -0,0 +1,42 @@ +/** 应用权限 */ +export const ApplicationsPermissions = { + /** 新增 */ + Create: 'AbpOpenIddict.Applications.Create', + Default: 'AbpOpenIddict.Applications', + /** 删除 */ + Delete: 'AbpOpenIddict.Applications.Delete', + /** 管理功能 */ + ManageFeatures: 'AbpOpenIddict.Applications.ManageFeatures', + /** 管理权限 */ + ManagePermissions: 'AbpOpenIddict.Applications.ManagePermissions', + /** 管理密钥 */ + ManageSecret: 'AbpOpenIddict.Applications.ManageSecret', + /** 更新 */ + Update: 'AbpOpenIddict.Applications.Update', +}; +/** 授权权限 */ +export const AuthorizationsPermissions = { + /** 新增 */ + Create: 'AbpOpenIddict.Authorizations.Create', + Default: 'AbpOpenIddict.Authorizations', + /** 删除 */ + Delete: 'AbpOpenIddict.Authorizations.Delete', +}; +/** 范围权限 */ +export const ScopesPermissions = { + /** 新增 */ + Create: 'AbpOpenIddict.Scopes.Create', + Default: 'AbpOpenIddict.Scopes', + /** 删除 */ + Delete: 'AbpOpenIddict.Scopes.Delete', + /** 更新 */ + Update: 'AbpOpenIddict.Scopes.Update', +}; +/** 授权令牌权限 */ +export const TokensPermissions = { + /** 新增 */ + Create: 'AbpOpenIddict.Tokens.Create', + Default: 'AbpOpenIddict.Tokens', + /** 删除 */ + Delete: 'AbpOpenIddict.Tokens.Delete', +}; diff --git a/apps/vben5/packages/@abp/openiddict/src/index.ts b/apps/vben5/packages/@abp/openiddict/src/index.ts new file mode 100644 index 000000000..f43dbaee0 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/index.ts @@ -0,0 +1,4 @@ +export * from './api'; +export * from './components'; +export * from './constants'; +export * from './types'; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/applications.ts b/apps/vben5/packages/@abp/openiddict/src/types/applications.ts new file mode 100644 index 000000000..d964debc5 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/applications.ts @@ -0,0 +1,62 @@ +import type { + Dictionary, + ExtensibleAuditedEntityDto, + ExtensibleObject, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictApplicationGetListInput + extends PagedAndSortedResultRequestDto { + filter?: string; +} + +interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject { + applicationType?: string; + clientId: string; + clientSecret?: string; + clientType?: string; + clientUri?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + logoUri?: string; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + responseTypes?: string[]; + scopes?: string[]; +} + +type OpenIddictApplicationCreateDto = OpenIddictApplicationCreateOrUpdateDto; + +type OpenIddictApplicationUpdateDto = OpenIddictApplicationCreateOrUpdateDto; + +interface OpenIddictApplicationDto extends ExtensibleAuditedEntityDto { + applicationType?: string; + clientId: string; + clientSecret?: string; + clientType?: string; + clientUri?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + logoUri?: string; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + responseTypes?: string[]; + scopes?: string[]; +} + +export type { + OpenIddictApplicationCreateDto, + OpenIddictApplicationDto, + OpenIddictApplicationGetListInput, + OpenIddictApplicationUpdateDto, +}; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/authorizations.ts b/apps/vben5/packages/@abp/openiddict/src/types/authorizations.ts new file mode 100644 index 000000000..eedc7712d --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/authorizations.ts @@ -0,0 +1,29 @@ +import type { + Dictionary, + ExtensibleAuditedEntityDto, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictAuthorizationDto + extends ExtensibleAuditedEntityDto { + applicationId?: string; + creationDate?: string; + properties?: Dictionary; + scopes?: string[]; + status?: string; + subject?: string; + type?: string; +} + +interface OpenIddictAuthorizationGetListInput + extends PagedAndSortedResultRequestDto { + beginCreationTime?: string; + clientId?: string; + endCreationTime?: string; + filter?: string; + status?: string; + subject?: string; + type?: string; +} + +export type { OpenIddictAuthorizationDto, OpenIddictAuthorizationGetListInput }; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/index.ts b/apps/vben5/packages/@abp/openiddict/src/types/index.ts new file mode 100644 index 000000000..6933d8005 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/index.ts @@ -0,0 +1,4 @@ +export * from './applications'; +export * from './authorizations'; +export * from './scopes'; +export * from './tokens'; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/scopes.ts b/apps/vben5/packages/@abp/openiddict/src/types/scopes.ts new file mode 100644 index 000000000..6a0b35f94 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/scopes.ts @@ -0,0 +1,41 @@ +import type { + Dictionary, + ExtensibleAuditedEntityDto, + ExtensibleObject, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictScopeCreateOrUpdateDto extends ExtensibleObject { + description?: string; + descriptions?: Dictionary; + displayName?: string; + displayNames?: Dictionary; + name: string; + properties?: Dictionary; + resources?: string[]; +} + +type OpenIddictScopeCreateDto = OpenIddictScopeCreateOrUpdateDto; + +interface OpenIddictScopeGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; +} + +type OpenIddictScopeUpdateDto = OpenIddictScopeCreateOrUpdateDto; + +interface OpenIddictScopeDto extends ExtensibleAuditedEntityDto { + description?: string; + descriptions?: Dictionary; + displayName?: string; + displayNames?: Dictionary; + name: string; + properties?: Dictionary; + resources?: string[]; +} + +export type { + OpenIddictScopeCreateDto, + OpenIddictScopeDto, + OpenIddictScopeGetListInput, + OpenIddictScopeUpdateDto, +}; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/tokens.ts b/apps/vben5/packages/@abp/openiddict/src/types/tokens.ts new file mode 100644 index 000000000..3a5167d26 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/tokens.ts @@ -0,0 +1,34 @@ +import type { + ExtensibleAuditedEntityDto, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictTokenGetListInput extends PagedAndSortedResultRequestDto { + authorizationId?: string; + beginCreationTime?: string; + beginExpirationDate?: string; + clientId?: string; + endCreationTime?: string; + endExpirationDate?: string; + filter?: string; + referenceId?: string; + status?: string; + subject?: string; + type?: string; +} + +interface OpenIddictTokenDto extends ExtensibleAuditedEntityDto { + applicationId?: string; + authorizationId?: string; + creationDate?: string; + expirationDate?: string; + payload?: string; + properties?: string; + redemptionDate?: string; + referenceId?: string; + status?: string; + subject?: string; + type?: string; +} + +export type { OpenIddictTokenDto, OpenIddictTokenGetListInput }; diff --git a/apps/vben5/packages/@abp/openiddict/tsconfig.json b/apps/vben5/packages/@abp/openiddict/tsconfig.json new file mode 100644 index 000000000..ce1a891fb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/tsconfig.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@vben/tsconfig/web.json", + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue b/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue index 62cf75f3f..f8d121907 100644 --- a/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue +++ b/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue @@ -48,7 +48,8 @@ const permissionTree = ref([]); const getPermissionTab = computed(() => { return (tree: PermissionTree) => { const grantCount = getGrantPermissionCount(tree); - return `${tree.displayName} (${grantCount})`; + const permissionCount = getPermissionCount(tree); + return `${tree.displayName} (${grantCount}/${permissionCount})`; }; }); diff --git a/apps/vben5/pnpm-workspace.yaml b/apps/vben5/pnpm-workspace.yaml index e1a1a653f..1337072fc 100644 --- a/apps/vben5/pnpm-workspace.yaml +++ b/apps/vben5/pnpm-workspace.yaml @@ -46,6 +46,7 @@ catalog: '@types/html-minifier-terser': ^7.0.2 '@types/jsonwebtoken': ^9.0.7 '@types/lodash.clonedeep': ^4.5.9 + '@types/lodash.debounce': ^4.0.9 '@types/lodash.get': ^4.4.9 '@types/lodash.isequal': ^4.5.8 '@types/lodash.merge': ^4.6.9 @@ -119,6 +120,7 @@ catalog: jsonwebtoken: ^9.0.2 lint-staged: ^15.2.11 lodash.clonedeep: ^4.5.0 + lodash.debounce: ^4.0.8 lodash.get: ^4.4.2 lodash.isequal: ^4.5.0 lodash.merge: ^4.6.2