|
@@ -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);
|