$confinfo $this // thousands of $this->assign ("Confinfo",$confinfo);
protected functionJS_SDK ($appid,$appsecret){ $protocol= (!Empty($_server[' HTTPS ']) &&$_server[' HTTPS ']!== off | |$_server[' server_port '] = = 443)? "https://": "/http"; $url=$protocol.$_server[' Http_host '].$_server[' Request_uri ']; $api _url= "http://api.4vtk.com/wx_js_sdk.php?appid=$appid&appsecret=$appsecret"; $result=file_get_contents($api _url); $jsoninfo= Json_decode ($result,true); $jsapiTicket=$jsoninfo["Jsapiticket"]; $argu=Array(); $argu[' appId '] =$appid; $argu[' url '] =$url; $argu[' noncestr '] =$this-Createnoncestr (); $argu[' timestamp '] = Time(); $argu[' jsapi_ticket '] =$jsapiTicket; $string= "jsapi_ticket=".$argu[Jsapi_ticket]. " &noncestr= ".$argu[Noncestr]. " ×tamp= ".$argu[timestamp]. " &url= ".$argu[url]; $argu[' signature '] =SHA1(Trim($string)); return $argu; }
JS Share function