transfer.js 749 B

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