<?php
function A_Auth($filePath,$key,$domain,$expireTime){
$timeStamp = time()+$expireTime;
$sstring = $filePath.'-'.$timeStamp.'-0-0-'.$key;
$md5hash = md5($sstring);
$url = 'http://'.$domain.$filePath.'?auth_key='.$timeStamp.'-0-0-'.$md5hash;
echo $url;
}
//设置URL有效期时长为1小时
$expireTime = 3600;
//点、直播或者CDN加速域名
$domain = '132.pier39.cn';
//鉴权Key
$key = '123ddd';
//文件访问路径,注意这里不需要带参数进来,如果最终访问的URL中有参数,直接拼接在A_Auth返回值后面即可
$filePath = '/1.txt';
A_Auth($filePath,$key,$domain,$expireTime);
?>