fromMessage.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title></title>
  6. <link href="AFrontEnd/css/special.css" rel="stylesheet" />
  7. </head>
  8. <body class="sp-text-center">
  9. <div class="sp-box" style="width:1200px">您即将跳转至<a style="color:blue" id="href"></a>,请问是否继续?</div>
  10. <div class="sp-box">
  11. <button class="sp-btn-blue sp-radius sp-btn-sm sp-mr-10" onclick="login()">继续访问</button>
  12. <button class="sp-btn-gray sp-radius sp-btn-sm sp-ml-10" onclick="window.location.href = 'about:blank'">关闭</button>
  13. </div>
  14. </body>
  15. </html>
  16. <script src="apiurljs.js"></script>
  17. <script src="AFrontEnd/js/jquery/jquery-1.8.3.min.js"></script>
  18. <script src="AFrontEnd/js/special/special.js"></script>
  19. <script>
  20. document.getElementById("href").innerHTML = window.location.href;
  21. var urlFiled = window.location.search;
  22. function login() {
  23. $.ajax({
  24. url: apiurljs.login + "g2app/message/getuserInfo",
  25. type: 'post',
  26. contentType: 'application/json',
  27. dataType: 'json',
  28. data: JSON.stringify({
  29. userid: getParameter("userid"),
  30. column: "uinputname,ushowname"
  31. }),
  32. success: function (res) {
  33. $.cookie("GlWorkPlatform-userid", getParameter("userid"), { path: '/', expires: 1 });
  34. $.cookie("GlWorkPlatform-username", res.data.UINPUTNAME, { path: '/', expires: 1 });
  35. $.cookie("GlWorkPlatform-chineseName", res.data.USHOWNAME, { path: '/', expires: 1 });
  36. $.cookie("CrossPage-ctime", sp.getLocalDate1(), { path: '/', expires: 1 });
  37. //延时进行跳转
  38. timeout = setTimeout(function () {
  39. window.location.href = "index.html?openPage=" + getParameter("openPage") + "&&PKID=" + getParameter("PKID") + "&&CNAME=" + decodeURI(getParameter("CNAME"));
  40. sessionStorage.setItem("GlWorkPlatform-LoginFrom", "GlWorkPlatform-LoginHtml");
  41. }, 500);
  42. },
  43. error: function (e) {
  44. console.log(e)
  45. }
  46. });
  47. }
  48. function getParameter(str) {
  49. var urlFiled = "";
  50. var urlFileds = window.location.search.slice(1).split("&&");
  51. urlFileds.forEach(function (item) {
  52. if (item.indexOf(str) != -1) {
  53. urlFiled = item.slice(item.indexOf("=") + 1);
  54. }
  55. })
  56. return urlFiled
  57. }
  58. </script>