dever 6 éve
szülő
commit
063af96b30

+ 2 - 3
project/op_dever/config.inc.php

@@ -63,9 +63,8 @@ return array(
 	# 不接入第三方
 	'passport_url' => 'http://'.$host.'/?c=Login&a=Get' ,
 
-	/*
 	#接入第三方
-	'passport_url' => 'http://'.$host.'/?c=Passport&a=Get' ,
+	//'passport_url' => 'http://'.$host.'/?c=Passport&a=Get' ,
 	'passport' => array
 	(
 		'url' => 'http://203.187.186.136:40000/saywashnew/WashCallApi/api/user/thirdpartyAuthorize.api',
@@ -73,7 +72,7 @@ return array(
 		'param' => array
 		(
 			'authorizedCode' => 'fulishe',
+			'tokenId' => '{passport_uid}',
 		),
 	),
-	*/
 );

+ 1 - 0
tm/lib/Controller/EventsController.class.php

@@ -440,6 +440,7 @@ class EventsController extends Controller {
 		$arr = $this->convertUrlQuery ( $passport_url );
 		$arr ['sign'] = $this->createSign ( $arr );
 		$passport_url .= '&sign=' . $arr ['sign'];
+		$passport_url .= '&cas_uid=' . $uid;
 		
 		return $passport_url;
 	}

+ 19 - 1
tm/lib/Controller/Passport.class.php

@@ -4,7 +4,7 @@ namespace Cas\Controller;
 use KIF\Cache\Memcached;
 use KIF\Core\Config;
 use KIF\Core\Request;
-
+use Cas\Dao\UserInfo;
 /**
  * 
  * passport 从第三方获取userid
@@ -23,12 +23,30 @@ class Passport extends Controller{
 
     public function doGet() {
         $refer = Request::g ( 'referer' );
+        $cas_uid = Request::g ( 'cas_uid' );
+        $objUserData = new UserInfo();
+		$userData = $objUserData -> get($cas_uid);
 
         //$this->objMemcached->set($this->refer, $refer);
 
         $host = $this->config['url'];
         $param = $this->config['param'];
 
+        if ($param) {
+        	foreach ($param as $k => $v) {
+        		if ($v == '{passport_uid}') {
+        			if (isset($userData['passport_uid']) && $userData['passport_uid']) {
+        				$param[$k] = $userData['passport_uid'];
+        			} else {
+        				$v = false;
+        			}
+        		}
+        		if (!$v) {
+        			unset($param[$k]);
+        		}
+	        }
+        }
+
         $data = $this->httpPost($host, $param);
 
         $data = json_decode($data, true);