Skip to content

Commit

Permalink
1. 文件命名修改 2. 登录、管理、验证页完善
Browse files Browse the repository at this point in the history
  • Loading branch information
shinn-lancelot committed Aug 23, 2018
1 parent 0798f35 commit 67f2aa8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
12 changes: 6 additions & 6 deletions admin.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

session_start();
$user = $_SESSION['wop_admin_user'];
if (empty($user)) {
header('Location: ./login.html');
}
empty($user) && header('Location: ./login.php');

?>

<!DOCTYPE html>
Expand Down Expand Up @@ -157,7 +157,7 @@
<div class="box">
<div class="box-content">
<div class="logo"></div>
<a href="./verify.html">
<a href="./verify.php">
<div class="btn btn-size">
<p>添加微信公众号授权登录txt验证内容</p>
</div>
Expand Down Expand Up @@ -195,7 +195,7 @@
}
logoutState = 0;

xhr.open('post', './common/logout.php', true);
xhr.open('post', './common/logoutHandle.php', true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.send('');
xhr.onreadystatechange = function() {
Expand All @@ -204,7 +204,7 @@
alert(responseObj.message);
if (responseObj.code == 1) {
setTimeout(function() {
window.location.href = './login.html';
window.location.href = './login.php';
}, 500);
} else {
logoutState = 1;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion login.html → login.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<?php

session_start();
$user = $_SESSION['wop_admin_user'];
empty(!$user) && header('Location: ./admin.php');

?>

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -253,7 +261,7 @@
return;
}

xhr.open('post', './common/login.php', true);
xhr.open('post', './common/loginHandle.php', true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.send('user=' + user + '&password=' + password);
xhr.onreadystatechange = function() {
Expand Down
10 changes: 9 additions & 1 deletion verify.html → verify.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<?php

session_start();
$user = $_SESSION['wop_admin_user'];
empty($user) && header('Location: ./login.php');

?>

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -213,7 +221,7 @@
return;
}

xhr.open('post', './common/verify.php', true);
xhr.open('post', './common/verifyHandle.php', true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.send('txt=' + txt);
xhr.onreadystatechange = function() {
Expand Down

0 comments on commit 67f2aa8

Please sign in to comment.