Skip to content

Commit

Permalink
Merge pull request #1013 from colinin/rel-8.3.0
Browse files Browse the repository at this point in the history
Rel 8.3.0
  • Loading branch information
colinin authored Oct 9, 2024
2 parents 28ad4d6 + fa37385 commit 8b46201
Show file tree
Hide file tree
Showing 165 changed files with 9,213 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Publish"

on:
push:
branches: [ rel-8.2.2 ]
branches: [ rel-8.3.0 ]
env:
DOTNET_VERSION: "8.0.200"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Tagged Release"

on:
push:
branches: [ rel-8.2.2 ]
branches: [ rel-8.3.0 ]

jobs:
tagged-release:
Expand All @@ -14,4 +14,4 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "8.2.2"
automatic_release_tag: "8.3.0"
8 changes: 5 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<DotNetCoreCAPPackageVersion>8.2.0</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.14.1</ElsaPackageVersion>
<VoloAbpPackageVersion>8.2.2</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>8.2.2</LINGYUNAbpPackageVersion>
<VoloAbpPackageVersion>8.3.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>8.3.0</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion>
Expand Down Expand Up @@ -225,7 +225,9 @@
<PackageVersion Include="IdentityModel" Version="6.2.0" />
<PackageVersion Include="IP2Region.Net" Version="2.0.2" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="Magicodes.IE.Excel" Version="2.7.5.2" />
<PackageVersion Include="Markdig" Version="0.34.0" />
<PackageVersion Include="MiniExcel" Version="1.34.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NEST" Version="7.15.1" />
<PackageVersion Include="NRules" Version="0.9.2" />
Expand All @@ -246,7 +248,7 @@
<PackageVersion Include="RulesEngine" Version="4.0.0" />
<PackageVersion Include="Scriban" Version="5.9.0" />
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" />
<PackageVersion Include="StackExchange.Redis" Version="2.7.4" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
Expand Down
3 changes: 3 additions & 0 deletions apps/vue/docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ server {
proxy_pass http://www.nmc.cn/;
proxy_set_header Host www.nmc.cn;
proxy_set_header Referer http://www.nmc.cn;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /signalr-hubs/ {
Expand Down
6 changes: 5 additions & 1 deletion apps/vue/src/utils/http/axios/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// 基础接口地址
// baseURL: globSetting.apiUrl,

headers: { 'Content-Type': ContentTypeEnum.JSON },
headers: {
'Content-Type': ContentTypeEnum.JSON,
// 取消后端cookie重定向
'X-Request-From': 'vben',
},
// 如果是form-data格式
// headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
// 数据处理方式
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import { BasicTable, TableAction, useTable } from '/@/components/Table';
import { uploadUrl } from '/@/api/oss-management/objects';
import { useUserStoreWithOut } from '/@/store/modules/user';
import { Result } from '/#/axios';
import Uploader from 'simple-uploader.js';
const emits = defineEmits(['file:uploaded', 'register']);
Expand Down Expand Up @@ -172,7 +173,20 @@
fileList.value.push(...files);
}
function _fileProgress(_, file) {
function _fileProgress(_, file, chunk) {
// 2024-09-29 处理上传失败的包装错误
if (chunk.processedState?.res) {
try {
const result = JSON.parse(chunk.processedState.res) as Result<any>;
if (result.code !== '0') {
file.error = true;
file.errorMsg = result.message;
file.pause();
}
} catch (error) {
console.log('upload error ---> ', error);
}
}
if (file._prevUploadedSize) {
file.progress = `${Math.floor((file._prevUploadedSize / file.size) * 100)} %`;
}
Expand Down
158 changes: 156 additions & 2 deletions aspnet-core/LINGYUN.MicroService.SingleProject.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>8.2.1</Version>
<Version>8.3.0</Version>
<Copyright>colin</Copyright>
<Description>Use LINGYUN.MicroService.Templates command line</Description>
<PackAsTool>true</PackAsTool>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@
<RootNamespace />
</PropertyGroup>

<ItemGroup>
<None Remove="LINGYUN\Abp\DataProtection\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\DataProtection\Localization\Resources\zh-Hans.json" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\DataProtection\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\DataProtection\Localization\Resources\zh-Hans.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.ObjectExtending" />
<PackageReference Include="Volo.Abp.Localization" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
using Volo.Abp.Modularity;
using LINGYUN.Abp.DataProtection.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.VirtualFileSystem;

namespace LINGYUN.Abp.DataProtection;

[DependsOn(typeof(AbpLocalizationModule))]
[DependsOn(typeof(AbpObjectExtendingModule))]
public class AbpDataProtectionAbstractionsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpDataProtectionAbstractionsModule>();
});

Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<DataProtectionResource>()
.AddVirtualJson("/LINGYUN/Abp/DataProtection/Localization/Resources");
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,54 @@ namespace LINGYUN.Abp.DataProtection;
/// </summary>
public enum DataAccessFilterOperate
{
/// <summary>
/// 且
/// </summary>
[Description("且")]
And = 1,
/// <summary>
/// 或
/// </summary>
[Description("或")]
Or = 2,
/// <summary>
/// 等于
/// </summary>
[Description("等于")]
Equal = 3,
Equal = 1,
/// <summary>
/// 不等于
/// </summary>
[Description("不等于")]
NotEqual = 4,
NotEqual = 2,
/// <summary>
/// 小于
/// </summary>
[Description("小于")]
Less = 5,
Less = 3,
/// <summary>
/// 小于或等于
/// </summary>
[Description("小于等于")]
LessOrEqual = 6,
LessOrEqual = 4,
/// <summary>
/// 大于
/// </summary>
[Description("大于")]
Greater = 7,
Greater = 5,
/// <summary>
/// 大于或等于
/// </summary>
[Description("大于等于")]
GreaterOrEqual = 8,
GreaterOrEqual = 6,
/// <summary>
/// 左包含
/// </summary>
[Description("左包含")]
StartsWith = 9,
StartsWith = 7,
/// <summary>
/// 右包含
/// </summary>
[Description("右包含")]
EndsWith = 10,
EndsWith = 8,
/// <summary>
/// 包含
/// </summary>
[Description("包含")]
Contains = 11,
Contains = 9,
/// <summary>
/// 不包含
/// </summary>
[Description("不包含")]
NotContains = 12,
NotContains = 10,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"DataProtection:010001": "Data access permission not granted to protected resources!"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"DataProtection:010001": "未授予受保护资源的数据访问权限!"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Authorization;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities;
Expand Down Expand Up @@ -40,7 +39,7 @@ public async override ValueTask<InterceptionResult<int>> SavingChangesAsync(
var entityKeys = updateEntites
.Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString())
.JoinAsString(";");
throw new AbpAuthorizationException(
throw new AbpDataAccessDeniedException(
$"Delete data permission not granted to entity {updateEntites.First().GetType()} for data {entityKeys}!");
}
}
Expand All @@ -56,7 +55,7 @@ public async override ValueTask<InterceptionResult<int>> SavingChangesAsync(
var entityKeys = deleteEntites
.Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString())
.JoinAsString(";");
throw new AbpAuthorizationException(
throw new AbpDataAccessDeniedException(
$"Delete data permission not granted to entity {deleteEntites.First().GetType()} for data {entityKeys}!");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public abstract class AbpDataProtectionDbContext<TDbContext> : AbpDbContext<TDbC
public IOptions<AbpDataProtectionOptions> DataProtectionOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDataProtectionOptions>>();
public ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>();

public AbpDataProtectionDbContext(
DbContextOptions<TDbContext> options) : base(options)
protected AbpDataProtectionDbContext(DbContextOptions<TDbContext> options) : base(options)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Volo.Abp;

namespace LINGYUN.Abp.DataProtection;
public class AbpDataAccessDeniedException : BusinessException
{
public AbpDataAccessDeniedException()
{
}

public AbpDataAccessDeniedException(string message)
: base("DataProtection:010001", message)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using LINGYUN.Abp.DataProtection.Subjects;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;

namespace LINGYUN.Abp.DataProtection;
Expand Down Expand Up @@ -37,13 +37,14 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.OperateContributors.Add(DataAccessFilterOperate.NotContains, new DataAccessNotContainsContributor());

options.SubjectContributors.Add(new DataAccessUserIdContributor());
options.SubjectContributors.Add(new DataAccessClientIdContributor());
options.SubjectContributors.Add(new DataAccessRoleNameContributor());
options.SubjectContributors.Add(new DataAccessOrganizationUnitContributor());
});

Configure<AbpLocalizationOptions>(options =>
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.Resources.Add<DataProtectionResource>();
options.MapCodeNamespace("DataProtection", typeof(DataProtectionResource));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ namespace LINGYUN.Abp.DataProtection;
public class DataAccessKeywordContributorContext
{
public IServiceProvider ServiceProvider { get; }
public DataAccessKeywordContributorContext(IServiceProvider serviceProvider)
public Type ConversionType { get; }
public DataAccessKeywordContributorContext(
IServiceProvider serviceProvider,
Type conversionType)
{
ServiceProvider = serviceProvider;
ConversionType = conversionType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ private Expression ChangeTypeToExpression(DataAccessFilterRule rule, Type conver
{
if (_options.KeywordContributors.TryGetValue(rule.Value?.ToString() ?? "", out var contributor))
{
var context = new DataAccessKeywordContributorContext(_serviceProvider);
var keyValue = contributor.Contribute(context);
var value = CastTo(keyValue, conversionType);
return Expression.Constant(value, conversionType);
var context = new DataAccessKeywordContributorContext(_serviceProvider, conversionType);
return contributor.Contribute(context);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace LINGYUN.Abp.DataProtection;
using System.Linq.Expressions;

namespace LINGYUN.Abp.DataProtection;
public interface IDataAccessKeywordContributor
{
string Keyword { get; }
object Contribute(DataAccessKeywordContributorContext context);
Expression Contribute(DataAccessKeywordContributorContext context);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Authorization;
using Volo.Abp.Domain.Entities;

namespace LINGYUN.Abp.DataProtection;
Expand All @@ -13,7 +12,7 @@ public static async Task CheckAsync<TEntity>(this IDataAuthorizationService data
if (!result.Succeeded)
{
var entityKeys = entities.Select(x => x.ToString()).JoinAsString(";");
throw new AbpAuthorizationException(
throw new AbpDataAccessDeniedException(
$"The {operation} operation with entity type {typeof(Entity)} identified as {entityKeys} is not allowed!");
}
}
Expand Down
Loading

0 comments on commit 8b46201

Please sign in to comment.