Commit 55a75443adccb5a3807dd6fb8c284c74dd1d515e
1 parent
b105008b
修改前端文件
Showing
6 changed files
with
25 additions
and
10 deletions
lottery.js
1 | // var baseURL = 'https://yq.vchangyi.com/party/phpapi'; | 1 | // var baseURL = 'https://yq.vchangyi.com/party/phpapi'; |
2 | -var baseURL = 'http://dsc-b.vchangyi.com/party/phpapi'; | ||
3 | -// var baseURL = 'http://t.dev/party/phpapi' | 2 | +//var baseURL = 'http://dsc-b.vchangyi.com/party/phpapi'; |
3 | + var baseURL = 'phpapi' | ||
4 | 4 | ||
5 | let interval = null; | 5 | let interval = null; |
6 | // 抽奖页面动作 | 6 | // 抽奖页面动作 |
phpapi/Common/Encrypter.php
@@ -14,7 +14,8 @@ class Encrypter | @@ -14,7 +14,8 @@ class Encrypter | ||
14 | * @return string | 14 | * @return string |
15 | */ | 15 | */ |
16 | public function encrypt($str){ | 16 | public function encrypt($str){ |
17 | - $key = include('config.php')['key']; | 17 | + $config = include('Common/config.php'); |
18 | + $key = $config['key']; | ||
18 | $mixStr = md5(date('Y-m-d H:i:s').rand(1000,9999)); | 19 | $mixStr = md5(date('Y-m-d H:i:s').rand(1000,9999)); |
19 | $tmp = ''; | 20 | $tmp = ''; |
20 | $strLen = strlen($str); | 21 | $strLen = strlen($str); |
@@ -32,7 +33,8 @@ class Encrypter | @@ -32,7 +33,8 @@ class Encrypter | ||
32 | * @return string | 33 | * @return string |
33 | */ | 34 | */ |
34 | public function decrypt($str){ | 35 | public function decrypt($str){ |
35 | - $key = include('config.php')['key']; | 36 | + $config = include('Common/config.php'); |
37 | + $key = $config['key']; | ||
36 | $str = $this->bind_key(base64_decode($str), $key); | 38 | $str = $this->bind_key(base64_decode($str), $key); |
37 | $strLen = strlen($str); | 39 | $strLen = strlen($str); |
38 | $tmp = ''; | 40 | $tmp = ''; |
phpapi/apicp.AdminLogin.php
@@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
16 | JsonResponse::error('验证失败'); | 16 | JsonResponse::error('验证失败'); |
17 | } | 17 | } |
18 | $config = include('Common/config.php'); | 18 | $config = include('Common/config.php'); |
19 | + | ||
19 | if ($config['admin'] != md5($_GET['id'])) { | 20 | if ($config['admin'] != md5($_GET['id'])) { |
20 | JsonResponse::error('验证失败'); | 21 | JsonResponse::error('验证失败'); |
21 | } | 22 | } |
phpapi/apicp.ItemVote.php
@@ -8,7 +8,14 @@ | @@ -8,7 +8,14 @@ | ||
8 | include "Common/WechatHelper.php"; | 8 | include "Common/WechatHelper.php"; |
9 | include "Common/Encrypter.php"; | 9 | include "Common/Encrypter.php"; |
10 | 10 | ||
11 | + // 查询投票通道是否开启 | ||
11 | 12 | ||
13 | + $mysql = new mysqlHelper(); | ||
14 | + $sql = "SELECT `value` from `setting` WHERE `key` = 'isStartVote' AND `value` = 1;"; | ||
15 | + $data = $mysql->fetch($sql); | ||
16 | + if (empty($data)) { | ||
17 | + JsonResponse::error('等候主持人宣布开启投票通道'); | ||
18 | + } | ||
12 | 19 | ||
13 | if(!isset($_POST['user_id'])){ | 20 | if(!isset($_POST['user_id'])){ |
14 | JsonResponse::error('userID参数不能为空'); | 21 | JsonResponse::error('userID参数不能为空'); |
@@ -22,7 +29,6 @@ | @@ -22,7 +29,6 @@ | ||
22 | JsonResponse::error('投票节目Id类型有误'); | 29 | JsonResponse::error('投票节目Id类型有误'); |
23 | } | 30 | } |
24 | 31 | ||
25 | - $mysql = new mysqlHelper(); | ||
26 | $user_id = $_POST['user_id']; | 32 | $user_id = $_POST['user_id']; |
27 | 33 | ||
28 | 34 |
phpapi/apicp.SignIn.php
@@ -8,6 +8,13 @@ | @@ -8,6 +8,13 @@ | ||
8 | include "Common/WechatHelper.php"; | 8 | include "Common/WechatHelper.php"; |
9 | include "Common/Encrypter.php"; | 9 | include "Common/Encrypter.php"; |
10 | 10 | ||
11 | + | ||
12 | + $mysql = new mysqlHelper(); | ||
13 | + $data = $mysql->fetch("SELECT `value` FROM `setting` WHERE `key` = 'isStopSign' AND `value` = 1"); | ||
14 | + if ($data) { | ||
15 | + JsonResponse::error("年会签到通道暂未开启"); | ||
16 | + } | ||
17 | + | ||
11 | // 头像,姓名必填 | 18 | // 头像,姓名必填 |
12 | if (!isset($_POST['realname'])) { | 19 | if (!isset($_POST['realname'])) { |
13 | JsonResponse::error('姓名不能为空'); | 20 | JsonResponse::error('姓名不能为空'); |
@@ -15,7 +22,6 @@ | @@ -15,7 +22,6 @@ | ||
15 | 22 | ||
16 | $realname = $_POST['realname']; | 23 | $realname = $_POST['realname']; |
17 | 24 | ||
18 | - $mysql = new mysqlHelper(); | ||
19 | $data = $mysql->fetch("SELECT id,realname,headimg,table_no,prize_no FROM user WHERE realname = ?", [$realname]); | 25 | $data = $mysql->fetch("SELECT id,realname,headimg,table_no,prize_no FROM user WHERE realname = ?", [$realname]); |
20 | 26 | ||
21 | // 头像,姓名必填 | 27 | // 头像,姓名必填 |
setting.html
@@ -26,9 +26,9 @@ | @@ -26,9 +26,9 @@ | ||
26 | <button onclick="setting.login()">登录</button> | 26 | <button onclick="setting.login()">登录</button> |
27 | <button onclick="setting.loginOut()">退出</button> | 27 | <button onclick="setting.loginOut()">退出</button> |
28 | </li> | 28 | </li> |
29 | - <li> | 29 | + <!--<li> |
30 | <a href="http://t.dev/party/generateUserCache.php" target="_blank">用户数据拉取到本地</a> | 30 | <a href="http://t.dev/party/generateUserCache.php" target="_blank">用户数据拉取到本地</a> |
31 | - </li> | 31 | + </li>--> |
32 | <li> | 32 | <li> |
33 | <span onclick="setting.startSign()">开始微信H5签到</span> | 33 | <span onclick="setting.startSign()">开始微信H5签到</span> |
34 | <span onclick="setting.stopSign()">关闭微信H5签到</span> | 34 | <span onclick="setting.stopSign()">关闭微信H5签到</span> |
@@ -37,10 +37,10 @@ | @@ -37,10 +37,10 @@ | ||
37 | <span onclick="setting.startVote()">开启投票通道</span> | 37 | <span onclick="setting.startVote()">开启投票通道</span> |
38 | <span onclick="setting.stopVote()">关闭投票通道</span> | 38 | <span onclick="setting.stopVote()">关闭投票通道</span> |
39 | </li> | 39 | </li> |
40 | - <li> | 40 | + <!--<li> |
41 | <input id = "user-id" /> | 41 | <input id = "user-id" /> |
42 | <span onclick="setting.resetUser()">重置用户信息</span>(抽奖码,可以重新提交信息) | 42 | <span onclick="setting.resetUser()">重置用户信息</span>(抽奖码,可以重新提交信息) |
43 | - </li> | 43 | + </li>--> |
44 | <li> | 44 | <li> |
45 | <span onclick="setting.userList()">用户管理</span> | 45 | <span onclick="setting.userList()">用户管理</span> |
46 | </li> | 46 | </li> |