示例#1
0
 public function initToken($code)
 {
     $o = tbauth::getInstance(TAOBAO_LOGIN_APPSECRET, TAOBAO_LOGIN_APPKEY, TAOBAO_LOGIN_CALLBACK);
     $resp = $o->getToken($code);
     if ($resp !== null) {
         $_SESSION['taobao']["access_token"] = $resp['access_token'];
         $_SESSION['taobao']["expiry"] = $resp['expires_in'];
         return $_SESSION['taobao']["access_token"];
     }
     return null;
 }
示例#2
0
 public static function getInstance($appsecret, $appkey, $callback)
 {
     if (self::$_instance === null) {
         self::$_instance = new self($appsecret, $appkey, $callback);
     }
     return self::$_instance;
 }