找回密码
 立即注册

QQ登录

只需一步,快速开始

王鸿辉 活字格认证

高级会员

31

主题

65

帖子

1008

积分

高级会员

积分
1008

活字格认证

QQ
王鸿辉 活字格认证
高级会员   /  发表于:2024-3-13 11:47  /   查看:423  /  回复:2
10金币
GetMetadata2接口会返回以下报错;这种情况应该如何处理呢?

{  "ClassName": "System.Exception",  "Message": "Invalid request with no permission.",  "Data": null,  "InnerException": null,  "HelpURL": null,  "StackTraceString": "   at Forguncy.Server2.Controllers.HomeController.GetMetadata2Async(String pageName, Boolean isMobile)   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)   at ServerDesignerCommon.CodeEditor.CodeEditorMiddleware.InvokeAsync(HttpContext context)   at Forguncy.Server2.KatanaMiddleware.ProcessEngineMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService)   at Forguncy.Server2.KatanaMiddleware.ReportsMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService, IReportServerService reportServerService)   at Forguncy.KatanaMiddleware.ServerCommandMiddleware.InvokeAsync(HttpContext context)   at Forguncy.KatanaMiddleware.CustomApiMiddleware.InvokeAsync(HttpContext context)   at Forguncy.KatanaMiddleware.ConcurrentControllMiddleware.InvokeAsync(HttpContext context)   at Forguncy.Server2.KatanaMiddleware.StartPageMiddleware.InvokeAsync(HttpContext context)   at ForguncyServerCommon.HttpHeaderMiddlewareBase.InvokeAsync(HttpContext context)   at Forguncy.KatanaMiddleware.ExceptionTraceMiddleware.InvokeAsync(HttpContext context)",  "RemoteStackTraceString": null,  "RemoteStackIndex": 0,  "ExceptionMethod": null,  "HResult": -2146233088,  "Source": "Forguncy.Server2",  "WatsonBuckets": null}


最佳答案

查看完整内容

https://gcdn.grapecity.com.cn/showtopic-98950-1-1.html Chrome浏览器版本80以后对于两个网站用IFrame集成有严格的安全策略,必须满足以下两个条件。 1. 必须两个网站都是 https,并且有有效证书 2. 必须启用HTTP SameSite。这个可以在 C:%users\Public\Documents\ForguncyServer\GlobalConfig.xml 中修改

2 个回复

倒序浏览
最佳答案
最佳答案
robert
金牌服务用户   /  发表于:2024-3-13 11:47:08
来自 2#
本帖最后由 robert 于 2024-3-13 12:30 编辑

https://gcdn.grapecity.com.cn/showtopic-98950-1-1.html

Chrome浏览器版本80以后对于两个网站用IFrame集成有严格的安全策略,必须满足以下两个条件。
1. 必须两个网站都是 https,并且有有效证书
2. 必须启用HTTP SameSite。这个可以在 C:\Users\Public\Documents\ForguncyServer\GlobalConfig.xml 中修改
回复 使用道具 举报
Erik.Xue讲师达人认证 悬赏达人认证 活字格认证 Wyn认证
超级版主   /  发表于:2024-3-13 17:07:16
3#
您好,可以看到日志中有报错:"Message": "Invalid request with no permission."
原因是请求没权限导致,结合描述使用了iframe,所以,原因基本可以确定是iframe安全策略导致,比如iframe中的网页和外部页面有跨域问题。

可以参考楼上大佬的回复来解决哈。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部