coldairarrow / colder.admin.antdvue Goto Github PK
View Code? Open in Web Editor NEWAdmin Fx Based On .NET 5 + Ant Design Vue
License: MIT License
Admin Fx Based On .NET 5 + Ant Design Vue
License: MIT License
不知作者在分页查询上面有没有优化计划!
数据库里的布尔值类型为tinyint(4)的时候,API出现
"Msg": "Operator '=' incompatible with operand types 'SByte' and 'Boolean'",
是不是生成的时候Map有错误?
代码中,全局业务仓储类,里面查询表中数据,都默认是Deleted=false的数据,请问怎么能够过滤掉这个条件。
public IQueryable GetIQueryable(Type type)
{
var q = _db.GetIQueryable(type);
if (NeedLogicDelete(type))
{
q = q.Where($"{Deleted} = @0", false);
}
return q;
}
2.GlobalSwitch.cs 文件中public static readonly DatabaseType DatabaseType = DatabaseType.MySql;
这个数据库类型,是否考虑放在appsettings.json文件中呢?更新代碼時,這些都被替換了。
AOP添加抽象层,减少代码侵入性
在开发过程中经常会用到定时任务,老哥什么时候加入一下定时任务呢?
无论数据库的名字是大写还是小写,生成的都是小写。
报错:在JsonParamter拦截器阶段报错
在Extention.Object.cs下的ChangeType_ByConvert()方法第245行
▶ | $exception | {"Invalid cast from 'System.String' to 'System.Collections.Generic.List`1[[Coldairarrow.Util.PicDTO, Coldairarrow.Util, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'."} | System.InvalidCastException
上传非文本文件时会报错,上传文本不报错,但会把整个文件的内容写到日志里。
如题,不会返回自定义的msg( context.Result = Error("权限不足!");
),日志:
1层错误:
消息:
If an IAsyncActionFilter provides a result value by setting the Result property of ActionExecutingContext to a non-null value, then it cannot call the next filter by invoking ActionExecutionDelegate.
位置:
at Coldairarrow.Api.BaseActionFilterAsync.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) in D:\Learn\DotnetCore\Colder.Admin\src\Coldairarrow.Api\00Filter\BaseActionFilterAsync.cs:line 21
使用原生自带DI,去掉Autofac,使框架更加纯粹
mysql联表查询,若开启逻辑删除模式,生成的SQL异常(导致查询缓慢)
AllFxTypes需要包含IRepository
本地测试没有问题,发布到IIS在新增管理员和权限的时候会出现,其他页面未见异常
建议支持开源ORM框架以支持更多版本数据库,如国内开源SqlSugar,FreeSql
HeroKu 是一个云端託管平台,有提供免费的方案的 PostgreSQL 使用
我想要使用这个平台来做为线上测试的平台并且暂时使用他的 PostgreSQL
以下是我的问题描述与我所做的更动,想请教是否有没注意的程式逻辑,亦感谢大佬开源出如此好用的框架造福大家
我连接本地计算机上 PostgreSQL 运作正常,但当我使用了 HeroKu PostgreSQL 时出现了错误
我依照了网路上的 教学 修改了
Colder.Admin.AntdVue\src\Coldairarrow.DataRepository\DbFactory.cs 行 61
case DatabaseType.PostgreSql: builder.UseNpgsql(dbConnection, optionBuilder =>
{
optionBuilder.RemoteCertificateValidationCallback((sender, certificate,
chain, errors) => true);
}); break;
Colder.Admin.AntdVue\src\Coldairarrow.Api\appsettings.json
"BaseDb": " {---连接字串---};sslmode=Require;"
但依然於 Coldairarrow.DataRepository -> BaseDbContext ->SaveChanges() 行29 出現以下問題
System.Security.Authentication.AuthenticationException: 'The remote certificate is invalid according to the validation procedure.
如有不够充足的问题描述请不吝告知,定补上也希望大佬帮帮萌新解惑
使用EFCore.Sharding替换DataRepository(待发布)
使用原生IDistributedCache
目前大部分netcorer的项目应该都是(也有可能是我见识短浅)Code First的吧,自动升成代码的确不错,但是要是可以基于codefirst进行生成就好了,比如根据codefirst ef自动生成数据库,然后通过框架生成代码并且不覆盖手写的ef实体
使用DI消除非必要静态类,优化架构
Logger使用自带的ILogger,使用日志格式化
在添加了一个库后使用新增的ItestRepository,
public interface ItestRepository : IRepository { }
startup新增注册代码:
config.UseDatabase<ItestRepository>(Configuration.GetConnectionString("XBRLDb"), Configuration["DatabaseType"].ToEnum<DatabaseType>());
运行程序,操作一个数据修改保存后,就会在EFCore.Sharding.DistributedTransaction这里
public async Task BeginTransactionAsync(IsolationLevel isolationLevel) { OpenTransaction = true; _isolationLevel = isolationLevel; foreach (var aRepository in _repositories) { await (aRepository as IInternalTransaction).BeginTransactionAsync(isolationLevel); } }
循环两个Repository执行,第二次则会报错。
System.NullReferenceException:“Object reference not set to an instance of an object.” (... as EFCore.Sharding.IInternalTransaction) 返回 null。
利用AspectCore进行AOP管理事务
非常好的开发模板!
这里是不是忘记添加代码实现了:
public async Task UpdateAnyAsync(List entities, List properties) where T : class, new()
{
return await UpdateAnyAsync(entities, properties);
}
另外,可否尝试添加AsNoTracking。
软删除模式添加用户异常:
LogicDeleteRepository未实现IInternalTransaction导致空引用
q是IQueryable<Article_Info>类型
报错信息
The source IQueryable doesn't implement IAsyncEnumerable<Coldairarrow.Entity.ArticleManage.Article_Info>. Only sources that implement IAsyncEnumerable can be used for Entity Framework asynchronous operations.
yarn upgrade后,报错,
ERROR Failed to compile with 1 errors 上午11:47:09
error in ./src/utils/routerUtil.js
Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
测试float类型可以,但不支持decimal类型
Can you fix page encoding for some pages under 04Business/Business_Manage.
后端web把页码调到后面 再去查询 传递的PageIndex不为1 搜不到数据
使用这个框架,不改变原有数据库的自增id时,是不是修改business里面00util的的扩展方法?还是有别的地方也要做变更
Content-type的不同对后台接口有较大影响。我的接口参数定义的是实体类的话就必须满足下面两种情况的任意一种:
1、contentType为application/json,则必须要传递序列化过的对象;
2、application/x-www-form-urlencoded,则前端直接传递json类型的对象即可。
解决思路:1、可否在不全局修改content-type情况下 指定某个 this.$http.post()是何种content-type,我在网上看到 .ajax{}和.axios是可以指定content-type的,但是这个this.$http.post()网上说在后面加 emulateJSON: true,经过测试没有任何作用,还是自动变换content-type,并且emulateJSON: true是vue-resource里的属性,我全局搜索项目没发现vue-resource的代码
2、可否满足像我上面说的两种情况一样,根据传的参数的对象不同,自动变化Content-Type(本框架确实实现了,但是和我想要的结果正好相反,我不清楚它是如何自动根据参数来变换Content-Type的)
附上我参考的博客:https://www.cnblogs.com/landeanfen/p/5337072.html#_label4
你好!
想添加更多的用户属性,是加一个和base user一对一新表呢? 还是直接base user上添加属性?
你能不能做更多的例子?
不知作者有没有打算要集成IdentityServer4进来呢
你好,如果能判断传的参数,没有传的,就不要更新。
在调试的时候是否可以在输出界面增加SQL输出,方便调试!
当表存在多个主键的时候 实体多个字段加上特性key,映射失败
An error occurred while updating the entries. See the inner exception for details.
Service.InsertAsync(entity);这一步执行就出现上面的错误
每个接口统一约定InputDTO与OutputDTO,分页请求与返回使用泛型约束
目前测试发现前端自定义排序字段的时候,会覆盖,并且为空,默认变成ID.
定义有问题,这样就不如不定义sorter,反正会覆盖
sorter: { field: 'CreateTime', order: 'desc' },
handleTableChange(pagination, filters, sorter) {
this.pagination = { ...pagination }
this.filters = { ...filters }
//this.sorter = { ...sorter } ????=Object.assign(this.sorter, { ...sorter })
this.getDataList()
}
在另个开源项目里面发现的设计方式:
1、TopBasePoco是框架所有模型的基类,它只定义了一个Guid的主键,所有其他模型都必须直接或间接继承TopBasePoco,否则框架的其他自动化操作无法执行。
2、BasePoco是框架所有内置模型的基类,它在TopBasePoco的基础上增加了创建人,修改人,创建时间和修改时间四个字段,对于大多数模型,这些字段都是需要的,建议用户自定义的模型都继承BasePoco。
3、PersistPoco在BasePoco的基础上增加了IsValid字段,指示框架对这类模型进行假删除。
这个项目里面给了3种表模型,希望本项目也能更灵活点。
发现如果数据库字段和实体类字段顺序不一致程序将会出现问题
//MySQl "BaseDb": "server=localhost;user id=root;password=xxxx;persistsecurityinfo=True;database=colderadmin;SslMode=none"
使用MySQL后,先是不认识SslMode参数,去掉SslMode后,登陆执行,数据库访问失败
{ "Success": false, "ErrorCode": 0, "Msg": "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)" }
数据库中已经导入了MySQL.sql文件
`
mysql> use colderadmin;
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_colderadmin |
+-----------------------+
| base_action |
| base_appsecret |
| base_buildtest |
| base_dblink |
| base_department |
| base_log |
| base_role |
| base_roleaction |
| base_user |
| base_userlog |
| base_userrole |
+-----------------------+
11 rows in set (0.00 sec)
mysql>
`
通用下拉获取不到Ids
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.