Example #1
0
 /**
  * 获取证书的版权信息
  * @param string app id
  * @return boolean 成功与否
  */
 static function active_certi_info($app_id = 'b2c')
 {
     $ceti_app = 'open.certi_info';
     $certi_id = self::certi_id();
     $token = self::token();
     $certi_ac = md5($ceti_app . $certi_id . $token);
     $data = array('certi_app' => $ceti_app, 'certificate_id' => $certi_id, 'certi_ac' => $certi_ac);
     $http = kernel::single('base_httpclient');
     $http->set_timeout(6);
     $result = $http->post(LICENSE_CENTER_INFO, $data);
     $result = json_decode($result, 1);
     if ($result['res'] == 'succ') {
         return self::set_certi_info($app_id, json_encode($result['info']));
     } else {
         kernel::error('Certificate info getting fail, ' . $result['msg']);
         return false;
     }
 }
Example #2
0
 /**
  * 获取证书的版权信息
  * @param string app id
  * @return boolean 成功与否
  */
 static function active_certi_info($app_id = 'b2c')
 {
     $ceti_app = 'open.certi_info';
     $certi_id = self::certi_id();
     $token = self::token();
     $certi_ac = md5($ceti_app . $certi_id . $token);
     $data = array('certi_app' => $ceti_app, 'certificate_id' => $certi_id, 'certi_ac' => $certi_ac);
     $http = kernel::single('base_httpclient');
     $http->set_timeout(6);
     $posturl = config::get('link.license_center');
     logger::info("active_certi_info:" . var_export($data, true));
     $result = $http->post($posturl, $data);
     $result = json_decode($result, 1);
     logger::info("active_certi_info:" . var_export($result, true));
     if ($result['res'] == 'succ') {
         return self::set_certi_info($app_id, json_encode($result['info']));
     } else {
         kernel::error('Certificate info getting fail, ' . $result['msg']);
         return false;
     }
 }