router.js 508 B

12345678910111213141516171819202122
  1. var host="http://";
  2. // var token = localStorage.getItem("token");
  3. var token = "tokenTest";
  4. $.ajaxSetup({
  5. type: "post",
  6. contentType: "application/json",
  7. dataType: "json",
  8. headers: {
  9. "token": token
  10. }
  11. // xhrFields: {
  12. // withCredentials: true
  13. // },
  14. // complete: function(xhr) {
  15. // //token过期,则跳转到登录页面
  16. // if(xhr.responseJSON.code == 401){
  17. // parent.location.href = baseURL + 'login.html';
  18. // }
  19. // }
  20. });