Browse Source

每个设备每月只能注册2个账号

lizhen_gitee 7 tháng trước cách đây
mục cha
commit
727a5fcd74

+ 1 - 0
application/api/controller/Baseconfig.php

@@ -20,6 +20,7 @@ class Baseconfig extends Api
             'kefu_user_ids'            => config('site.kefu_user_ids'),//在线客服人员
             'index_pipei_switch'    => config('site.index_pipei_switch'), //首页匹配功能开关
             'kefu_url'    => config('site.kefu_url'), //客服超链接
+            'sixin_oneday_user_times'    => config('site.sixin_oneday_user_times'), //每人每天私信免费次数
 
             //问答
             'question_icon' => localpath_to_netpath(config('site.question_icon')),               //问号图标

+ 4 - 38
application/api/controller/User.php

@@ -11,7 +11,6 @@ use think\Validate;
 
 use app\common\library\Token;
 use think\Db;
-use app\common\model\UserDeviceInfo;
 use onlogin\onlogin;
 
 use addons\epay\library\Service;
@@ -97,7 +96,7 @@ class User extends Api
 
         } else {
             $extend = [
-
+                'plat_unique_id' => input('plat_unique_id','','trim'),
             ];
             $ret = $this->auth->register('', '', '', $mobile, $extend);
 
@@ -235,7 +234,7 @@ class User extends Api
 
                 } else {
                     $extend = [
-
+                        'plat_unique_id' => input('plat_unique_id','','trim'),
                     ];
                     $ret = $this->auth->register('', '', '', $mobile, $extend);
                     $is_register = 1;
@@ -626,7 +625,7 @@ class User extends Api
         } else {
             $extend = [
                 'ios_user_id' => $iosUserId,
-
+                'plat_unique_id' => input('plat_unique_id','','trim'),
             ];
             $ret = $this->auth->register('', '','', $mobile, $extend);
         }
@@ -701,7 +700,7 @@ class User extends Api
         } else {
             $extend = [
                 'wechat_openid' => $wechatCode['openid'],
-
+                'plat_unique_id' => input('plat_unique_id','','trim'),
             ];
             $ret = $this->auth->register('', '','', $mobile, $extend);
         }
@@ -826,40 +825,7 @@ class User extends Api
      */
     public function changeDeviceIp()
     {
-        // 接口防并发
-        if (!$this->apiLimit(1, 5000)) {
-            return ;
-        }
 
-        $user = $this->auth->getUser();
-        $ip = request()->ip();
-        $deviceId = $this->request->request('device_id','');
-        $phoneModel = $this->request->request('phone_model','');
-        $brand = $this->request->request('brand','');
-        $apiVersion = $this->request->request('api_version','');
-        $deviceOs = $this->request->request('device_os','');
-
-        if ($ip !== $user->loginip){
-            $update = [];
-            $update['id'] = $user->id;
-            $update['loginip'] = $ip;
-            \app\common\model\User::update($update);
-        }
-
-        $userDeviceInfo = UserDeviceInfo::get(['user_id'=>$user->u_id]);
-        if (empty($userDeviceInfo)){
-            $userDeviceInfo = new UserDeviceInfo();
-            $userDeviceInfo->user_id = $user->u_id;
-        }
-        $userDeviceInfo->device_os = $deviceOs;
-        $userDeviceInfo->device_id = $deviceId;
-        $userDeviceInfo->phone_model = $phoneModel;
-        $userDeviceInfo->brand = $brand;
-        $userDeviceInfo->api_version = $apiVersion;
-        $userDeviceInfo->save();
-
-        //首页接口调用,这里不反回信息
-//        $this->success("更新成功!");
     }
 
     //假注销

+ 11 - 0
application/common/library/Auth.php

@@ -210,6 +210,17 @@ class Auth
             return false;
         }*/
 
+        if(isset($extend['plat_unique_id']) && !empty($extend['plat_unique_id'])){
+            $map = [
+                'plat_unique_id' => $extend['plat_unique_id'],
+            ];
+            $check_lastuser = Db::name('user')->where($map)->whereTime('jointime','month')->count();
+            if($check_lastuser >= 2){
+                $this->setError('本月注册数已满,请下个月在注册');
+                return false;
+            }
+        }
+
         if(empty($mobile)){
             $this->setError('手机号必填');
             return false;

+ 15 - 15
application/config.php

@@ -339,14 +339,14 @@ return [
         'redis_selectdb' => 0,
     ],
 
-    // 运营商一键登录,正式
+    // 运营商一键登录, 不用了
     'onLogin'        => [
         //
-        'secretid'     => '285634ecce83ba06ed0fefb40f54032b',
+        'secretid'     => '',
         //
-        'secretkey'      => 'ae6a74b00cc6433cbfe6507cd799b98e',
+        'secretkey'      => '',
         //
-        'businessid'      => '443e5907c6d9477a8896b4460ec485b6',
+        'businessid'      => '',
     ],
 
 
@@ -369,23 +369,23 @@ return [
         'app_code' => '',
     ],
 
-    //阿里云实名认证三要素,正式数脉
+    //阿里云实名认证三要素,正式数脉,简讯正式
     'aliyun_auth_shumai' => [
-        'app_key'    => '204165018',
-        'app_secret' => 'owfeQdhvhzq988fC4iOz2YjnSGOk7sFX',
-        'app_code'   => '70754381570645739ce7bfb56268a483',
+        'app_key'    => '204683081',
+        'app_secret' => 'suqSGjOVxQSS6a6FvxukWJP7YbMM9HiR',
+        'app_code'   => '6b570b242d904e0a83dc68adb22c9a06',
     ],
 
-    //阿里云短信配置,正式
+    //阿里云短信配置,
     'alisms' =>[
-        'template_cn' => 'SMS_267360101', //国内
-        'template_guoji' => 'SMS_463616976', //国际
-        'sign' => 'TKEN',
-        'key' => 'LTAI5tE7djEZAXJcLtxshRu5',
-        'secret' => 'MK7sRjd2rpZ4PEbngf76PvKhvpTJWc',
+        'template_cn' => '', //国内
+        'template_guoji' => '', //国际
+        'sign' => '',
+        'key' => '',
+        'secret' => '',
     ],
 
-    //环信推送  简讯 正式
+    //环信推送  简讯正式
     'easemob' => [
         'appkey'        => '1195240713175879#jianxun',
         'client_id'     => 'YXA6B99jZQRYSseUU61dXFSszA',

+ 1 - 1
application/extra/site.php

@@ -89,6 +89,6 @@ return array (
   'question_title' => '常见问题',
   'question_basedatakey' => 'question',
   'enumtag_max' => '18',
-  'lianmeng_msg_uids' => '536',
   'kefu_url' => 'https://www.baidu.com',
+  'sixin_oneday_user_times' => '2',
 );