From 69fc7739a954b2c8d4d4215b16c407f6aef3bfde Mon Sep 17 00:00:00 2001 From: shinn lancelot <945226793@qq.com> Date: Tue, 10 Jul 2018 17:21:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=AA=8C=E8=AF=81=E9=A1=B5=E3=80=81=E6=A1=88?= =?UTF-8?q?=E4=BE=8B=E9=A1=B5=E5=8A=9F=E8=83=BD=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=202.=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E6=B3=A8=E9=87=8A=EF=BC=8C=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WechatOauthProxy/WechatOauth.php | 2 -- demo/index.php | 9 +++++--- verify.html | 38 ++++++++++++++------------------ 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/WechatOauthProxy/WechatOauth.php b/WechatOauthProxy/WechatOauth.php index 0da1d24..ded44c0 100644 --- a/WechatOauthProxy/WechatOauth.php +++ b/WechatOauthProxy/WechatOauth.php @@ -41,7 +41,6 @@ public static function refreshAccessToken($paramsArr = array()) $apiUrl = 'https://api.weixin.qq.com/sns/oauth2/refresh_token?'; $requestUrl = $apiUrl . http_build_query($paramsArr); return json_decode(WechatOauth::http_request($requestUrl),true); - } /** @@ -54,7 +53,6 @@ public static function checkAccessToken($paramsArr = array()) $apiUrl = 'https://api.weixin.qq.com/sns/auth?'; $requestUrl = $apiUrl . http_build_query($paramsArr); return json_decode(WechatOauth::http_request($requestUrl),true); - } /** diff --git a/demo/index.php b/demo/index.php index daf8e7f..3907299 100644 --- a/demo/index.php +++ b/demo/index.php @@ -105,6 +105,7 @@ function http_request($url, $data = null) width: 60%; } .qrcode-frame p{ + font-size: 3.5vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -118,6 +119,7 @@ function http_request($url, $data = null) .info-title { width: 100%; color: #36a82e; + font-size: 3.5vw; font-weight: bold; overflow: hidden; text-overflow: ellipsis; @@ -163,11 +165,12 @@ function http_request($url, $data = null) redirect_uri = "", code = "", access_token = "", - openid = ""; + openid = "", + proxy_domain = "wxoauth.hillpy.com"; - var codeUrl = "http://wxoauth.hillpy.com/index.php?app_id=" + appid + "&scope=" + scope + "&proxy_scope=" + proxy_scope + "&redirect_uri=" + redirect_uri; + var codeUrl = "http://" + proxy_domain + "/index.php?app_id=" + appid + "&scope=" + scope + "&proxy_scope=" + proxy_scope + "&redirect_uri=" + redirect_uri; proxy_scope = ""; - var accessTokenUrl = "http://wxoauth.hillpy.com/index.php?app_id=" + appid + "&scope=" + scope + "&proxy_scope=" + proxy_scope + "&app_secret=" + appsecret + "&redirect_uri=" + redirect_uri; + var accessTokenUrl = "http://" + proxy_domain + "/index.php?app_id=" + appid + "&scope=" + scope + "&proxy_scope=" + proxy_scope + "&app_secret=" + appsecret + "&redirect_uri=" + redirect_uri; var codeBtn = document.getElementsByClassName('code-btn')[0], accessTokenBtn = document.getElementsByClassName('accesstoken-btn')[0]; diff --git a/verify.html b/verify.html index 0b42745..abae3a4 100644 --- a/verify.html +++ b/verify.html @@ -16,7 +16,6 @@ justify-content: center; width: 100%; height: 10vw; - /*max-height: calc(640px * 0.1);*/ margin: 3vw auto 0; padding: 0 10vw; box-sizing: border-box; @@ -47,7 +46,6 @@ align-items: center; justify-content: center; width: 100%; - /*height: 10vw;*/ height: calc(640px * 0.1); margin: calc(640px * 0.03) auto 0; padding: 0 calc(640px * 0.1); @@ -98,15 +96,6 @@ -webkit-transform: translate(-50%, -50%); } - /*.logo {*/ - /*margin: 0 auto;*/ - /*width: 30vw;*/ - /*height: 30vw;*/ - /*max-width: calc(640px * 0.3);*/ - /*max-height: calc(640px * 0.3);*/ - /*background: url("./asset/image/oauth_proxy.png") no-repeat center / contain;*/ - /*}*/ - #form { margin: 0 2vw; } @@ -123,11 +112,15 @@ /*}*/ #submit_btn,#copy { - user-select: none; color: #fff; background: #36a82e; cursor: pointer; border-radius: 3px; + -moz-user-select: none; + -o-user-select:none; + -webkit-user-select:none; + -ms-user-select:none; + user-select: none; } /*#submit_btn:hover {*/ /*opacity: 0.8;*/ @@ -226,12 +219,23 @@ responseObj = JSON.parse(xhr.response); alert(responseObj.message); submitState = 1; + clearFunc(); } else { console.log(xhr.readyState); } } } + var clearFunc = function (e) { + txtObj.value = ''; + var txtClass = submitBtnObj.getAttribute('class'); + if (txtClass == 'field') { + submitBtnObj.setAttribute('class', 'field disable'); + } + clearIconObj.style.display = 'none'; + submitBtnObj.removeEventListener('click', submitFunc); + } + txtObj.addEventListener('input', function (e) { submitBtnObj.removeEventListener('click', submitFunc); txt = txtObj.value; @@ -265,15 +269,7 @@ } }); - clearIconObj.addEventListener('click', function (e) { - txtObj.value = ''; - var txtClass = submitBtnObj.getAttribute('class'); - if (txtClass == 'field') { - submitBtnObj.setAttribute('class', 'field disable'); - } - this.style.display = 'none'; - submitBtnObj.removeEventListener('click', submitFunc); - }); + clearIconObj.addEventListener('click', clearFunc); formObj.addEventListener('keydown', function (e) { txt = txtObj.value;