public function getapiSignature()
{
$access_token=S('access_token');
//先查询缓存中是否存在
if($access_token)
{
$accesstoken=$access_token;
}
else//不存在则调用函数生成,并建立新的缓存
{
$accesstoken=getAccessToken($this->appid,$this->appsecret);
S('access_token',$accesstoken,7200);
}
$apiticket=S('ticket');
if($apiticket)
{
$ticket=$apiticket;
}else
{
$ticket=getTicket($accesstoken);
S('ticket',$ticket,7200);
}
$cur_url="http://www.dqiu.net/rentout";
$apisignature=S('signature');
if($apisignature)
{
$signature=$apisignature;
}else
{
$signature=getSignature($ticket,$this->nonce,$this->timestamp,$cur_url);
S('signature',$signature,7200);
}
return $signature;
}