ajax前置处理实现异步请求session过期时跳转登录页面
function checkLogin(json) { if (typeof(json) === ‘string‘ && ~json.indexOf(‘<!DOCTYPE html>‘)) { window.location.href = $(‘base‘).attr(‘href‘) + ‘auth/login‘ } }
session过期时ajax请求刷新浏览器
原文:http://www.cnblogs.com/jzm17173/p/6072432.html