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 index 6b7e75727..c5e925adc 100644 --- a/apps/vben5/packages/@abp/openiddict/package.json +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@abp/core": "workspace:*", + "@abp/identity": "workspace:*", "@abp/permission": "workspace:*", "@abp/request": "workspace:*", "@abp/ui": "workspace:*", @@ -32,7 +33,11 @@ "@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/components/authorizations/AuthorizationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue index 1017376d1..cac36ece7 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue @@ -1,7 +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 index 5b0d4f24c..eb0e28715 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue @@ -1,25 +1,26 @@