dever 4 years ago
parent
commit
1e2356874e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      lib/Client.php

+ 8 - 1
lib/Client.php

@@ -54,6 +54,7 @@ class Client extends Base
 		$this->initSource();
         $this->initSystem();
 		$this->initSourceType();
+		$this->initSystemSource();
 		$this->initRefer();
 		$this->initConfig();
 	}
@@ -91,6 +92,12 @@ class Client extends Base
 		$this->session->add($this->prefix . 'oauth_source_type', $this->source_type);
 	}
 
+	private function initSystemSource()
+	{
+		$this->system_source = (isset($this->request['system_source']) && $this->request['system_source']) ? $this->request['system_source'] : $this->session->get($this->prefix . 'oauth_system_source');
+		$this->session->add($this->prefix . 'oauth_system_source', $this->system_source);
+	}
+
 	private function initSource()
 	{
 		$this->source = (isset($this->request['source']) && $this->request['source']) ? $this->request['source'] : $this->session->get($this->prefix . 'oauth_source');
@@ -287,7 +294,7 @@ class Client extends Base
             $user['country'] = $userinfo['country'];
         }
 
-    	$user = $this->passport->wechat($data, $user, $this->account, $this->system, $this->source_type, $this->source);
+    	$user = $this->passport->wechat($data, $user, $this->account, $this->system, $this->source_type, $this->system_source, $this->source);
 
         return $user;
 	}