link.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>打开中</title>
  6. </head>
  7. <body>
  8. <script type="text/javascript">
  9. window.onload = function GetRequest() {
  10. var url = window.location.search; //获取url中"?"符后的字串
  11. var theRequest = new Object();
  12. if (url.indexOf("?") != -1) {
  13. var str = url.substr(1);
  14. strs = str.split("&");
  15. for (var i = 0; i < strs.length; i++) {
  16. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  17. }
  18. }
  19. var str = ''
  20. for ( var key in theRequest) {
  21. if (key != 'key') {
  22. if (str.length === 0 ) {
  23. str = '?' + key + '=' + encodeURIComponent(theRequest[key])
  24. }else{
  25. str = str + '&' + key + '=' + encodeURIComponent(theRequest[key])
  26. }
  27. }else{
  28. var channelKey = theRequest[key]
  29. }
  30. }
  31. var link = 'https://operation.mige.tv/a/#/' + channelKey
  32. if (str.length > 0) {
  33. link = link.replace('#', str + '#')
  34. }
  35. console.log(link)
  36. openWIN(link)
  37. // if (url.indexOf("&") != -1) {
  38. // for (var ii = 0, )
  39. // }
  40. // return theRequest;
  41. }
  42. function openWIN (link) {
  43. window.location.href = link
  44. window.close()
  45. }
  46. </script>
  47. </body>
  48. </html>