Selaa lähdekoodia

feat():授权

geek 4 vuotta sitten
vanhempi
commit
a7f29e4236
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      application/index/controller/Index.php

+ 3 - 1
application/index/controller/Index.php

@@ -15,7 +15,6 @@ class Index {
 
     public function index() {
 
-
         $visitorId = input('visitorId');
         $notifyUrl = input('notify_url');
         $channelId = input('channelId');
@@ -24,9 +23,12 @@ class Index {
         }
         $data = CommonService::getSetData($channelId);
         if (empty(Session::get('wxId'))){
+            Session::set('visitorId','');
             header("Location:".CommonService::getAuthUrl($channelId));
             die();
         }
+        Session::get($visitorId);
+        Session::set('visitorId', $visitorId);
         //增加客户自己的验证逻辑,例如登录,关注,付费,填手机号等
         $key = md5($visitorId.$data['channel_auth_code']);
         if(strpos($notifyUrl,'?') !== false){//url参数处理,将key加到url参数中