Commit 55a75443adccb5a3807dd6fb8c284c74dd1d515e

Authored by 程雨佳
1 parent b105008b

修改前端文件

lottery.js
1 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 5 let interval = null;
6 6 // 抽奖页面动作
... ...
phpapi/Common/Encrypter.php
... ... @@ -14,7 +14,8 @@ class Encrypter
14 14 * @return string
15 15 */
16 16 public function encrypt($str){
17   - $key = include('config.php')['key'];
  17 + $config = include('Common/config.php');
  18 + $key = $config['key'];
18 19 $mixStr = md5(date('Y-m-d H:i:s').rand(1000,9999));
19 20 $tmp = '';
20 21 $strLen = strlen($str);
... ... @@ -32,7 +33,8 @@ class Encrypter
32 33 * @return string
33 34 */
34 35 public function decrypt($str){
35   - $key = include('config.php')['key'];
  36 + $config = include('Common/config.php');
  37 + $key = $config['key'];
36 38 $str = $this->bind_key(base64_decode($str), $key);
37 39 $strLen = strlen($str);
38 40 $tmp = '';
... ...
phpapi/apicp.AdminLogin.php
... ... @@ -16,6 +16,7 @@
16 16 JsonResponse::error('验证失败');
17 17 }
18 18 $config = include('Common/config.php');
  19 +
19 20 if ($config['admin'] != md5($_GET['id'])) {
20 21 JsonResponse::error('验证失败');
21 22 }
... ...
phpapi/apicp.ItemVote.php
... ... @@ -8,7 +8,14 @@
8 8 include "Common/WechatHelper.php";
9 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 20 if(!isset($_POST['user_id'])){
14 21 JsonResponse::error('userID参数不能为空');
... ... @@ -22,7 +29,6 @@
22 29 JsonResponse::error('投票节目Id类型有误');
23 30 }
24 31  
25   - $mysql = new mysqlHelper();
26 32 $user_id = $_POST['user_id'];
27 33  
28 34  
... ...
phpapi/apicp.SignIn.php
... ... @@ -8,6 +8,13 @@
8 8 include "Common/WechatHelper.php";
9 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 19 if (!isset($_POST['realname'])) {
13 20 JsonResponse::error('姓名不能为空');
... ... @@ -15,7 +22,6 @@
15 22  
16 23 $realname = $_POST['realname'];
17 24  
18   - $mysql = new mysqlHelper();
19 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 26 <button onclick="setting.login()">登录</button>
27 27 <button onclick="setting.loginOut()">退出</button>
28 28 </li>
29   - <li>
  29 + <!--<li>
30 30 <a href="http://t.dev/party/generateUserCache.php" target="_blank">用户数据拉取到本地</a>
31   - </li>
  31 + </li>-->
32 32 <li>
33 33 <span onclick="setting.startSign()">开始微信H5签到</span>
34 34 <span onclick="setting.stopSign()">关闭微信H5签到</span>
... ... @@ -37,10 +37,10 @@
37 37 <span onclick="setting.startVote()">开启投票通道</span>
38 38 <span onclick="setting.stopVote()">关闭投票通道</span>
39 39 </li>
40   - <li>
  40 + <!--<li>
41 41 <input id = "user-id" />
42 42 <span onclick="setting.resetUser()">重置用户信息</span>(抽奖码,可以重新提交信息)
43   - </li>
  43 + </li>-->
44 44 <li>
45 45 <span onclick="setting.userList()">用户管理</span>
46 46 </li>
... ...