后台判断ajax请求的请求后字段 。 headers设置:X-Requested-With:XMLHttpRequest 后台我就是根据这个来判断的 应该看看这篇 https://www.cnblogs.com/kaibindirver/p/10730448.html