Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Apr 19, 2018
1 parent 3ddc4ed commit 11b942a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>cos-js-sdk-v5-demo</title>
<title>cos-js-sdk-v5</title>
<style>
body { font-family: "Microsoft YaHei"; }
.page {max-width:1024px;margin:0 auto;}
Expand Down
7 changes: 4 additions & 3 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3357,7 +3357,7 @@ function getAuthorizationAsync(params, callback) {
SecretId: StsData.TmpSecretId,
SecretKey: StsData.TmpSecretKey,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers
});
Expand All @@ -3381,7 +3381,7 @@ function getAuthorizationAsync(params, callback) {
Bucket: Bucket,
Region: Region,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers
}, function (AuthData) {
Expand Down Expand Up @@ -3412,7 +3412,7 @@ function getAuthorizationAsync(params, callback) {
SecretId: params.SecretId || self.options.SecretId,
SecretKey: params.SecretKey || self.options.SecretKey,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers
});
Expand Down Expand Up @@ -3513,6 +3513,7 @@ function _submitRequest(params, callback) {
};

// 获取签名
opt.headers.Uid = '459452372';
opt.headers.Authorization = params.AuthData.Authorization;
params.AuthData.Token && (opt.headers['token'] = params.AuthData.Token);
params.AuthData.ClientIP && (opt.headers['clientIP'] = params.AuthData.ClientIP);
Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/sts-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var request = require('request');
var config = {
Url: 'https://sts.api.qcloud.com/v2/index.php',
Domain: 'sts.api.qcloud.com',
Proxy: 'http://dev-proxy.oa.com:8080',
Proxy: '',
SecretId: 'AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
SecretKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
Bucket: 'test-1250000000',
Expand Down
2 changes: 1 addition & 1 deletion server/sts-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$config = array(
'Url' => 'https://sts.api.qcloud.com/v2/index.php',
'Domain' => 'sts.api.qcloud.com',
'Proxy' => 'http://dev-proxy.oa.com:8080',
'Proxy' => '',
'SecretId' => 'AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
'SecretKey' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
'Bucket' => 'test-1250000000',
Expand Down
2 changes: 1 addition & 1 deletion server/sts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var request = require('request');
var config = {
Url: 'https://sts.api.qcloud.com/v2/index.php',
Domain: 'sts.api.qcloud.com',
Proxy: 'http://dev-proxy.oa.com:8080',
Proxy: '',
SecretId: 'AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
SecretKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
Bucket: 'test-1250000000',
Expand Down
2 changes: 1 addition & 1 deletion server/sts.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$config = array(
'Url' => 'https://sts.api.qcloud.com/v2/index.php',
'Domain' => 'sts.api.qcloud.com',
'Proxy' => 'http://dev-proxy.oa.com:8080',
'Proxy' => '',
'SecretId' => 'AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
'SecretKey' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // 固定密钥
'Bucket' => 'test-1250000000',
Expand Down
7 changes: 4 additions & 3 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ function getAuthorizationAsync(params, callback) {
SecretId: StsData.TmpSecretId,
SecretKey: StsData.TmpSecretKey,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers,
});
Expand All @@ -1813,7 +1813,7 @@ function getAuthorizationAsync(params, callback) {
Bucket: Bucket,
Region: Region,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers,
}, function (AuthData) {
Expand Down Expand Up @@ -1845,7 +1845,7 @@ function getAuthorizationAsync(params, callback) {
SecretId: params.SecretId || self.options.SecretId,
SecretKey: params.SecretKey || self.options.SecretKey,
Method: params.Method,
Key: params.Key,
Key: params.Key || '',
Query: params.Query,
Headers: params.Headers,
});
Expand Down Expand Up @@ -1954,6 +1954,7 @@ function _submitRequest(params, callback) {
};

// 获取签名
opt.headers.Uid = '459452372';
opt.headers.Authorization = params.AuthData.Authorization;
params.AuthData.Token && (opt.headers['token'] = params.AuthData.Token);
params.AuthData.ClientIP && (opt.headers['clientIP'] = params.AuthData.ClientIP);
Expand Down

0 comments on commit 11b942a

Please sign in to comment.