1、首先找到xx.Core添加文件夹Extensions
在文件夹中添加IAbpSessionExtension类并继承IAbpSession
2、添加AbpSessionExtension类并继承ClaimsAbpSession,IAbpSessionExtension
3、找到xx.Web.Core--Controllers文件夹MyProjectControllerBase 类添加一下代码
//隐藏父类的AbpSession
public new IAbpSessionExtension AbpSession { get; set; }
4、找到xx.Application-MyProjectAppServiceBase.cs类添加一下代码
//隐藏父类的AbpSession
public new IAbpSessionExtension AbpSession { get; set; }
5、找到xx.Web.Core--Controllers文件夹TokenAuthController.cs 类登录方法Authenticate添加一下代码
AbpSession.UsercId = loginResult.User.cId;
6、调用新添加的UsercId