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; |
|||
|
|||
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 IIndexSettings IndexSettings { get; set; } |
|||
public const string DefaultIndexPrefix = "auditlogging"; |
|||
public string IndexPrefix { get; set; } |
|||
public IIndexSettings IndexSettings { get; set; } |
|||
|
|||
public AbpAuditLoggingElasticsearchOptions() |
|||
{ |
|||
IndexPrefix = DefaultIndexPrefix; |
|||
IndexSettings = new IndexSettings(); |
|||
} |
|||
public AbpAuditLoggingElasticsearchOptions() |
|||
{ |
|||
IndexPrefix = DefaultIndexPrefix; |
|||
IndexSettings = new IndexSettings(); |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using System.Threading.Tasks; |
|||
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; |
|||
|
|||
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; |
|||
|
|||
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.EntityPropertyChange, LINGYUN.Abp.AuditLogging.EntityPropertyChange>(); |
|||
CreateMap<Volo.Abp.AuditLogging.EntityChange, LINGYUN.Abp.AuditLogging.EntityChange>() |
|||
.MapExtraProperties(); |
|||
CreateMap<Volo.Abp.AuditLogging.AuditLog, LINGYUN.Abp.AuditLogging.AuditLog>() |
|||
.MapExtraProperties(); |
|||
CreateMap<Volo.Abp.AuditLogging.AuditLogAction, LINGYUN.Abp.AuditLogging.AuditLogAction>() |
|||
.MapExtraProperties(); |
|||
CreateMap<Volo.Abp.AuditLogging.EntityPropertyChange, LINGYUN.Abp.AuditLogging.EntityPropertyChange>(); |
|||
CreateMap<Volo.Abp.AuditLogging.EntityChange, LINGYUN.Abp.AuditLogging.EntityChange>() |
|||
.MapExtraProperties(); |
|||
CreateMap<Volo.Abp.AuditLogging.AuditLog, LINGYUN.Abp.AuditLogging.AuditLog>() |
|||
.MapExtraProperties(); |
|||
|
|||
CreateMap<Volo.Abp.Identity.IdentitySecurityLog, LINGYUN.Abp.AuditLogging.SecurityLog>() |
|||
.MapExtraProperties(); |
|||
} |
|||
CreateMap<Volo.Abp.Identity.IdentitySecurityLog, LINGYUN.Abp.AuditLogging.SecurityLog>() |
|||
.MapExtraProperties(); |
|||
} |
|||
} |
|||
|
|||
@ -1,122 +1,120 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Auditing; |
|||
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() |
|||
{ |
|||
Actions = new List<AuditLogAction>(); |
|||
EntityChanges = new List<EntityChange>(); |
|||
ExtraProperties = new ExtraPropertyDictionary(); |
|||
} |
|||
public AuditLog() |
|||
{ |
|||
Actions = new List<AuditLogAction>(); |
|||
EntityChanges = new List<EntityChange>(); |
|||
ExtraProperties = new ExtraPropertyDictionary(); |
|||
} |
|||
|
|||
public AuditLog( |
|||
Guid id, |
|||
string applicationName, |
|||
Guid? tenantId, |
|||
string tenantName, |
|||
Guid? userId, |
|||
string userName, |
|||
DateTime executionTime, |
|||
int executionDuration, |
|||
string clientIpAddress, |
|||
string clientName, |
|||
string clientId, |
|||
string correlationId, |
|||
string browserInfo, |
|||
string httpMethod, |
|||
string url, |
|||
int? httpStatusCode, |
|||
Guid? impersonatorUserId, |
|||
string impersonatorUserName, |
|||
Guid? impersonatorTenantId, |
|||
string impersonatorTenantName, |
|||
ExtraPropertyDictionary extraPropertyDictionary, |
|||
List<EntityChange> entityChanges, |
|||
List<AuditLogAction> actions, |
|||
string exceptions, |
|||
string comments) |
|||
{ |
|||
Id = id; |
|||
ApplicationName = applicationName; |
|||
TenantId = tenantId; |
|||
TenantName = tenantName; |
|||
UserId = userId; |
|||
UserName = userName; |
|||
ExecutionTime = executionTime; |
|||
ExecutionDuration = executionDuration; |
|||
ClientIpAddress = clientIpAddress; |
|||
ClientName = clientName; |
|||
ClientId = clientId; |
|||
CorrelationId = correlationId; |
|||
BrowserInfo = browserInfo; |
|||
HttpMethod = httpMethod; |
|||
Url = url; |
|||
HttpStatusCode = httpStatusCode; |
|||
ImpersonatorUserId = impersonatorUserId; |
|||
ImpersonatorUserName = impersonatorUserName; |
|||
ImpersonatorTenantId = impersonatorTenantId; |
|||
ImpersonatorTenantName = impersonatorTenantName; |
|||
|
|||
ExtraProperties = extraPropertyDictionary; |
|||
EntityChanges = entityChanges; |
|||
Actions = actions; |
|||
Exceptions = exceptions; |
|||
Comments = comments; |
|||
} |
|||
public AuditLog( |
|||
Guid id, |
|||
string? applicationName, |
|||
Guid? tenantId, |
|||
string? tenantName, |
|||
Guid? userId, |
|||
string? userName, |
|||
DateTime executionTime, |
|||
int executionDuration, |
|||
string? clientIpAddress, |
|||
string? clientName, |
|||
string? clientId, |
|||
string? correlationId, |
|||
string? browserInfo, |
|||
string? httpMethod, |
|||
string? url, |
|||
int? httpStatusCode, |
|||
Guid? impersonatorUserId, |
|||
string? impersonatorUserName, |
|||
Guid? impersonatorTenantId, |
|||
string? impersonatorTenantName, |
|||
ExtraPropertyDictionary extraPropertyDictionary, |
|||
List<EntityChange> entityChanges, |
|||
List<AuditLogAction> actions, |
|||
string? exceptions, |
|||
string? comments) |
|||
{ |
|||
Id = id; |
|||
ApplicationName = applicationName; |
|||
TenantId = tenantId; |
|||
TenantName = tenantName; |
|||
UserId = userId; |
|||
UserName = userName; |
|||
ExecutionTime = executionTime; |
|||
ExecutionDuration = executionDuration; |
|||
ClientIpAddress = clientIpAddress; |
|||
ClientName = clientName; |
|||
ClientId = clientId; |
|||
CorrelationId = correlationId; |
|||
BrowserInfo = browserInfo; |
|||
HttpMethod = httpMethod; |
|||
Url = url; |
|||
HttpStatusCode = httpStatusCode; |
|||
ImpersonatorUserId = impersonatorUserId; |
|||
ImpersonatorUserName = impersonatorUserName; |
|||
ImpersonatorTenantId = impersonatorTenantId; |
|||
ImpersonatorTenantName = impersonatorTenantName; |
|||
|
|||
ExtraProperties = extraPropertyDictionary; |
|||
EntityChanges = entityChanges; |
|||
Actions = actions; |
|||
Exceptions = exceptions; |
|||
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>
|
|||
/// 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>
|
|||
public static string OpenId { get; set; } = "qq-openid"; // 可变更
|
|||
/// <summary>
|
|||
/// 用户昵称
|
|||
/// </summary>
|
|||
public static string NickName { get; set; } = "nickname"; |
|||
/// <summary>
|
|||
/// 性别。 如果获取不到则默认返回"男"
|
|||
/// </summary>
|
|||
public static string Gender { get; set; } = "gender"; |
|||
/// <summary>
|
|||
/// 用户头像, 取自字段: figureurl_qq_1
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 根据QQ互联文档, 40x40的头像是一定会存在的, 只取40x40的头像
|
|||
/// see: https://wiki.connect.qq.com/get_user_info
|
|||
/// </remarks>
|
|||
public static string AvatarUrl { get; set; } = "avatar"; |
|||
} |
|||
public static string OpenId { get; set; } = "qq-openid"; // 可变更
|
|||
/// <summary>
|
|||
/// 用户昵称
|
|||
/// </summary>
|
|||
public static string NickName { get; set; } = "nickname"; |
|||
/// <summary>
|
|||
/// 性别。 如果获取不到则默认返回"男"
|
|||
/// </summary>
|
|||
public static string Gender { get; set; } = "gender"; |
|||
/// <summary>
|
|||
/// 用户头像, 取自字段: figureurl_qq_1
|
|||
/// </summary>
|
|||
/// <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; |
|||
|
|||
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.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; |
|||
|
|||
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) |
|||
{ |
|||
var result = new List<string>(); |
|||
public static IEnumerable<string> GetStrings(this JsonElement json, string key) |
|||
{ |
|||
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 defaultValue; |
|||
return property.GetString(); |
|||
} |
|||
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 defaultValue; |
|||
return property.GetString(); |
|||
} |
|||
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 defaultValue; |
|||
return value; |
|||
} |
|||
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 defaultValue; |
|||
return value; |
|||
} |
|||
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(string state) |
|||
{ |
|||
State = state; |
|||
} |
|||
public WeChatOfficialStateCacheItem() { } |
|||
public WeChatOfficialStateCacheItem(string state) |
|||
{ |
|||
State = state; |
|||
} |
|||
|
|||
public static string CalculateCacheKey(string correlationId, string purpose) |
|||
{ |
|||
return $"ci:{correlationId};p:{purpose ?? "null"}"; |
|||
} |
|||
public static string CalculateCacheKey(string correlationId, string purpose) |
|||
{ |
|||
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; |
|||
|
|||
namespace LINGYUN.Abp.Aliyun.SettingManagement |
|||
namespace LINGYUN.Abp.Aliyun.SettingManagement; |
|||
|
|||
public interface IAliyunSettingAppService : IReadonlySettingAppService |
|||
{ |
|||
public interface IAliyunSettingAppService : IReadonlySettingAppService |
|||
{ |
|||
} |
|||
} |
|||
|
|||
@ -1,31 +1,30 @@ |
|||
using System; |
|||
|
|||
namespace LINGYUN.Abp.Aliyun |
|||
namespace LINGYUN.Abp.Aliyun; |
|||
|
|||
[Serializable] |
|||
public class AliyunBasicSessionCredentialsCacheItem |
|||
{ |
|||
[Serializable] |
|||
public class AliyunBasicSessionCredentialsCacheItem |
|||
{ |
|||
private readonly static string _cacheKey; |
|||
public static string CacheKey => _cacheKey; |
|||
public string AccessKeyId { get; set; } |
|||
public string AccessKeySecret { get; set; } |
|||
public string SecurityToken { get; set; } |
|||
private readonly static string _cacheKey; |
|||
public static string CacheKey => _cacheKey; |
|||
public string AccessKeyId { get; set; } |
|||
public string AccessKeySecret { get; set; } |
|||
public string SecurityToken { get; set; } |
|||
|
|||
static AliyunBasicSessionCredentialsCacheItem() |
|||
{ |
|||
_cacheKey = Guid.NewGuid().ToString("N"); |
|||
} |
|||
static AliyunBasicSessionCredentialsCacheItem() |
|||
{ |
|||
_cacheKey = Guid.NewGuid().ToString("N"); |
|||
} |
|||
|
|||
public AliyunBasicSessionCredentialsCacheItem() |
|||
{ |
|||
public AliyunBasicSessionCredentialsCacheItem() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) |
|||
{ |
|||
AccessKeyId = accessKeyId; |
|||
AccessKeySecret = accessKeySecret; |
|||
SecurityToken = securityToken; |
|||
} |
|||
public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) |
|||
{ |
|||
AccessKeyId = accessKeyId; |
|||
AccessKeySecret = accessKeySecret; |
|||
SecurityToken = securityToken; |
|||
} |
|||
} |
|||
|
|||
@ -1,15 +1,14 @@ |
|||
using Aliyun.Acs.Core; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace LINGYUN.Abp.Aliyun |
|||
namespace LINGYUN.Abp.Aliyun; |
|||
|
|||
public interface IAcsClientFactory |
|||
{ |
|||
public interface IAcsClientFactory |
|||
{ |
|||
/// <summary>
|
|||
/// 构造一个通用的Acs客户端调用
|
|||
/// 通过CommonRequest调用可以不需要集成其他SDK包
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<IAcsClient> CreateAsync(); |
|||
} |
|||
/// <summary>
|
|||
/// 构造一个通用的Acs客户端调用
|
|||
/// 通过CommonRequest调用可以不需要集成其他SDK包
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<IAcsClient> CreateAsync(); |
|||
} |
|||
|
|||
@ -1,9 +1,8 @@ |
|||
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>
|
|||
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>
|
|||
public const string DurationSeconds = Prefix + ".DurationSeconds"; |
|||
/// <summary>
|
|||
/// 权限策略。
|
|||
/// </summary>
|
|||
public const string Policy = Prefix + ".Policy"; |
|||
} |
|||
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>
|
|||
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>
|
|||
public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; |
|||
} |
|||
public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; |
|||
} |
|||
} |
|||
|
|||
@ -1,9 +1,8 @@ |
|||
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 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( |
|||
this BlobContainerConfiguration containerConfiguration) |
|||
{ |
|||
return new TencentBlobProviderConfiguration(containerConfiguration); |
|||
} |
|||
return new TencentBlobProviderConfiguration(containerConfiguration); |
|||
} |
|||
|
|||
public static BlobContainerConfiguration UseTencentCloud( |
|||
this BlobContainerConfiguration containerConfiguration, |
|||
Action<TencentBlobProviderConfiguration> aliyunConfigureAction) |
|||
{ |
|||
containerConfiguration.ProviderType = typeof(TencentCloudBlobProvider); |
|||
public static BlobContainerConfiguration UseTencentCloud( |
|||
this BlobContainerConfiguration containerConfiguration, |
|||
Action<TencentBlobProviderConfiguration> aliyunConfigureAction) |
|||
{ |
|||
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>
|
|||
public const string AppId = "Tencent:OSS:AppId"; |
|||
/// <summary>
|
|||
/// 区域
|
|||
/// </summary>
|
|||
public const string Region = "Tencent:OSS:Region"; |
|||
/// <summary>
|
|||
/// 命名空间
|
|||
/// </summary>
|
|||
public const string BucketName = "Tencent:OSS:BucketName"; |
|||
/// <summary>
|
|||
/// 命名空间不存在是否创建
|
|||
/// </summary>
|
|||
public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; |
|||
/// <summary>
|
|||
/// 创建命名空间时防盗链列表
|
|||
/// </summary>
|
|||
public const string CreateBucketReferer = "Tencent:OSS:CreateBucketReferer"; |
|||
} |
|||
/// <summary>
|
|||
/// AppId
|
|||
/// </summary>
|
|||
public const string AppId = "Tencent:OSS:AppId"; |
|||
/// <summary>
|
|||
/// 区域
|
|||
/// </summary>
|
|||
public const string Region = "Tencent:OSS:Region"; |
|||
/// <summary>
|
|||
/// 命名空间
|
|||
/// </summary>
|
|||
public const string BucketName = "Tencent:OSS:BucketName"; |
|||
/// <summary>
|
|||
/// 命名空间不存在是否创建
|
|||
/// </summary>
|
|||
public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; |
|||
/// <summary>
|
|||
/// 创建命名空间时防盗链列表
|
|||
/// </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