Skip to content

Commit 4529c33

Browse files
committed
fix 客户端上传示例 bug
签名已经更新为新的算法导致
1 parent 5c20070 commit 4529c33

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/client-upload/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$.getJSON('http://localhost:9000/policy.php?save_path=' + save_path, function (data) {
4040
var uploadData = new FormData($('#demoForm')[0]);
4141
uploadData.append('policy', data.policy);
42-
uploadData.append('signature', data.signature);
42+
uploadData.append('authorization', data.authorization);
4343
$.ajax({
4444
url: '//v0.api.upyun.com/sdkimg',
4545
type: 'POST',

examples/client-upload/policy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
$data['save-key'] = $_GET['save_path'];
1111
$data['expiration'] = time() + 120;
1212
$policy = Signature::getFormSignature($config, $data);
13+
$policy['authorization'] = 'UPYUN ' . USER_NAME . ':' . $policy['signature'];
1314
echo json_encode($policy);
1415

1516

0 commit comments

Comments
 (0)