本地调试没有问题,发布后通过Token调用其他API时,出现返回JSON中提示:Authorization failed! Given policy has not granted.
需要修改appsettings.json,以下修改成发布后的域名或地址访问就可以了
{ "App": { "SelfUrl": "https://localhost:44323", "CorsOrigins": "https://*.shop.com,http://localhost:4200,https://localhost:44307" }, "ConnectionStrings": { "Default": "Data Source=127.0.0.1;Initial Catalog=xxxxx;Persist Security Info=True;User ID=sa;Password=xxxxxx" }, "AuthServer": { "Authority": "https://localhost:44323", "RequireHttpsMetadata": "false" }, "StringEncryption": { "DefaultPassPhrase": "Jr8ABGm6bG7LIxZN" }, "Settings": { "Abp.Mailing.Smtp.Host": "127.0.0.1", "Abp.Mailing.Smtp.Port": "25", "Abp.Mailing.Smtp.UserName": "", "Abp.Mailing.Smtp.Password": "", "Abp.Mailing.Smtp.Domain": "", "Abp.Mailing.Smtp.EnableSsl": "false", "Abp.Mailing.Smtp.UseDefaultCredentials": "true", "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", "Abp.Mailing.DefaultFromDisplayName": "ABP application" } }