transfer.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. let ticket = '';
  2. if (location.search.includes('ticket')) {
  3. ticket = location.search.substring(8);
  4. const requestURL = 'https://tyyxopenapi.txhlwxx.com/openapi/oauth/zlb/checkticket.php';
  5. $.ajax({
  6. url: requestURL,
  7. async: false,
  8. type: "POST",
  9. timeout: 30000,
  10. dataType: 'json',
  11. data: {
  12. type:'login',
  13. ticket: ticket
  14. },
  15. success: (res) => {
  16. if (res.code == '1') {
  17. localStorage.setItem('userInfo', JSON.stringify(res.data));
  18. setTimeout(() => {
  19. location.href = './index.html';
  20. }, 500)
  21. } else {
  22. window.alert(res.msg);
  23. }
  24. }
  25. });
  26. }
  27. // if(location.search.includes('token')) {
  28. // location_search = location.search.split('&');
  29. // for(let i in location_search) {
  30. // if(location_search[i].includes('token')) {
  31. // let t_index = location_search[i].indexOf('=');
  32. // token = location_search[i].substring(t_index+1);
  33. // } else if(location_search[i].includes('url_from')) {
  34. // let f_index = location_search[i].indexOf('=');
  35. // url_from = location_search[i].substring(f_index+1);
  36. // } else if(location_search[i].includes('url_to')) {
  37. // let o_index = location_search[i].indexOf('=');
  38. // url_to = decodeURIComponent(location_search[i].substring(o_index+1));
  39. // }
  40. // }
  41. // if(token != '') {
  42. // const requestURL = gobalData.login + '/user/main/detail';
  43. // $.ajax({
  44. // url: requestURL,
  45. // async: false,
  46. // type: "POST",
  47. // timeout: 30000,
  48. // dataType: 'json',
  49. // data: {
  50. // client:'web',
  51. // token: token
  52. // },
  53. // success:(res) =>{
  54. // if(res.code == '1') {
  55. // localStorage.setItem('userInfo', JSON.stringify(res.data));
  56. // setCookienew('overtime', 'overtime', hours);
  57. // setCookie(cookieskey,token);
  58. // setTimeout(()=>{
  59. // location.href = url_to;
  60. // },500)
  61. //
  62. // }
  63. // }
  64. // });
  65. // }
  66. // } else {
  67. // window.location.href = './index.html';
  68. // }
  69. // new Vue({
  70. // el: '#transfer',
  71. // data() {
  72. // return {
  73. // link: ''
  74. // }
  75. // },
  76. // methods: {},
  77. // mounted() {
  78. // this.link = location.href;
  79. // }
  80. // })