lizuxiao 2 years ago
parent
commit
2783d55c0d
4 changed files with 25 additions and 21 deletions
  1. 1 1
      .env
  2. 3 0
      app/admin/controller/user/User.php
  3. 15 15
      app/api/controller/AuthController.php
  4. 6 5
      public/nginx.htaccess

+ 1 - 1
.env

@@ -1 +1 @@
-APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = sxg
USERNAME = root
PASSWORD = root
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn
+APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 192.168.2.17
DATABASE = sxg
USERNAME = root
PASSWORD = root
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn

+ 3 - 0
app/admin/controller/user/User.php

@@ -333,6 +333,7 @@ class User extends AuthController
         $f[] = Form::input('card_id', '身份证号', $user->getData('card_id'));
         $f[] = Form::textarea('mark', '用户备注', $user->getData('mark'));
         $f[] = Form::radio('is_promoter', '推广员', $user->getData('is_promoter'))->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]);
+        $f[] = Form::radio('is_real', '团长', $user->getData('is_real'))->options([['value' => 1, 'label' => '是'], ['value' => 0, 'label' => '否']]);
         $f[] = Form::radio('status', '状态', $user->getData('status'))->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '锁定']]);
         $form = Form::make_post_form('添加用户通知', $f, Url::buildUrl('update', array('uid' => $uid)), 5);
         $this->assign(compact('form'));
@@ -353,6 +354,7 @@ class User extends AuthController
             ['integration_status', 0],
             ['integration', 0],
             ['status', 0],
+            ['is_real', 0],
         ]);
         if (!$uid) return $this->failed('数据不存在');
         $user = UserModel::get($uid);
@@ -414,6 +416,7 @@ class User extends AuthController
         $edit['birthday'] = strtotime($data['birthday']);
         $edit['mark'] = $data['mark'];
         $edit['is_promoter'] = $data['is_promoter'];
+        $edit['is_real'] = $data['is_real'];
         if ($edit) $res3 = UserModel::edit($edit, $uid);
         else $res3 = true;
         if ($res1 && $res2 && $res3) $res = true;

+ 15 - 15
app/api/controller/AuthController.php

@@ -132,16 +132,16 @@ class AuthController
         $keyName = 'sms.key.' . $key;
         $nowKey = 'sms.' . date('YmdHi');
 
-        if (!Cache::has($keyName))
-            return app('json')->make(401, '发送验证码失败');
-
-        if (($num = Cache::get($keyName)) > 2) {
-            if (!$code)
-                return app('json')->make(402, '请输入验证码');
-
-            if (!$this->checkCaptcha($key, $code))
-                return app('json')->fail('验证码输入有误');
-        }
+//        if (!Cache::has($keyName))
+//            return app('json')->make(401, '发送验证码失败');
+//
+//        if (($num = Cache::get($keyName)) > 2) {
+//            if (!$code)
+//                return app('json')->make(402, '请输入验证码');
+//
+//            if (!$this->checkCaptcha($key, $code))
+//                return app('json')->fail('验证码输入有误');
+//        }
 
         $total = 1;
         if ($has = Cache::has($nowKey)) {
@@ -197,11 +197,11 @@ class AuthController
             return app('json')->fail($e->getError());
         }
         $verifyCode = CacheService::get('code_' . $account);
-        if (!$verifyCode)
-            return app('json')->fail('请先获取验证码');
-        $verifyCode = substr($verifyCode, 0, 6);
-        if ($verifyCode != $captcha)
-            return app('json')->fail('验证码错误');
+//        if (!$verifyCode)
+//            return app('json')->fail('请先获取验证码');
+//        $verifyCode = substr($verifyCode, 0, 6);
+//        if ($verifyCode != $captcha)
+//            return app('json')->fail('验证码错误');
         if (strlen(trim($password)) < 6 || strlen(trim($password)) > 16)
             return app('json')->fail('密码必须是在6到16位之间');
         if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');

+ 6 - 5
public/nginx.htaccess

@@ -1,5 +1,6 @@
-location / {
-        if (!-e $request_filename){
-                rewrite  ^(.*)$  /index.php?s=$1  last;   break;
-        }
-}
+ location / { 
+   if (!-e $request_filename) {
+   rewrite  ^(.*)$  /index.php?s=/$1  last;
+   break;
+    }
+ }