gpt4 book ai didi

azure - 防伪 token 和资源不可用

转载 作者:行者123 更新时间:2023-12-03 02:48:15 26 4
gpt4 key购买 nike

我有一个发布到 Azure 的 MVC Web 应用程序。由于在编辑 View 中包含@html.antiforgerytoken(),每当我单击编辑操作链接时,我都会收到错误。所以我删除了 View 中的代码并再次发布。现在我看到类似“资源不可用”的错误。我的问题是该错误可能是由于其他一些问题造成的,或者是否存在与 View 中删除此防伪 token 的任何链接?请帮助我摆脱这个困境。我需要对我的代码进行任何其他更改吗?

最佳答案

My question is the error might be because of some other problem or is there any link with removal of this antiforgery token in the view?

正如Lasse所说,当你使用@Html.AntiForgeryToken()时,你还需要有[HttpPost] ActionResult 上的 [ValidateAntiForgeryToken] 属性。

所以,如果你想remove the antiforgery token ,您还需要删除 [ValidateAntiForgeryToken] 属性。

实际上,@Html.AntiForgeryToken() 是一项安全功能,可帮助protect your application against cross-site request forgery .

关于azure - 防伪 token 和资源不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57536798/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com