页面发送请求到后台报错“Empty or invalid anti forgery header token.”问题解决

在页面向后台发送请求时,报如上图的错误的解决办法:
在WebModule.cs类中的PreInitialize方法中加
Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;
另外还有添加引用:
using Abp.Configuration.Startup;
出现这个问题的原因是没有使用abp.ajax的请求方式,而是使用其他的方式
另外还有其他的解决办法:
1.在Controller的Action里标注:[DisableAbpAntiForgeryTokenValidation]
2.在ajax的header里添加键值‘x-xsrf-token’:abp.security.antiForgery.getToken()
页面发送请求到后台报错“Empty or invalid anti forgery header token.”问题解决的更多相关文章
- ABP Zero示例项目登录报错“Empty or invalid anti forgery header token.”问题解决
ABP Zero项目,登录时出现如图"Empty or invalid anti forgery header token."错误提示的解决方法: 在 WebModule.cs的P ...
- curl 发送请求的时候报错
AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ...
- Apache报错信息之Invalid command 'Order', perhaps misspelled or defined by a module not included in the server config
今天配置开启Apache虚拟主机时, 然后日志报错提示: Invalid command 'Order', perhaps misspelled or defined by a module not ...
- 发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store
发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store 昨晚上传项目到AppStore,报了这个错,纳尼! ...
- django报错解决:Invalid HTTP_HOST header: 'xxx.com'. You may need to add u'xxx.com' to ALLOWED_HOSTS.
django版本:1.11.15 使用uwsgi+nginx运行django程序,出现报错,报错为:Invalid HTTP_HOST header: 'xxx.com:82'. You may ne ...
- Mac 升级后idea执行git命令报错xcrun: error: invalid active developer path的解决办法
报错 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun ...
- linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql.
linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql. 2013-03-04 1 ...
- oracle+mybatis报错:BindingException("Invalid bound statement (not found): ")
oracle+mybatis报错:BindingException("Invalid bound statement (not found): ") 从mysql转到oracle数 ...
- egg启动时,报错:Ignoring invalid timezone passed to Connection的解决方案
报错信息 Ignoring invalid timezone passed to Connection: +8:00. This is currently a warning, but in futu ...
随机推荐
- zoom与scale的异同
zoom与scale的异同点 作为一名前端,尤其是页面要兼容ie浏览器的前端,肯定对着两个属性都很熟悉. zoom和scale都是css中常用的放大和缩小一个元素的方法,在scale还没有成为css3 ...
- zend studio里面这块注释是用什么快捷键按出来的?
写完类或函数(注意必须写完,不然出现的信息会不完整)后,在其上方空行输入/**,然后回车 /** * * @param string $a * @param string $b * @param st ...
- iOS 实现简单的毛玻璃效果
最近在整理导航栏的渐隐渐现效果,整理过程中偶然学会了图片的毛玻璃效果实现,很简单,不多说了,先上图看看效果对比, 这是原图, 这是加了效果后的,创建图片的代码就不上了,下面看下添加效果的代码: // ...
- [LeetCode] Friend Circles 朋友圈
There are N students in a class. Some of them are friends, while some are not. Their friendship is t ...
- C#调用TSC条码打印机打印条码
#region 调用TSC打印机打印条码 /// <summary> /// 调用TSC打印机打印条码 /// </summary> /// <param name=&q ...
- (转载)WebSphere MQ安装过程
参考文档: http://www.ibm.com/developerworks/cn/linux/linux-speed-start/l-ss-mq/
- OpenCV3.2 + VS2015环境配置
一.准备工作: (1) 到OpenCV的官网(http://opencv.org/)下载OpenCV3.2 (2) 安装好VS2015. (3) 计算机系统:Win7(Win8, Win1 ...
- mysql基础之yum安装mysql5.7.18
2017-04-19 一.实验环境 centos7_x64 由于centos7的yum源里默认使用了mariadb替代了mysql,所有我们还得先配置一下yum源.当然mariadb和mysql是兼容 ...
- voa 2015 / 4 / 26
Now, Words and Their Stories, a VOA Special English program about American expressions. I'm Rich Kle ...
- openinstall集成小技巧
引言:最近在做一个iOS端的小游戏,想要实现在安装时自动关联好友的功能,就发帖询问有没有好的想法.在帖子中法想了这个不错的SDK,通过它我们还实现了,安装后自动进入好友游戏房间的功能.这里我就分享一下 ...