ReadMe
This Project is Show the problem about abp vnext
It just add custom app service
public interface IDemoTestAppService : IApplicationService
{
/// <summary>
/// method use [Authorize]
/// </summary>
/// <returns></returns>
Task<string> GetInfoWithAuthorizeAsync();
/// <summary>
///
/// </summary>
/// <returns></returns>
Task<string> GetInfoAsync();
}
public class DemoTestAppService :demoAppService, IDemoTestAppService
{
[Authorize(demoPermissions.DemoValidPermission)]
public Task<string> GetInfoWithAuthorizeAsync()
{
return Task.FromResult("Hello World");
}
public async Task<string> GetInfoAsync()
{
await this.CheckPolicyAsync(demoPermissions.DemoValidPermission);
return "Hello World";
}
}
Steps
-
Run
demo.DbMigrator
-
Run
deom.web
-
https://localhost:44315/api/app/demoTest/infoWithAuthorize
will redirect to login page, if after login ,will redirect to error page -
https://localhost:44315/api/app/demoTest/info
get right json data.