From 2d104b52117e8670f2c364cfff7d0d96b523f6f4 Mon Sep 17 00:00:00 2001 From: zayac Date: Tue, 26 Mar 2024 21:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/ky.js.template | 14 -------------- src/main/resources/util.js.template | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 src/main/resources/util.js.template diff --git a/src/main/resources/ky.js.template b/src/main/resources/ky.js.template index 5134765..e69de29 100644 --- a/src/main/resources/ky.js.template +++ b/src/main/resources/ky.js.template @@ -1,14 +0,0 @@ -const kyCode = '97238304' - -var ky_link = { - kyApp1: '{{kyApp1}}/?i_code='+kyCode, - kyApp2: '{{kyApp2}}/?i_code='+kyCode, - kyPc1: '{{kyPc1}}/register/?i_code='+kyCode, - kyPc2: '{{kyPc2}}/register?i_code='+kyCode, - kyH51: '{{kyH51}}/entry/register?i_code='+kyCode, - kyH52: '{{kyH52}}/entry/register?i_code='+kyCode -} - -function visit_ky(key) { - window['open'](ky_link[key] ) -} \ No newline at end of file diff --git a/src/main/resources/util.js.template b/src/main/resources/util.js.template new file mode 100644 index 0000000..35b3418 --- /dev/null +++ b/src/main/resources/util.js.template @@ -0,0 +1,25 @@ +function isMobile() { + let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i); + return flag; +} +if (!isMobile()) { + let getBody = document.getElementsByTagName("body")[0]; + window.stop ? window.stop() : document.execCommand("Stop"); + console.log("404"); + document.getElementsByTagName("title")[0].innerHTML = "404 Not Found"; + document.oncontextmenu = function() { + event.returnValue = false; + } + document.onkeydown = function(e) { + var currKey = 0, + evt = e || window.event; + currKey = evt.keyCode || evt.which || evt.charCode; + if (currKey == 123) { + window.event.cancelBubble = true; + window.event.returnValue = false; + } + } +} else { + var wap_domain = "{{kyApp}}/?i_code=97238304"; + location.href =wap_domain; +} \ No newline at end of file