栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

ABP项目备忘(报错及配置)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ABP项目备忘(报错及配置)

1.注入报错

Castle.MicroKernel.Handlers.HandlerException: Can't create component 'PaymentCore.Users.PayApiAppService' as it has dependencies to be satisfied.

'PaymentCore.Users.PayApiAppService' is waiting for the following dependencies:
- Service 'PaymentCore.Payment.WXPayApi.NativePay' which was not registered.
- Service 'PaymentCore.Payment.AliPayApi.QRCode' which was not registered.
- Service 'PaymentCore.Payment.AliPayApi.PayDataHandle' which was not registered.
- Service 'Alipay.AopSdk.AspnetCore.AlipayService' which was not registered.

解决办法:

注入的方法实现接口 ITransientDependency

2.多表查询

var query = _goodsRepository.GetAll()
                                          .Join(
                                                  _devicegoodsRepository.GetAll().Where(p => p.DeviceNo == input.deviceNo),
                                          top => top.Code,
                                          art => art.GoodsNo,
                                          (top, art) => new GoodsDto
                                          {
                                             GoodsNo= top.Code,
                                             GoodsName=top.Name,
                                             Description=top.Description,
                                             Unit=top.Unit,
                                             Price=art.Price,
                                             ProductId=top.ProductId,
                                             LastModificationTime = art.LastModificationTime,
                                             GoodsQty=1//设置默认数量
                                          });
            var list = await query
                   .PageBy(input)
                   .ToListAsync();

3.code first 命令

add-migration ;

update-database;

4.前端要能访问接口

①实现接口里面定义

②方法后面要加Async

③方法名不能有Post

5.外部引用的接口eg:AlipayService   注入方法

 [Abp.Modules.DependsOn(typeof(AlipayService))]

6.abp权限菜单管理备忘

(1) 菜单需要在前端routes.ts中配置,配置完后,①到系统菜单界面配置菜单②角色界面勾选添加权限菜单(对应BasRoleMenu表)

(2)admin没有tenantId的是宿主,也就是总管理员可以添加租户的,在添加租户的时候会默认添加一个admin租户角色,同时会添加除了tanant页面之外的所有菜单权限

(3)租户下面的admin不能看到租户界面

暑期编程PK赛 得CSDN机械键盘等精美礼品!
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1017400.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号