Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ylc.llewan.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
llewan
ylc.llewan.com
Commits
ab1cda92
Commit
ab1cda92
authored
Jan 19, 2019
by
734642908@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试cdn刷新
parent
68d8bff1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
FlushController.class.php
Application/Home/Controller/FlushController.class.php
+7
-3
No files found.
Application/Home/Controller/FlushController.class.php
View file @
ab1cda92
...
...
@@ -70,8 +70,8 @@ class FlushController extends BaseController
}
public
function
cdnUrl
()
{
// $refreshURL = I("post.refresh_url",0
);
$refreshURL
=
"https://res.g.llewan.com/uploadfile/common/qubapikashu-weixin/1.0.1/monsterData.json"
;
$refreshURL
=
I
(
"url"
);
//
$refreshURL = "https://res.g.llewan.com/uploadfile/common/qubapikashu-weixin/1.0.1/monsterData.json";
$url
=
"https://cdn.api.qcloud.com/v2/index.php?"
;
$params
[
'Action'
]
=
"RefreshCdnUrl"
;
$params
[
'Nonce'
]
=
rand
(
1000000000
,
9999999999
);
...
...
@@ -80,11 +80,15 @@ class FlushController extends BaseController
$params
[
'urls.0'
]
=
$refreshURL
;
$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
);
$signStr
=
base64_encode
(
hash_hmac
(
'sha1'
,
$origin
,
$secretKey
,
true
));
$params
[
'Signature'
]
=
$signStr
;
echo
curlPost
(
$url
,
$params
);
exit
;
$cdnRefreshURL
=
$url
.
http_build_query
(
$params
);
$result
=
file_get_contents
(
$cdnRefreshURL
);
echo
(
$result
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment