Bladeren bron

feat():授权

geek 4 jaren geleden
bovenliggende
commit
21c5d81072
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      application/index/controller/Index.php

+ 5 - 5
application/index/controller/Index.php

@@ -31,14 +31,14 @@ class Index {
             die();
         }
         $model = new VisitorModel();
-        $info = $model::where(['unionid' => Session::get('wxId')])->find();
-        if (empty($info)) {
+        $visitorInfo = $model::where(['unionid' => Session::get('wxId')])->find();
+        if (empty($visitorInfo)) {
             $model::where(['unionid' => Session::get('wxId')])->insertGetId([
                 'visitorId' => $visitorId,
                 'unionid' => Session::get('wxId'),
             ]);
         } else {
-            $visitorId = $info['visitorId'];
+            $visitorId = $visitorInfo['visitorId'];
         }
         //        $params = [
 //            'id'     => $info['channel_id'],
@@ -52,9 +52,9 @@ class Index {
         //增加客户自己的验证逻辑,例如登录,关注,付费,填手机号等
         $key = md5($visitorId.$data['channel_auth_code']);
         if(strpos($notifyUrl,'?') !== false){//url参数处理,将key加到url参数中
-            $returnUrl = $notifyUrl."&key=".$key."&expire=10";
+            $returnUrl = $notifyUrl."&key=".$key."&expire=1";
         }else{
-            $returnUrl = $notifyUrl."?key=".$key."&expire=10";
+            $returnUrl = $notifyUrl."?key=".$key."&expire=1";
         }
         header("Location:".$returnUrl);//跳转到直播观看页
         //        redirect($returnUrl);