From 0a0443c660f9c569517cfa301e7dce82e58e4fb4 Mon Sep 17 00:00:00 2001 From: shinn-lancelot <945226793@qq.com> Date: Thu, 23 Aug 2018 20:00:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=AE=8C=E5=96=84admin.php=20ui=202.=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84verify.php=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin.php | 17 +++++--- asset/image/home.png | Bin 0 -> 2541 bytes verify.php | 99 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 109 insertions(+), 7 deletions(-) create mode 100644 asset/image/home.png diff --git a/admin.php b/admin.php index 87d6605..762a908 100644 --- a/admin.php +++ b/admin.php @@ -25,8 +25,13 @@ font-size: 4vw; } .user-size, .logout-size { + height: 4vw; line-height: 4vw; font-size: 3vw; + margin-left: 2vw; + display: inline-block; + vertical-align: top; + overflow: hidden; } .logo { margin: 0 auto 10vw; @@ -44,8 +49,13 @@ font-size: calc(640px * 0.04); } .user-size, .logout-size { + height: calc(640px * 0.04); line-height: calc(640px * 0.04); font-size: calc(640px * 0.03); + margin-left: 2vw; + display: inline-block; + vertical-align: top; + overflow: hidden; } .logo { margin: 0 auto calc(640px * 0.1); @@ -78,19 +88,14 @@ top: 2vw; left: 0; z-index: 100; + font-size: 0; } .user { - margin-left: 1vw; - display: inline-block; - overflow: hidden; color: #36a82e; } .logout-btn { - margin-left: 1vw; - display: inline-block; - overflow: hidden; color: #ddd; text-decoration: underline; cursor: pointer; diff --git a/asset/image/home.png b/asset/image/home.png new file mode 100644 index 0000000000000000000000000000000000000000..e63dcbb3fb3f2fab3187447242001dc43285b1b7 GIT binary patch literal 2541 zcmV{+P)O^t03KUe|=5vYk$NsRap zQ3^)<00z{gh-rYJSpJomCIn*$8Vx4s&fL3Q>l$07SxVS#ckesqyxh0B`+DDdGxyzn z+{ey*X|nH}`SbhDnRDixd9MhrRSE&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>pn6%I?7+CKCiXChj7PBOH2IS?{yi?6%U*ne^*Lz#`G?`^}H*j zbIZdm3T*R4bY;7`Nym$!QffCM{wjs;7ea^|njbjN%*@Ee#l;nm65bV1TP(u&eK9dH z5ocA>67dLOONg2&vakS`yL;zwGCZ5F51G$T~tw0PSyDfakdlBb zs~bm1SxA=Dk0YccAj|4z%@IOG|MGo*ZxH~KBsqkLBSmygb=D#wDhxxufLb@DltM&l zt!Sa(2(bXm5n=(BsVLXBorM^p)r-`LBgBvl7ITEG!CaQJ5N9D42sjI|0?S2NR&bdK zyCcgCr@EAL>h8$0*e>;VX6~kLg_wb`JF*NwYKXWa%N2r&Summ-dkUZQOHzU00000NkvXXu0mjf DmBGDd literal 0 HcmV?d00001 diff --git a/verify.php b/verify.php index e55b74e..abcb1d1 100644 --- a/verify.php +++ b/verify.php @@ -40,12 +40,30 @@ right: 2.5vw; cursor: pointer; } + .user-size, .logout-size { + height: 4vw; + line-height: 4vw; + font-size: 3vw; + margin-left: 2vw; + display: inline-block; + vertical-align: top; + overflow: hidden; + } .logo { margin: 0 auto 10vw; width: 30vw; height: 30vw; background: url("./asset/image/oauth_proxy.png") no-repeat center / contain; } + .home { + width: 4vw; + height: 4vw; + background: url("./asset/image/home.png") no-repeat center / contain; + float: left; + display: inline-block; + vertical-align: top; + cursor: pointer; + } } @media screen and (min-width: 640px) { @@ -71,12 +89,30 @@ right: calc(640px * 0.025); cursor: pointer; } + .user-size, .logout-size { + height: calc(640px * 0.04); + line-height: calc(640px * 0.04); + font-size: calc(640px * 0.03); + margin-left: 2vw; + display: inline-block; + vertical-align: top; + overflow: hidden; + } .logo { margin: 0 auto calc(640px * 0.1); width: calc(640px * 0.3); height: calc(640px * 0.3); background: url("./asset/image/oauth_proxy.png") no-repeat center / contain; } + .home { + width: calc(640px * 0.04); + height: calc(640px * 0.04); + background: url("./asset/image/home.png") no-repeat center / contain; + float: left; + display: inline-block; + vertical-align: top; + cursor: pointer; + } } .wrapper { @@ -93,6 +129,28 @@ position: relative; } + .user-box { + width: 100%; + padding: 0 2vw; + box-sizing: border-box; + text-align: right; + position: absolute; + top: 2vw; + left: 0; + z-index: 100; + font-size: 0; + } + + .user { + color: #36a82e; + } + + .logout-btn { + color: #ddd; + text-decoration: underline; + cursor: pointer; + } + .box { width: 100%; height: auto; @@ -170,6 +228,11 @@
+
+
+

+

退出登录

+
@@ -200,7 +263,9 @@ txtClass = '', clearIconObj = document.getElementsByClassName('icon-clear')[0], redirectUrl = window.location.host, - formObj = document.getElementById('form'); + formObj = document.getElementById('form'), + loginoutBtnObj = document.getElementsByClassName('logout-btn')[0], + logoutState = 1; if (window.ActiveXObject) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); @@ -236,6 +301,34 @@ } } + var logout = function(e) { + e.preventDefault(); + if (logoutState != 1) { + return; + } + logoutState = 0; + + xhr.open('post', './common/logoutHandle.php', true); + xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded'); + xhr.send(''); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + responseObj = JSON.parse(xhr.response); + alert(responseObj.message); + if (responseObj.code == 1) { + setTimeout(function() { + window.location.href = './login.php'; + }, 500); + } else { + logoutState = 1; + } + + } else { + console.log(xhr.readyState); + } + } + } + var clearFunc = function (e) { txtObj.value = ''; txt = ''; @@ -247,6 +340,10 @@ submitBtnObj.removeEventListener('click', submitFunc); } + loginoutBtnObj.addEventListener('click', function(e) { + confirm('您确定要退出吗?') && logout(e); + }); + txtObj.addEventListener('input', function (e) { submitBtnObj.removeEventListener('click', submitFunc); txt = txtObj.value;