Commit ab1cda92 authored by 734642908@qq.com's avatar 734642908@qq.com

测试cdn刷新

parent 68d8bff1
...@@ -70,8 +70,8 @@ class FlushController extends BaseController ...@@ -70,8 +70,8 @@ class FlushController extends BaseController
} }
public function cdnUrl() { public function cdnUrl() {
// $refreshURL = I("post.refresh_url",0); $refreshURL = I("url");
$refreshURL = "https://res.g.llewan.com/uploadfile/common/qubapikashu-weixin/1.0.1/monsterData.json"; // $refreshURL = "https://res.g.llewan.com/uploadfile/common/qubapikashu-weixin/1.0.1/monsterData.json";
$url = "https://cdn.api.qcloud.com/v2/index.php?"; $url = "https://cdn.api.qcloud.com/v2/index.php?";
$params['Action'] = "RefreshCdnUrl"; $params['Action'] = "RefreshCdnUrl";
$params['Nonce'] = rand(1000000000, 9999999999); $params['Nonce'] = rand(1000000000, 9999999999);
...@@ -80,11 +80,15 @@ class FlushController extends BaseController ...@@ -80,11 +80,15 @@ class FlushController extends BaseController
$params['urls.0'] = $refreshURL; $params['urls.0'] = $refreshURL;
$secretKey = "ZzEJLPOH4mOGKbxGSUTHuMcidMwLZcT9"; $secretKey = "ZzEJLPOH4mOGKbxGSUTHuMcidMwLZcT9";
$origin = "GETcdn.api.qcloud.com/v2/index.php?Action=RefreshCdnUrl&Nonce={$params['Nonce']}&SecretId={$params['SecretId']}&Timestamp={$params['Timestamp']}&urls.0={$refreshURL}"; $origin = "POSTcdn.api.qcloud.com/v2/index.php?Action=RefreshCdnUrl&Nonce={$params['Nonce']}&SecretId={$params['SecretId']}&Timestamp={$params['Timestamp']}";
$origin = str_replace('_', '.', $origin); $origin = str_replace('_', '.', $origin);
$signStr = base64_encode(hash_hmac('sha1', $origin, $secretKey, true)); $signStr = base64_encode(hash_hmac('sha1', $origin, $secretKey, true));
$params['Signature'] = $signStr; $params['Signature'] = $signStr;
echo curlPost($url,$params);exit;
$cdnRefreshURL = $url . http_build_query($params); $cdnRefreshURL = $url . http_build_query($params);
$result = file_get_contents($cdnRefreshURL); $result = file_get_contents($cdnRefreshURL);
echo($result); echo($result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment