1
0

xinhudocChajian.php 754 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * 连接信呼文件管理平台
  4. */
  5. class xinhudocChajian extends Chajian{
  6. public function geturlstr($mod, $act, $can=array())
  7. {
  8. $url = getconfig('xinhudoc_platurl');
  9. $key = getconfig('xinhudoc_openkey');
  10. if(substr($url,-1)!='/')$url.='/';
  11. $url .= 'openapi/'.$mod.'/'.$act.'?openkey='.md5($key).'';
  12. foreach($can as $k=>$v)$url.='&'.$k.'='.$v.'';
  13. return $url;
  14. }
  15. /**
  16. * 返回内容处理
  17. */
  18. public function returnresult($result)
  19. {
  20. if($result && contain($result,'success')){
  21. $stat = strpos($result,'{');
  22. if(!$stat)$stat=0;
  23. $barr = json_decode(substr($result, $stat), true);
  24. if(isset($barr['success']))return $barr;
  25. }
  26. return returnerror('returnerr:'.$result.'');
  27. }
  28. }
粤ICP备19079148号