committed by
GitHub
2464 changed files with 144456 additions and 155369 deletions
@ -0,0 +1,27 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
IdentitySessionDto, |
||||
|
GetUserSessionsInput |
||||
|
} from './model'; |
||||
|
|
||||
|
/** |
||||
|
* 查询会话列表 |
||||
|
* @param { GetUserSessionsInput } input 查询参数 |
||||
|
* @returns { Promise<PagedResultDto<IdentitySessionDto>> } |
||||
|
*/ |
||||
|
export const getSessions = (input?: GetUserSessionsInput): Promise<PagedResultDto<IdentitySessionDto>> => { |
||||
|
return defHttp.get<PagedResultDto<IdentitySessionDto>>({ |
||||
|
url: '/api/identity/sessions', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
/** |
||||
|
* 撤销会话 |
||||
|
* @param { string } sessionId 会话id |
||||
|
* @returns { Promise<void> } |
||||
|
*/ |
||||
|
export const revokeSession = (sessionId: string): Promise<void> => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/sessions/${sessionId}/revoke`, |
||||
|
}); |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
export interface IdentitySessionDto extends EntityDto<string> { |
||||
|
sessionId: string; |
||||
|
device: string; |
||||
|
deviceInfo: string; |
||||
|
userId: string; |
||||
|
clientId?: string; |
||||
|
ipAddresses?: string; |
||||
|
signedIn: Date; |
||||
|
lastAccessed?: Date; |
||||
|
} |
||||
|
|
||||
|
export interface GetUserSessionsInput extends PagedAndSortedResultRequestDto { |
||||
|
userId?: string; |
||||
|
device?: string; |
||||
|
clientId?: string; |
||||
|
} |
||||
@ -0,0 +1,141 @@ |
|||||
|
<template> |
||||
|
<BasicModal |
||||
|
v-bind="$attrs" |
||||
|
@register="registerModal" |
||||
|
:width="800" |
||||
|
:height="500" |
||||
|
:title="L('IdentitySessions')" |
||||
|
:mask-closable="false" |
||||
|
:can-fullscreen="false" |
||||
|
:show-ok-btn="false" |
||||
|
> |
||||
|
<div :style="getContentStyle" ref="contentWrapRef" class="session"> |
||||
|
<ScrollContainer ref="contentScrollRef"> |
||||
|
<template v-for="identitySession in identitySessions" :key="identitySession.id"> |
||||
|
<Card style="height: 100%"> |
||||
|
<template #title> |
||||
|
<div class="session__tile"> |
||||
|
<span>{{ identitySession.device }}</span> |
||||
|
<div style="padding-left: 5px;"> |
||||
|
<Tag |
||||
|
v-if="identitySession.sessionId === abpStore.getApplication.currentUser.sessionId" |
||||
|
color="#87d068" |
||||
|
>{{ L('CurrentSession') }}</Tag> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<Descriptions bordered size="small" :column="1"> |
||||
|
<DescriptionItem :label="L('DisplayName:SessionId')">{{ identitySession.sessionId }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:Device')">{{ identitySession.device }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:DeviceInfo')">{{ identitySession.deviceInfo }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:ClientId')">{{ identitySession.clientId }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:IpAddresses')">{{ identitySession.ipAddresses }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:SignedIn')">{{ formatToDateTime(identitySession.signedIn) }}</DescriptionItem> |
||||
|
<DescriptionItem v-if="identitySession.lastAccessed" :label="L('DisplayName:LastAccessed')">{{ formatToDateTime(identitySession.lastAccessed) }}</DescriptionItem> |
||||
|
</Descriptions> |
||||
|
<template #extra> |
||||
|
<Button |
||||
|
v-if="identitySession.sessionId !== abpStore.getApplication.currentUser.sessionId" |
||||
|
danger |
||||
|
@click="handleRevokeSession(identitySession)" |
||||
|
>{{ L('RevokeSession') }}</Button> |
||||
|
</template> |
||||
|
</Card> |
||||
|
</template> |
||||
|
</ScrollContainer> |
||||
|
</div> |
||||
|
<template #footer> |
||||
|
<APagination |
||||
|
ref="paginationRef" |
||||
|
:pageSizeOptions="['10', '25', '50', '100']" |
||||
|
:total="identitySessionTotal" |
||||
|
@change="fetchSessions" |
||||
|
@showSizeChange="fetchSessions" |
||||
|
/> |
||||
|
</template> |
||||
|
</BasicModal> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import type { CSSProperties } from 'vue'; |
||||
|
import { computed, ref } from 'vue'; |
||||
|
import { Button, Card, Descriptions, Pagination, Tag } from 'ant-design-vue'; |
||||
|
import { BasicModal, useModalInner } from '/@/components/Modal'; |
||||
|
import { ScrollContainer } from '/@/components/Container'; |
||||
|
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
|
import { useLocalization } from '/@/hooks/abp/useLocalization'; |
||||
|
import { useContentHeight } from '/@/hooks/web/useContentHeight'; |
||||
|
import { useAbpStoreWithOut } from '/@/store/modules/abp'; |
||||
|
import { getSessions, revokeSession } from '/@/api/account/profiles'; |
||||
|
import { IdentitySessionDto } from '/@/api/identity/sessions/model'; |
||||
|
import { formatPagedRequest } from '/@/utils/http/abp/helper'; |
||||
|
import { formatToDateTime } from '/@/utils/dateUtil'; |
||||
|
|
||||
|
const DescriptionItem = Descriptions.Item; |
||||
|
const APagination = Pagination; |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
autoContentHeight: { |
||||
|
type: Boolean, |
||||
|
default: true, |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
const contentWrapRef = ref<any>(); |
||||
|
const contentScrollRef = ref<any>(); |
||||
|
const paginationRef = ref<any>(); |
||||
|
const getContentHeight = computed(() => props.autoContentHeight); |
||||
|
const { contentHeight } = useContentHeight(getContentHeight, contentWrapRef, [paginationRef], []); |
||||
|
const getContentStyle = computed((): CSSProperties => { |
||||
|
return { |
||||
|
width: '100%', |
||||
|
height: `${contentHeight.value}px`, |
||||
|
}; |
||||
|
}); |
||||
|
const identitySessions = ref<IdentitySessionDto[]>([]); |
||||
|
const identitySessionTotal = ref(0); |
||||
|
const abpStore = useAbpStoreWithOut(); |
||||
|
const { createConfirm, createMessage } = useMessage(); |
||||
|
const { L } = useLocalization(['AbpIdentity', 'AbpUi']); |
||||
|
const [registerModal] = useModalInner(() => { |
||||
|
fetchSessions(); |
||||
|
}); |
||||
|
|
||||
|
function fetchSessions(page: number = 1, pageSize: number = 10) { |
||||
|
const request = { |
||||
|
skipCount: page, |
||||
|
maxResultCount: pageSize, |
||||
|
}; |
||||
|
formatPagedRequest(request); |
||||
|
getSessions({ |
||||
|
skipCount: request.skipCount, |
||||
|
maxResultCount: request.maxResultCount, |
||||
|
}).then((res) => { |
||||
|
identitySessions.value = res.items; |
||||
|
identitySessionTotal.value = res.totalCount; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function handleRevokeSession(session: IdentitySessionDto) { |
||||
|
createConfirm({ |
||||
|
iconType: 'warning', |
||||
|
title: L('AreYouSure'), |
||||
|
content: L('SessionWillBeRevokedMessage'), |
||||
|
onOk: async () => { |
||||
|
await revokeSession(session.sessionId); |
||||
|
createMessage.success(L('SuccessfullyRevoked')); |
||||
|
fetchSessions(); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
.session { |
||||
|
.session__tile { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -0,0 +1,150 @@ |
|||||
|
<template> |
||||
|
<BasicModal |
||||
|
v-bind="$attrs" |
||||
|
@register="registerModal" |
||||
|
:width="800" |
||||
|
:height="500" |
||||
|
:title="L('IdentitySessions')" |
||||
|
:mask-closable="false" |
||||
|
:can-fullscreen="false" |
||||
|
:show-ok-btn="false" |
||||
|
> |
||||
|
<div v-if="identitySessions.length <= 0"> |
||||
|
<Empty /> |
||||
|
</div> |
||||
|
<div v-else :style="getContentStyle" ref="contentWrapRef" class="session"> |
||||
|
<ScrollContainer ref="contentScrollRef"> |
||||
|
<template v-for="identitySession in identitySessions" :key="identitySession.id"> |
||||
|
<Card style="height: 100%"> |
||||
|
<template #title> |
||||
|
<div class="session__tile"> |
||||
|
<span>{{ identitySession.device }}</span> |
||||
|
<div style="padding-left: 5px;"> |
||||
|
<Tag |
||||
|
v-if="identitySession.sessionId === abpStore.getApplication.currentUser.sessionId" |
||||
|
color="#87d068" |
||||
|
>{{ L('CurrentSession') }}</Tag> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<Descriptions bordered size="small" :column="1"> |
||||
|
<DescriptionItem :label="L('DisplayName:SessionId')">{{ identitySession.sessionId }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:Device')">{{ identitySession.device }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:DeviceInfo')">{{ identitySession.deviceInfo }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:ClientId')">{{ identitySession.clientId }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:IpAddresses')">{{ identitySession.ipAddresses }}</DescriptionItem> |
||||
|
<DescriptionItem :label="L('DisplayName:SignedIn')">{{ formatToDateTime(identitySession.signedIn) }}</DescriptionItem> |
||||
|
<DescriptionItem v-if="identitySession.lastAccessed" :label="L('DisplayName:LastAccessed')">{{ formatToDateTime(identitySession.lastAccessed) }}</DescriptionItem> |
||||
|
</Descriptions> |
||||
|
<template #extra> |
||||
|
<Button |
||||
|
v-auth="['AbpIdentity.IdentitySessions.Revoke']" |
||||
|
v-if="identitySession.sessionId !== abpStore.getApplication.currentUser.sessionId" |
||||
|
danger |
||||
|
@click="handleRevokeSession(identitySession)" |
||||
|
>{{ L('RevokeSession') }}</Button> |
||||
|
</template> |
||||
|
</Card> |
||||
|
</template> |
||||
|
</ScrollContainer> |
||||
|
</div> |
||||
|
<template #footer> |
||||
|
<APagination |
||||
|
v-if="identitySessions.length > 0" |
||||
|
ref="paginationRef" |
||||
|
:pageSizeOptions="['10', '25', '50', '100']" |
||||
|
:total="identitySessionTotal" |
||||
|
@change="fetchSessions" |
||||
|
@showSizeChange="fetchSessions" |
||||
|
/> |
||||
|
</template> |
||||
|
</BasicModal> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import type { CSSProperties } from 'vue'; |
||||
|
import { computed, ref } from 'vue'; |
||||
|
import { Button, Card, Descriptions, Empty, Pagination, Tag } from 'ant-design-vue'; |
||||
|
import { BasicModal, useModalInner } from '/@/components/Modal'; |
||||
|
import { ScrollContainer } from '/@/components/Container'; |
||||
|
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
|
import { useLocalization } from '/@/hooks/abp/useLocalization'; |
||||
|
import { useContentHeight } from '/@/hooks/web/useContentHeight'; |
||||
|
import { useAbpStoreWithOut } from '/@/store/modules/abp'; |
||||
|
import { getSessions, revokeSession } from '/@/api/identity/sessions'; |
||||
|
import { IdentitySessionDto } from '/@/api/identity/sessions/model'; |
||||
|
import { formatPagedRequest } from '/@/utils/http/abp/helper'; |
||||
|
import { formatToDateTime } from '/@/utils/dateUtil'; |
||||
|
|
||||
|
const DescriptionItem = Descriptions.Item; |
||||
|
const APagination = Pagination; |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
autoContentHeight: { |
||||
|
type: Boolean, |
||||
|
default: true, |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
const userId = ref(''); |
||||
|
const contentWrapRef = ref<any>(); |
||||
|
const contentScrollRef = ref<any>(); |
||||
|
const paginationRef = ref<any>(); |
||||
|
const getContentHeight = computed(() => props.autoContentHeight); |
||||
|
const { contentHeight } = useContentHeight(getContentHeight, contentWrapRef, [paginationRef], []); |
||||
|
const getContentStyle = computed((): CSSProperties => { |
||||
|
return { |
||||
|
width: '100%', |
||||
|
height: `${contentHeight.value}px`, |
||||
|
}; |
||||
|
}); |
||||
|
const identitySessions = ref<IdentitySessionDto[]>([]); |
||||
|
const identitySessionTotal = ref(0); |
||||
|
const abpStore = useAbpStoreWithOut(); |
||||
|
const { createConfirm, createMessage } = useMessage(); |
||||
|
const { L } = useLocalization(['AbpIdentity', 'AbpUi']); |
||||
|
const [registerModal] = useModalInner((data: { userId: string }) => { |
||||
|
userId.value = data.userId; |
||||
|
identitySessions.value = []; |
||||
|
fetchSessions(); |
||||
|
}); |
||||
|
|
||||
|
function fetchSessions(page: number = 1, pageSize: number = 10) { |
||||
|
const request = { |
||||
|
skipCount: page, |
||||
|
maxResultCount: pageSize, |
||||
|
}; |
||||
|
formatPagedRequest(request); |
||||
|
getSessions({ |
||||
|
userId: userId.value, |
||||
|
skipCount: request.skipCount, |
||||
|
maxResultCount: request.maxResultCount, |
||||
|
}).then((res) => { |
||||
|
identitySessions.value = res.items; |
||||
|
identitySessionTotal.value = res.totalCount; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function handleRevokeSession(session: IdentitySessionDto) { |
||||
|
createConfirm({ |
||||
|
iconType: 'warning', |
||||
|
title: L('AreYouSure'), |
||||
|
content: L('SessionWillBeRevokedMessage'), |
||||
|
onOk: async () => { |
||||
|
await revokeSession(session.sessionId); |
||||
|
createMessage.success(L('SuccessfullyRevoked')); |
||||
|
fetchSessions(); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
.session { |
||||
|
.session__tile { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -1,17 +1,16 @@ |
|||||
using Nest; |
using Nest; |
||||
|
|
||||
namespace LINGYUN.Abp.AuditLogging.Elasticsearch |
namespace LINGYUN.Abp.AuditLogging.Elasticsearch; |
||||
|
|
||||
|
public class AbpAuditLoggingElasticsearchOptions |
||||
{ |
{ |
||||
public class AbpAuditLoggingElasticsearchOptions |
public const string DefaultIndexPrefix = "auditlogging"; |
||||
{ |
public string IndexPrefix { get; set; } |
||||
public const string DefaultIndexPrefix = "auditlogging"; |
public IIndexSettings IndexSettings { get; set; } |
||||
public string IndexPrefix { get; set; } |
|
||||
public IIndexSettings IndexSettings { get; set; } |
|
||||
|
|
||||
public AbpAuditLoggingElasticsearchOptions() |
public AbpAuditLoggingElasticsearchOptions() |
||||
{ |
{ |
||||
IndexPrefix = DefaultIndexPrefix; |
IndexPrefix = DefaultIndexPrefix; |
||||
IndexSettings = new IndexSettings(); |
IndexSettings = new IndexSettings(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Auditing; |
using Volo.Abp.Auditing; |
||||
|
|
||||
namespace LINGYUN.Abp.AuditLogging |
namespace LINGYUN.Abp.AuditLogging; |
||||
|
|
||||
|
public interface IAuditLogInfoToAuditLogConverter |
||||
{ |
{ |
||||
public interface IAuditLogInfoToAuditLogConverter |
Task<AuditLog> ConvertAsync(AuditLogInfo auditLogInfo); |
||||
{ |
|
||||
Task<AuditLog> ConvertAsync(AuditLogInfo auditLogInfo); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace LINGYUN.Abp.AuditLogging.Elasticsearch |
namespace LINGYUN.Abp.AuditLogging.Elasticsearch; |
||||
|
|
||||
|
public interface IIndexInitializer |
||||
{ |
{ |
||||
public interface IIndexInitializer |
Task InitializeAsync(); |
||||
{ |
|
||||
Task InitializeAsync(); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace LINGYUN.Abp.AuditLogging.Elasticsearch |
namespace LINGYUN.Abp.AuditLogging.Elasticsearch; |
||||
|
|
||||
|
public interface IIndexNameNormalizer |
||||
{ |
{ |
||||
public interface IIndexNameNormalizer |
string NormalizeIndex(string index); |
||||
{ |
|
||||
string NormalizeIndex(string index); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,21 +1,20 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore |
namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore; |
||||
|
|
||||
|
public class AbpAuditingMapperProfile : Profile |
||||
{ |
{ |
||||
public class AbpAuditingMapperProfile : Profile |
public AbpAuditingMapperProfile() |
||||
{ |
{ |
||||
public AbpAuditingMapperProfile() |
CreateMap<Volo.Abp.AuditLogging.AuditLogAction, LINGYUN.Abp.AuditLogging.AuditLogAction>() |
||||
{ |
.MapExtraProperties(); |
||||
CreateMap<Volo.Abp.AuditLogging.AuditLogAction, LINGYUN.Abp.AuditLogging.AuditLogAction>() |
CreateMap<Volo.Abp.AuditLogging.EntityPropertyChange, LINGYUN.Abp.AuditLogging.EntityPropertyChange>(); |
||||
.MapExtraProperties(); |
CreateMap<Volo.Abp.AuditLogging.EntityChange, LINGYUN.Abp.AuditLogging.EntityChange>() |
||||
CreateMap<Volo.Abp.AuditLogging.EntityPropertyChange, LINGYUN.Abp.AuditLogging.EntityPropertyChange>(); |
.MapExtraProperties(); |
||||
CreateMap<Volo.Abp.AuditLogging.EntityChange, LINGYUN.Abp.AuditLogging.EntityChange>() |
CreateMap<Volo.Abp.AuditLogging.AuditLog, LINGYUN.Abp.AuditLogging.AuditLog>() |
||||
.MapExtraProperties(); |
.MapExtraProperties(); |
||||
CreateMap<Volo.Abp.AuditLogging.AuditLog, LINGYUN.Abp.AuditLogging.AuditLog>() |
|
||||
.MapExtraProperties(); |
|
||||
|
|
||||
CreateMap<Volo.Abp.Identity.IdentitySecurityLog, LINGYUN.Abp.AuditLogging.SecurityLog>() |
CreateMap<Volo.Abp.Identity.IdentitySecurityLog, LINGYUN.Abp.AuditLogging.SecurityLog>() |
||||
.MapExtraProperties(); |
.MapExtraProperties(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,122 +1,120 @@ |
|||||
using System; |
using System; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using Volo.Abp.Auditing; |
|
||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
|
|
||||
namespace LINGYUN.Abp.AuditLogging |
namespace LINGYUN.Abp.AuditLogging; |
||||
|
|
||||
|
public class AuditLog : IHasExtraProperties |
||||
{ |
{ |
||||
public class AuditLog : IHasExtraProperties |
public Guid Id { get; set; } |
||||
{ |
|
||||
public Guid Id { get; set; } |
|
||||
|
|
||||
public string ApplicationName { get; set; } |
public string? ApplicationName { get; set; } |
||||
|
|
||||
public Guid? UserId { get; set; } |
public Guid? UserId { get; set; } |
||||
|
|
||||
public string UserName { get; set; } |
public string? UserName { get; set; } |
||||
|
|
||||
public Guid? TenantId { get; set; } |
public Guid? TenantId { get; set; } |
||||
|
|
||||
public string TenantName { get; set; } |
public string? TenantName { get; set; } |
||||
|
|
||||
public Guid? ImpersonatorUserId { get; set; } |
public Guid? ImpersonatorUserId { get; set; } |
||||
|
|
||||
public string ImpersonatorUserName { get; set; } |
public string? ImpersonatorUserName { get; set; } |
||||
|
|
||||
public Guid? ImpersonatorTenantId { get; set; } |
public Guid? ImpersonatorTenantId { get; set; } |
||||
|
|
||||
public string ImpersonatorTenantName { get; set; } |
public string? ImpersonatorTenantName { get; set; } |
||||
|
|
||||
public DateTime ExecutionTime { get; set; } |
public DateTime ExecutionTime { get; set; } |
||||
|
|
||||
public int ExecutionDuration { get; set; } |
public int ExecutionDuration { get; set; } |
||||
|
|
||||
public string ClientIpAddress { get; set; } |
public string? ClientIpAddress { get; set; } |
||||
|
|
||||
public string ClientName { get; set; } |
public string? ClientName { get; set; } |
||||
|
|
||||
public string ClientId { get; set; } |
public string? ClientId { get; set; } |
||||
|
|
||||
public string CorrelationId { get; set; } |
public string? CorrelationId { get; set; } |
||||
|
|
||||
public string BrowserInfo { get; set; } |
public string? BrowserInfo { get; set; } |
||||
|
|
||||
public string HttpMethod { get; set; } |
public string? HttpMethod { get; set; } |
||||
|
|
||||
public string Url { get; set; } |
public string? Url { get; set; } |
||||
|
|
||||
public string Exceptions { get; set; } |
public string? Exceptions { get; set; } |
||||
|
|
||||
public string Comments { get; set; } |
public string? Comments { get; set; } |
||||
|
|
||||
public int? HttpStatusCode { get; set; } |
public int? HttpStatusCode { get; set; } |
||||
|
|
||||
public List<EntityChange> EntityChanges { get; set; } |
public List<EntityChange> EntityChanges { get; set; } |
||||
|
|
||||
public List<AuditLogAction> Actions { get; set; } |
public List<AuditLogAction> Actions { get; set; } |
||||
|
|
||||
public ExtraPropertyDictionary ExtraProperties { get; set; } |
public ExtraPropertyDictionary ExtraProperties { get; set; } |
||||
|
|
||||
public AuditLog() |
public AuditLog() |
||||
{ |
{ |
||||
Actions = new List<AuditLogAction>(); |
Actions = new List<AuditLogAction>(); |
||||
EntityChanges = new List<EntityChange>(); |
EntityChanges = new List<EntityChange>(); |
||||
ExtraProperties = new ExtraPropertyDictionary(); |
ExtraProperties = new ExtraPropertyDictionary(); |
||||
} |
} |
||||
|
|
||||
public AuditLog( |
public AuditLog( |
||||
Guid id, |
Guid id, |
||||
string applicationName, |
string? applicationName, |
||||
Guid? tenantId, |
Guid? tenantId, |
||||
string tenantName, |
string? tenantName, |
||||
Guid? userId, |
Guid? userId, |
||||
string userName, |
string? userName, |
||||
DateTime executionTime, |
DateTime executionTime, |
||||
int executionDuration, |
int executionDuration, |
||||
string clientIpAddress, |
string? clientIpAddress, |
||||
string clientName, |
string? clientName, |
||||
string clientId, |
string? clientId, |
||||
string correlationId, |
string? correlationId, |
||||
string browserInfo, |
string? browserInfo, |
||||
string httpMethod, |
string? httpMethod, |
||||
string url, |
string? url, |
||||
int? httpStatusCode, |
int? httpStatusCode, |
||||
Guid? impersonatorUserId, |
Guid? impersonatorUserId, |
||||
string impersonatorUserName, |
string? impersonatorUserName, |
||||
Guid? impersonatorTenantId, |
Guid? impersonatorTenantId, |
||||
string impersonatorTenantName, |
string? impersonatorTenantName, |
||||
ExtraPropertyDictionary extraPropertyDictionary, |
ExtraPropertyDictionary extraPropertyDictionary, |
||||
List<EntityChange> entityChanges, |
List<EntityChange> entityChanges, |
||||
List<AuditLogAction> actions, |
List<AuditLogAction> actions, |
||||
string exceptions, |
string? exceptions, |
||||
string comments) |
string? comments) |
||||
{ |
{ |
||||
Id = id; |
Id = id; |
||||
ApplicationName = applicationName; |
ApplicationName = applicationName; |
||||
TenantId = tenantId; |
TenantId = tenantId; |
||||
TenantName = tenantName; |
TenantName = tenantName; |
||||
UserId = userId; |
UserId = userId; |
||||
UserName = userName; |
UserName = userName; |
||||
ExecutionTime = executionTime; |
ExecutionTime = executionTime; |
||||
ExecutionDuration = executionDuration; |
ExecutionDuration = executionDuration; |
||||
ClientIpAddress = clientIpAddress; |
ClientIpAddress = clientIpAddress; |
||||
ClientName = clientName; |
ClientName = clientName; |
||||
ClientId = clientId; |
ClientId = clientId; |
||||
CorrelationId = correlationId; |
CorrelationId = correlationId; |
||||
BrowserInfo = browserInfo; |
BrowserInfo = browserInfo; |
||||
HttpMethod = httpMethod; |
HttpMethod = httpMethod; |
||||
Url = url; |
Url = url; |
||||
HttpStatusCode = httpStatusCode; |
HttpStatusCode = httpStatusCode; |
||||
ImpersonatorUserId = impersonatorUserId; |
ImpersonatorUserId = impersonatorUserId; |
||||
ImpersonatorUserName = impersonatorUserName; |
ImpersonatorUserName = impersonatorUserName; |
||||
ImpersonatorTenantId = impersonatorTenantId; |
ImpersonatorTenantId = impersonatorTenantId; |
||||
ImpersonatorTenantName = impersonatorTenantName; |
ImpersonatorTenantName = impersonatorTenantName; |
||||
|
|
||||
ExtraProperties = extraPropertyDictionary; |
ExtraProperties = extraPropertyDictionary; |
||||
EntityChanges = entityChanges; |
EntityChanges = entityChanges; |
||||
Actions = actions; |
Actions = actions; |
||||
Exceptions = exceptions; |
Exceptions = exceptions; |
||||
Comments = comments; |
Comments = comments; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace LINGYUN.Abp.AuditLogging |
namespace LINGYUN.Abp.AuditLogging; |
||||
|
|
||||
|
public class EntityChangeWithUsername |
||||
{ |
{ |
||||
public class EntityChangeWithUsername |
public EntityChange EntityChange { get; set; } |
||||
{ |
|
||||
public EntityChange EntityChange { get; set; } |
|
||||
|
|
||||
public string UserName { get; set; } |
public string UserName { get; set; } |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,31 +1,30 @@ |
|||||
namespace LINGYUN.Abp.Authentication.QQ |
namespace LINGYUN.Abp.Authentication.QQ; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// QQ互联身份类型,可以像 <see cref="Volo.Abp.Security.Claims.AbpClaimTypes"/> 自行配置
|
||||
|
/// <br />
|
||||
|
/// See: <see cref="https://wiki.connect.qq.com/get_user_info"/>
|
||||
|
/// </summary>
|
||||
|
public class AbpQQClaimTypes |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// QQ互联身份类型,可以像 <see cref="Volo.Abp.Security.Claims.AbpClaimTypes"/> 自行配置
|
/// 用户的唯一标识
|
||||
/// <br />
|
|
||||
/// See: <see cref="https://wiki.connect.qq.com/get_user_info"/>
|
|
||||
/// </summary>
|
/// </summary>
|
||||
public class AbpQQClaimTypes |
public static string OpenId { get; set; } = "qq-openid"; // 可变更
|
||||
{ |
/// <summary>
|
||||
/// <summary>
|
/// 用户昵称
|
||||
/// 用户的唯一标识
|
/// </summary>
|
||||
/// </summary>
|
public static string NickName { get; set; } = "nickname"; |
||||
public static string OpenId { get; set; } = "qq-openid"; // 可变更
|
/// <summary>
|
||||
/// <summary>
|
/// 性别。 如果获取不到则默认返回"男"
|
||||
/// 用户昵称
|
/// </summary>
|
||||
/// </summary>
|
public static string Gender { get; set; } = "gender"; |
||||
public static string NickName { get; set; } = "nickname"; |
/// <summary>
|
||||
/// <summary>
|
/// 用户头像, 取自字段: figureurl_qq_1
|
||||
/// 性别。 如果获取不到则默认返回"男"
|
/// </summary>
|
||||
/// </summary>
|
/// <remarks>
|
||||
public static string Gender { get; set; } = "gender"; |
/// 根据QQ互联文档, 40x40的头像是一定会存在的, 只取40x40的头像
|
||||
/// <summary>
|
/// see: https://wiki.connect.qq.com/get_user_info
|
||||
/// 用户头像, 取自字段: figureurl_qq_1
|
/// </remarks>
|
||||
/// </summary>
|
public static string AvatarUrl { get; set; } = "avatar"; |
||||
/// <remarks>
|
|
||||
/// 根据QQ互联文档, 40x40的头像是一定会存在的, 只取40x40的头像
|
|
||||
/// see: https://wiki.connect.qq.com/get_user_info
|
|
||||
/// </remarks>
|
|
||||
public static string AvatarUrl { get; set; } = "avatar"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using System.Security.Cryptography; |
using System.Security.Cryptography; |
||||
|
|
||||
namespace System |
namespace System; |
||||
|
|
||||
|
internal static class BytesExtensions |
||||
{ |
{ |
||||
internal static class BytesExtensions |
public static byte[] Sha1(this byte[] data) |
||||
{ |
{ |
||||
public static byte[] Sha1(this byte[] data) |
using (var sha = SHA1.Create()) |
||||
{ |
{ |
||||
using (var sha = SHA1.Create()) |
var hashBytes = sha.ComputeHash(data); |
||||
{ |
return hashBytes; |
||||
var hashBytes = sha.ComputeHash(data); |
|
||||
return hashBytes; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,17 +1,16 @@ |
|||||
using System.Security.Cryptography; |
using System.Security.Cryptography; |
||||
using System.Text; |
using System.Text; |
||||
|
|
||||
namespace System |
namespace System; |
||||
|
|
||||
|
internal static class StringExtensions |
||||
{ |
{ |
||||
internal static class StringExtensions |
public static byte[] Sha1(this string str) |
||||
{ |
{ |
||||
public static byte[] Sha1(this string str) |
using (var sha = SHA1.Create()) |
||||
{ |
{ |
||||
using (var sha = SHA1.Create()) |
var hashBytes = sha.ComputeHash(Encoding.ASCII.GetBytes(str)); |
||||
{ |
return hashBytes; |
||||
var hashBytes = sha.ComputeHash(Encoding.ASCII.GetBytes(str)); |
|
||||
return hashBytes; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,63 +1,62 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace System.Text.Json |
namespace System.Text.Json; |
||||
|
|
||||
|
internal static class JsonElementExtensions |
||||
{ |
{ |
||||
internal static class JsonElementExtensions |
public static IEnumerable<string> GetRootStrings(this JsonDocument json, string key) |
||||
{ |
{ |
||||
public static IEnumerable<string> GetRootStrings(this JsonDocument json, string key) |
return json.RootElement.GetStrings(key); |
||||
{ |
} |
||||
return json.RootElement.GetStrings(key); |
|
||||
} |
|
||||
|
|
||||
public static IEnumerable<string> GetStrings(this JsonElement json, string key) |
public static IEnumerable<string> GetStrings(this JsonElement json, string key) |
||||
{ |
{ |
||||
var result = new List<string>(); |
var result = new List<string>(); |
||||
|
|
||||
if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array) |
if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array) |
||||
|
{ |
||||
|
foreach (var jsonProp in property.EnumerateArray()) |
||||
{ |
{ |
||||
foreach (var jsonProp in property.EnumerateArray()) |
result.Add(jsonProp.GetString()); |
||||
{ |
|
||||
result.Add(jsonProp.GetString()); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
return result; |
|
||||
} |
} |
||||
|
|
||||
public static string GetRootString(this JsonDocument json, string key, string defaultValue = "") |
return result; |
||||
|
} |
||||
|
|
||||
|
public static string GetRootString(this JsonDocument json, string key, string defaultValue = "") |
||||
|
{ |
||||
|
if (json.RootElement.TryGetProperty(key, out JsonElement property)) |
||||
{ |
{ |
||||
if (json.RootElement.TryGetProperty(key, out JsonElement property)) |
return property.GetString(); |
||||
{ |
|
||||
return property.GetString(); |
|
||||
} |
|
||||
return defaultValue; |
|
||||
} |
} |
||||
|
return defaultValue; |
||||
|
} |
||||
|
|
||||
public static string GetString(this JsonElement json, string key, string defaultValue = "") |
public static string GetString(this JsonElement json, string key, string defaultValue = "") |
||||
|
{ |
||||
|
if (json.TryGetProperty(key, out JsonElement property)) |
||||
{ |
{ |
||||
if (json.TryGetProperty(key, out JsonElement property)) |
return property.GetString(); |
||||
{ |
|
||||
return property.GetString(); |
|
||||
} |
|
||||
return defaultValue; |
|
||||
} |
} |
||||
|
return defaultValue; |
||||
|
} |
||||
|
|
||||
public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0) |
public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0) |
||||
|
{ |
||||
|
if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) |
||||
{ |
{ |
||||
if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) |
return value; |
||||
{ |
|
||||
return value; |
|
||||
} |
|
||||
return defaultValue; |
|
||||
} |
} |
||||
|
return defaultValue; |
||||
|
} |
||||
|
|
||||
public static int GetInt32(this JsonElement json, string key, int defaultValue = 0) |
public static int GetInt32(this JsonElement json, string key, int defaultValue = 0) |
||||
|
{ |
||||
|
if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) |
||||
{ |
{ |
||||
if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) |
return value; |
||||
{ |
|
||||
return value; |
|
||||
} |
|
||||
return defaultValue; |
|
||||
} |
} |
||||
|
return defaultValue; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
namespace Microsoft.AspNetCore.Authentication.WeChat.Official |
namespace Microsoft.AspNetCore.Authentication.WeChat.Official; |
||||
|
|
||||
|
public class WeChatOfficialStateCacheItem |
||||
{ |
{ |
||||
public class WeChatOfficialStateCacheItem |
public string State { get; set; } |
||||
{ |
|
||||
public string State { get; set; } |
|
||||
|
|
||||
public WeChatOfficialStateCacheItem() { } |
public WeChatOfficialStateCacheItem() { } |
||||
public WeChatOfficialStateCacheItem(string state) |
public WeChatOfficialStateCacheItem(string state) |
||||
{ |
{ |
||||
State = state; |
State = state; |
||||
} |
} |
||||
|
|
||||
public static string CalculateCacheKey(string correlationId, string purpose) |
public static string CalculateCacheKey(string correlationId, string purpose) |
||||
{ |
{ |
||||
return $"ci:{correlationId};p:{purpose ?? "null"}"; |
return $"ci:{correlationId};p:{purpose ?? "null"}"; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace LINGYUN.Abp.Aliyun.SettingManagement |
namespace LINGYUN.Abp.Aliyun.SettingManagement; |
||||
|
|
||||
|
public class AliyunSettingPermissionNames |
||||
{ |
{ |
||||
public class AliyunSettingPermissionNames |
public const string GroupName = "Abp.Aliyun"; |
||||
{ |
|
||||
public const string GroupName = "Abp.Aliyun"; |
|
||||
|
|
||||
public const string Settings = GroupName + ".Settings"; |
public const string Settings = GroupName + ".Settings"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,8 +1,7 @@ |
|||||
using LINGYUN.Abp.SettingManagement; |
using LINGYUN.Abp.SettingManagement; |
||||
|
|
||||
namespace LINGYUN.Abp.Aliyun.SettingManagement |
namespace LINGYUN.Abp.Aliyun.SettingManagement; |
||||
|
|
||||
|
public interface IAliyunSettingAppService : IReadonlySettingAppService |
||||
{ |
{ |
||||
public interface IAliyunSettingAppService : IReadonlySettingAppService |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,31 +1,30 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace LINGYUN.Abp.Aliyun |
namespace LINGYUN.Abp.Aliyun; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class AliyunBasicSessionCredentialsCacheItem |
||||
{ |
{ |
||||
[Serializable] |
private readonly static string _cacheKey; |
||||
public class AliyunBasicSessionCredentialsCacheItem |
public static string CacheKey => _cacheKey; |
||||
{ |
public string AccessKeyId { get; set; } |
||||
private readonly static string _cacheKey; |
public string AccessKeySecret { get; set; } |
||||
public static string CacheKey => _cacheKey; |
public string SecurityToken { get; set; } |
||||
public string AccessKeyId { get; set; } |
|
||||
public string AccessKeySecret { get; set; } |
|
||||
public string SecurityToken { get; set; } |
|
||||
|
|
||||
static AliyunBasicSessionCredentialsCacheItem() |
static AliyunBasicSessionCredentialsCacheItem() |
||||
{ |
{ |
||||
_cacheKey = Guid.NewGuid().ToString("N"); |
_cacheKey = Guid.NewGuid().ToString("N"); |
||||
} |
} |
||||
|
|
||||
public AliyunBasicSessionCredentialsCacheItem() |
public AliyunBasicSessionCredentialsCacheItem() |
||||
{ |
{ |
||||
|
|
||||
} |
} |
||||
|
|
||||
public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) |
public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) |
||||
{ |
{ |
||||
AccessKeyId = accessKeyId; |
AccessKeyId = accessKeyId; |
||||
AccessKeySecret = accessKeySecret; |
AccessKeySecret = accessKeySecret; |
||||
SecurityToken = securityToken; |
SecurityToken = securityToken; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
using Aliyun.Acs.Core; |
using Aliyun.Acs.Core; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace LINGYUN.Abp.Aliyun |
namespace LINGYUN.Abp.Aliyun; |
||||
|
|
||||
|
public interface IAcsClientFactory |
||||
{ |
{ |
||||
public interface IAcsClientFactory |
/// <summary>
|
||||
{ |
/// 构造一个通用的Acs客户端调用
|
||||
/// <summary>
|
/// 通过CommonRequest调用可以不需要集成其他SDK包
|
||||
/// 构造一个通用的Acs客户端调用
|
/// </summary>
|
||||
/// 通过CommonRequest调用可以不需要集成其他SDK包
|
/// <returns></returns>
|
||||
/// </summary>
|
Task<IAcsClient> CreateAsync(); |
||||
/// <returns></returns>
|
|
||||
Task<IAcsClient> CreateAsync(); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
|
|
||||
namespace LINGYUN.Abp.Aliyun.Localization |
namespace LINGYUN.Abp.Aliyun.Localization; |
||||
|
|
||||
|
[LocalizationResourceName("Aliyun")] |
||||
|
public class AliyunResource |
||||
{ |
{ |
||||
[LocalizationResourceName("Aliyun")] |
|
||||
public class AliyunResource |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,83 +1,82 @@ |
|||||
namespace LINGYUN.Abp.Aliyun.Settings |
namespace LINGYUN.Abp.Aliyun.Settings; |
||||
|
|
||||
|
public static class AliyunSettingNames |
||||
{ |
{ |
||||
public static class AliyunSettingNames |
public const string Prefix = "Abp.Aliyun"; |
||||
{ |
|
||||
public const string Prefix = "Abp.Aliyun"; |
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 认证方式
|
||||
|
/// </summary>
|
||||
|
public class Authorization |
||||
|
{ |
||||
|
public const string Prefix = AliyunSettingNames.Prefix + ".Authorization"; |
||||
|
/// <summary>
|
||||
|
/// 地域ID
|
||||
|
/// </summary>
|
||||
|
public const string RegionId = Prefix + ".RegionId"; |
||||
|
/// <summary>
|
||||
|
/// RAM账号的AccessKey ID
|
||||
|
/// </summary>
|
||||
|
public const string AccessKeyId = Prefix + ".AccessKeyId"; |
||||
|
/// <summary>
|
||||
|
/// RAM账号的AccessKey Secret
|
||||
|
/// </summary>
|
||||
|
public const string AccessKeySecret = Prefix + ".AccessKeySecret"; |
||||
|
/// <summary>
|
||||
|
/// 使用STS Token访问
|
||||
|
/// </summary>
|
||||
|
public const string UseSecurityTokenService = Prefix + ".UseSecurityTokenService"; |
||||
|
/// <summary>
|
||||
|
/// 使用RAM子账号的AssumeRole方式访问
|
||||
|
/// </summary>
|
||||
|
public const string RamRoleArn = Prefix + ".RamRoleArn"; |
||||
|
/// <summary>
|
||||
|
/// 用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计
|
||||
|
/// </summary>
|
||||
|
public const string RoleSessionName = Prefix + ".RoleSessionName"; |
||||
/// <summary>
|
/// <summary>
|
||||
/// 认证方式
|
/// 过期时间,单位为秒。
|
||||
/// </summary>
|
/// </summary>
|
||||
public class Authorization |
public const string DurationSeconds = Prefix + ".DurationSeconds"; |
||||
{ |
/// <summary>
|
||||
public const string Prefix = AliyunSettingNames.Prefix + ".Authorization"; |
/// 权限策略。
|
||||
/// <summary>
|
/// </summary>
|
||||
/// 地域ID
|
public const string Policy = Prefix + ".Policy"; |
||||
/// </summary>
|
} |
||||
public const string RegionId = Prefix + ".RegionId"; |
|
||||
/// <summary>
|
|
||||
/// RAM账号的AccessKey ID
|
|
||||
/// </summary>
|
|
||||
public const string AccessKeyId = Prefix + ".AccessKeyId"; |
|
||||
/// <summary>
|
|
||||
/// RAM账号的AccessKey Secret
|
|
||||
/// </summary>
|
|
||||
public const string AccessKeySecret = Prefix + ".AccessKeySecret"; |
|
||||
/// <summary>
|
|
||||
/// 使用STS Token访问
|
|
||||
/// </summary>
|
|
||||
public const string UseSecurityTokenService = Prefix + ".UseSecurityTokenService"; |
|
||||
/// <summary>
|
|
||||
/// 使用RAM子账号的AssumeRole方式访问
|
|
||||
/// </summary>
|
|
||||
public const string RamRoleArn = Prefix + ".RamRoleArn"; |
|
||||
/// <summary>
|
|
||||
/// 用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计
|
|
||||
/// </summary>
|
|
||||
public const string RoleSessionName = Prefix + ".RoleSessionName"; |
|
||||
/// <summary>
|
|
||||
/// 过期时间,单位为秒。
|
|
||||
/// </summary>
|
|
||||
public const string DurationSeconds = Prefix + ".DurationSeconds"; |
|
||||
/// <summary>
|
|
||||
/// 权限策略。
|
|
||||
/// </summary>
|
|
||||
public const string Policy = Prefix + ".Policy"; |
|
||||
} |
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 短信服务
|
||||
|
/// </summary>
|
||||
|
public class Sms |
||||
|
{ |
||||
|
public const string Prefix = AliyunSettingNames.Prefix + ".Sms"; |
||||
|
/// <summary>
|
||||
|
/// 阿里云sms服务域名
|
||||
|
/// </summary>
|
||||
|
public const string Domain = Prefix + ".Domain"; |
||||
|
/// <summary>
|
||||
|
/// 调用方法名称
|
||||
|
/// </summary>
|
||||
|
public const string ActionName = Prefix + ".ActionName"; |
||||
|
/// <summary>
|
||||
|
/// 默认版本号
|
||||
|
/// </summary>
|
||||
|
public const string Version = Prefix + ".Version"; |
||||
|
/// <summary>
|
||||
|
/// 默认签名
|
||||
|
/// </summary>
|
||||
|
public const string DefaultSignName = Prefix + ".DefaultSignName"; |
||||
|
/// <summary>
|
||||
|
/// 默认短信模板号
|
||||
|
/// </summary>
|
||||
|
public const string DefaultTemplateCode = Prefix + ".DefaultTemplateCode"; |
||||
|
/// <summary>
|
||||
|
/// 默认号码
|
||||
|
/// </summary>
|
||||
|
public const string DefaultPhoneNumber = Prefix + ".DefaultPhoneNumber"; |
||||
/// <summary>
|
/// <summary>
|
||||
/// 短信服务
|
/// 展示错误给客户端
|
||||
/// </summary>
|
/// </summary>
|
||||
public class Sms |
public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; |
||||
{ |
|
||||
public const string Prefix = AliyunSettingNames.Prefix + ".Sms"; |
|
||||
/// <summary>
|
|
||||
/// 阿里云sms服务域名
|
|
||||
/// </summary>
|
|
||||
public const string Domain = Prefix + ".Domain"; |
|
||||
/// <summary>
|
|
||||
/// 调用方法名称
|
|
||||
/// </summary>
|
|
||||
public const string ActionName = Prefix + ".ActionName"; |
|
||||
/// <summary>
|
|
||||
/// 默认版本号
|
|
||||
/// </summary>
|
|
||||
public const string Version = Prefix + ".Version"; |
|
||||
/// <summary>
|
|
||||
/// 默认签名
|
|
||||
/// </summary>
|
|
||||
public const string DefaultSignName = Prefix + ".DefaultSignName"; |
|
||||
/// <summary>
|
|
||||
/// 默认短信模板号
|
|
||||
/// </summary>
|
|
||||
public const string DefaultTemplateCode = Prefix + ".DefaultTemplateCode"; |
|
||||
/// <summary>
|
|
||||
/// 默认号码
|
|
||||
/// </summary>
|
|
||||
public const string DefaultPhoneNumber = Prefix + ".DefaultPhoneNumber"; |
|
||||
/// <summary>
|
|
||||
/// 展示错误给客户端
|
|
||||
/// </summary>
|
|
||||
public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.BlobStoring; |
using Volo.Abp.BlobStoring; |
||||
|
|
||||
namespace LINGYUN.Abp.BlobStoring.Tencent |
namespace LINGYUN.Abp.BlobStoring.Tencent; |
||||
|
|
||||
|
public interface ITencentBlobNameCalculator |
||||
{ |
{ |
||||
public interface ITencentBlobNameCalculator |
string Calculate(BlobProviderArgs args); |
||||
{ |
|
||||
string Calculate(BlobProviderArgs args); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,25 +1,24 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.BlobStoring; |
using Volo.Abp.BlobStoring; |
||||
|
|
||||
namespace LINGYUN.Abp.BlobStoring.Tencent |
namespace LINGYUN.Abp.BlobStoring.Tencent; |
||||
|
|
||||
|
public static class TencentBlobContainerConfigurationExtensions |
||||
{ |
{ |
||||
public static class TencentBlobContainerConfigurationExtensions |
public static TencentBlobProviderConfiguration GetTencentConfiguration( |
||||
|
this BlobContainerConfiguration containerConfiguration) |
||||
{ |
{ |
||||
public static TencentBlobProviderConfiguration GetTencentConfiguration( |
return new TencentBlobProviderConfiguration(containerConfiguration); |
||||
this BlobContainerConfiguration containerConfiguration) |
} |
||||
{ |
|
||||
return new TencentBlobProviderConfiguration(containerConfiguration); |
|
||||
} |
|
||||
|
|
||||
public static BlobContainerConfiguration UseTencentCloud( |
public static BlobContainerConfiguration UseTencentCloud( |
||||
this BlobContainerConfiguration containerConfiguration, |
this BlobContainerConfiguration containerConfiguration, |
||||
Action<TencentBlobProviderConfiguration> aliyunConfigureAction) |
Action<TencentBlobProviderConfiguration> aliyunConfigureAction) |
||||
{ |
{ |
||||
containerConfiguration.ProviderType = typeof(TencentCloudBlobProvider); |
containerConfiguration.ProviderType = typeof(TencentCloudBlobProvider); |
||||
|
|
||||
aliyunConfigureAction(new TencentBlobProviderConfiguration(containerConfiguration)); |
aliyunConfigureAction(new TencentBlobProviderConfiguration(containerConfiguration)); |
||||
|
|
||||
return containerConfiguration; |
return containerConfiguration; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,26 +1,25 @@ |
|||||
namespace LINGYUN.Abp.BlobStoring.Tencent |
namespace LINGYUN.Abp.BlobStoring.Tencent; |
||||
|
|
||||
|
public static class TencentBlobProviderConfigurationNames |
||||
{ |
{ |
||||
public static class TencentBlobProviderConfigurationNames |
/// <summary>
|
||||
{ |
/// AppId
|
||||
/// <summary>
|
/// </summary>
|
||||
/// AppId
|
public const string AppId = "Tencent:OSS:AppId"; |
||||
/// </summary>
|
/// <summary>
|
||||
public const string AppId = "Tencent:OSS:AppId"; |
/// 区域
|
||||
/// <summary>
|
/// </summary>
|
||||
/// 区域
|
public const string Region = "Tencent:OSS:Region"; |
||||
/// </summary>
|
/// <summary>
|
||||
public const string Region = "Tencent:OSS:Region"; |
/// 命名空间
|
||||
/// <summary>
|
/// </summary>
|
||||
/// 命名空间
|
public const string BucketName = "Tencent:OSS:BucketName"; |
||||
/// </summary>
|
/// <summary>
|
||||
public const string BucketName = "Tencent:OSS:BucketName"; |
/// 命名空间不存在是否创建
|
||||
/// <summary>
|
/// </summary>
|
||||
/// 命名空间不存在是否创建
|
public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; |
||||
/// </summary>
|
/// <summary>
|
||||
public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; |
/// 创建命名空间时防盗链列表
|
||||
/// <summary>
|
/// </summary>
|
||||
/// 创建命名空间时防盗链列表
|
public const string CreateBucketReferer = "Tencent:OSS:CreateBucketReferer"; |
||||
/// </summary>
|
|
||||
public const string CreateBucketReferer = "Tencent:OSS:CreateBucketReferer"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue