Browse Source

实名认证,一天三次。默认个性签名

lizhen_gitee 10 months ago
parent
commit
81fc502797
2 changed files with 10 additions and 1 deletions
  1. 9 1
      application/api/controller/Userauth.php
  2. 1 0
      application/common/library/Auth.php

+ 9 - 1
application/api/controller/Userauth.php

@@ -262,6 +262,14 @@ class Userauth extends Api
             $this->error('您的头像还在审核中,审核完成在认证吧');
         }
 
+        //一天最多认证3次
+        $apiLimitTime = strtotime(date('Y-m-d 23:59:59')) - time();
+        $rs = $this->apiLimit(3,$apiLimitTime*1000);
+        if(!$rs){
+            $this->error('一天最多认证三次');
+        }
+
+
         //获取token
         $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.config('tencent_yun')['secret_id'].'&secret='.config('tencent_yun')['secret_key'].'&grant_type=client_credential&version=1.0.0';
         $token_result = file_get_contents($token_url);
@@ -481,7 +489,7 @@ class Userauth extends Api
         $this->success($msg);
     }
 
-
+///////////////////////////////////////////////////////////////////////
 
     //真人认证后修改头像
     public function editrealavatar() {

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

@@ -245,6 +245,7 @@ class Auth
             /*'level'    => 1,
             'score'    => 0,*/
             'avatar' => '',
+            'bio'   => '美好生活从这里开始~',
             //'introcode' => $this->getUinqueNo(8, $introcode),
         ];
         $params = array_merge($data, [