在页面向后台发送请求时,报如上图的错误的解决办法:

在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.”问题解决的更多相关文章

  1. ABP Zero示例项目登录报错“Empty or invalid anti forgery header token.”问题解决

    ABP Zero项目,登录时出现如图"Empty or invalid anti forgery header token."错误提示的解决方法: 在 WebModule.cs的P ...

  2. curl 发送请求的时候报错

    AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ...

  3. 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 ...

  4. 发布报错: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,报了这个错,纳尼! ...

  5. 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 ...

  6. Mac 升级后idea执行git命令报错xcrun: error: invalid active developer path的解决办法

    报错 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun ...

  7. 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 ...

  8. oracle+mybatis报错:BindingException("Invalid bound statement (not found): ")

    oracle+mybatis报错:BindingException("Invalid bound statement (not found): ") 从mysql转到oracle数 ...

  9. egg启动时,报错:Ignoring invalid timezone passed to Connection的解决方案

    报错信息 Ignoring invalid timezone passed to Connection: +8:00. This is currently a warning, but in futu ...

随机推荐

  1. iOS 转场动画探究(一)

    什么是转场动画: 转场动画说的直接点就是你常见的界面跳转的时候看到的动画效果,我们比较常见的就是控制器之间的Push和Pop,还有Present和Dismiss的时候设置一下系统给我们的modalTr ...

  2. 1、AngularJS 验证

    1.formName.inputFieldName.property($pristine(未修改).$dirty(修改过的).$valid(合法).$invalid(非法).$error(当前表单所有 ...

  3. javascript中apply,call,bind区别,bind兼容等问题总结

    1 三者的相似之处: (1).都是用来改变函数的this对象的指向的 (2).都是用第一个参数来做this对象的指向 (3).都可以传参数进去 那么,具体到它们有什么区别呢?请看下面的例子: 两个对象 ...

  4. Lambda(Linq)

    在谈到lambda表达式之前,首先要说一下委托,在下一章会详细介绍委托,在这里就是简单说明一下. 委托的关键字段delegate,声明委托 public delegate void NoReturnN ...

  5. 【Android Developers Training】 37. 共享一个文件

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  6. 【Android Developers Training】 29. 从Activity获得结果

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  7. ajax数据请求4(xml格式)

    ajax数据请求4(xml格式): <!doctype html> <html> <head> <meta charset="utf-8" ...

  8. mybatis学习笔记(四)-- 为实体类定义别名两种方法(基于xml映射)

    下面示例在mybatis学习笔记(二)-- 使用mybatisUtil工具类体验基于xml和注解实现 Demo的基础上进行优化 以新增一个用户为例子,原UserMapper.xml配置如下: < ...

  9. CSS使用心得小结

    CSS心得 最近对CSS的使用有一些小心得,在此写下来给大家分享分享 .最后附上选择器的实例代码. ------DanlV CSS是什么 层叠样式表(英文全称:Cascading Style Shee ...

  10. Oracle trunc()函数的用法--来着心静禅定ing

    1.TRUNC(for dates) TRUNC函数为指定元素而截去的日期值. 其具体的语法格式如下: TRUNC(date[,fmt]) 其中: date 一个日期值 fmt 日期格式,该日期将由指 ...