Skip to content

Commit

Permalink
fix:修复已知问题
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh committed Sep 1, 2022
1 parent f712b16 commit d1a433f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
10 changes: 6 additions & 4 deletions demo-album/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -6450,7 +6450,7 @@ module.exports = function(module) {
/*! exports provided: name, version, description, main, scripts, repository, author, license, dependencies, devDependencies, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.4.0\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"mime\":\"^2.4.6\",\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"babel-core\":\"6.26.3\",\"babel-loader\":\"8.2.5\",\"@babel/preset-env\":\"7.16.11\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");
module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.4.1\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"mime\":\"^2.4.6\",\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"babel-core\":\"6.26.3\",\"babel-loader\":\"8.2.5\",\"@babel/preset-env\":\"7.16.11\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");

/***/ }),

Expand Down Expand Up @@ -10922,6 +10922,7 @@ function multipartList(params, callback) {

function multipartListPart(params, callback) {
var reqParams = {};
var tracker = params.tracker;
reqParams['uploadId'] = params['UploadId'];
reqParams['encoding-type'] = params['EncodingType'];
reqParams['max-parts'] = params['MaxParts'];
Expand All @@ -10933,7 +10934,8 @@ function multipartListPart(params, callback) {
Region: params.Region,
Key: params.Key,
headers: params.Headers,
qs: reqParams
qs: reqParams,
tracker: tracker
}, function (err, data) {
if (err) {
tracker && tracker.parent && tracker.parent.setParams({
Expand Down Expand Up @@ -11765,9 +11767,9 @@ function _submitRequest(params, callback) {
self.options.ForcePathStyle && (opt.pathStyle = self.options.ForcePathStyle);
self.emit('before-send', opt);
var useAccelerate = opt.url.includes('accelerate.');
var queryString = Object.keys(opt.qs).map(function (key) {
var queryString = opt.qs ? Object.keys(opt.qs).map(function (key) {
return "".concat(key, "=").concat(opt.qs[key]);
}).join('&');
}).join('&') : '';
var fullUrl = queryString ? opt.url + '?' + queryString : opt.url;
params.tracker && params.tracker.setParams({
reqUrl: fullUrl,
Expand Down
4 changes: 2 additions & 2 deletions demo-album/lib/cos-wx-sdk-v5.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions demo/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -6450,7 +6450,7 @@ module.exports = function(module) {
/*! exports provided: name, version, description, main, scripts, repository, author, license, dependencies, devDependencies, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.4.0\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"mime\":\"^2.4.6\",\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"babel-core\":\"6.26.3\",\"babel-loader\":\"8.2.5\",\"@babel/preset-env\":\"7.16.11\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");
module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.4.1\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"mime\":\"^2.4.6\",\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"babel-core\":\"6.26.3\",\"babel-loader\":\"8.2.5\",\"@babel/preset-env\":\"7.16.11\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");

/***/ }),

Expand Down Expand Up @@ -10922,6 +10922,7 @@ function multipartList(params, callback) {

function multipartListPart(params, callback) {
var reqParams = {};
var tracker = params.tracker;
reqParams['uploadId'] = params['UploadId'];
reqParams['encoding-type'] = params['EncodingType'];
reqParams['max-parts'] = params['MaxParts'];
Expand All @@ -10933,7 +10934,8 @@ function multipartListPart(params, callback) {
Region: params.Region,
Key: params.Key,
headers: params.Headers,
qs: reqParams
qs: reqParams,
tracker: tracker
}, function (err, data) {
if (err) {
tracker && tracker.parent && tracker.parent.setParams({
Expand Down Expand Up @@ -11765,9 +11767,9 @@ function _submitRequest(params, callback) {
self.options.ForcePathStyle && (opt.pathStyle = self.options.ForcePathStyle);
self.emit('before-send', opt);
var useAccelerate = opt.url.includes('accelerate.');
var queryString = Object.keys(opt.qs).map(function (key) {
var queryString = opt.qs ? Object.keys(opt.qs).map(function (key) {
return "".concat(key, "=").concat(opt.qs[key]);
}).join('&');
}).join('&') : '';
var fullUrl = queryString ? opt.url + '?' + queryString : opt.url;
params.tracker && params.tracker.setParams({
reqUrl: fullUrl,
Expand Down
4 changes: 2 additions & 2 deletions demo/lib/cos-wx-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-wx-sdk-v5",
"version": "1.4.0",
"version": "1.4.1",
"description": "小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)",
"main": "demo/lib/cos-wx-sdk-v5.min.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2800,6 +2800,7 @@ function multipartList(params, callback) {
*/
function multipartListPart(params, callback) {
var reqParams = {};
var tracker = params.tracker;

reqParams['uploadId'] = params['UploadId'];
reqParams['encoding-type'] = params['EncodingType'];
Expand All @@ -2814,6 +2815,7 @@ function multipartListPart(params, callback) {
Key: params.Key,
headers: params.Headers,
qs: reqParams,
tracker: tracker,
}, function (err, data) {
if (err) {
tracker && tracker.parent && tracker.parent.setParams({ errorNode: 'multipartListPart' });
Expand Down Expand Up @@ -3578,7 +3580,7 @@ function _submitRequest(params, callback) {
self.options.ForcePathStyle && (opt.pathStyle = self.options.ForcePathStyle);
self.emit('before-send', opt);
var useAccelerate = opt.url.includes('accelerate.');
var queryString = Object.keys(opt.qs).map(key => `${key}=${opt.qs[key]}`).join('&');
var queryString = opt.qs ? Object.keys(opt.qs).map(key => `${key}=${opt.qs[key]}`).join('&') : '';
var fullUrl = queryString ? (opt.url + '?' + queryString) : opt.url;
params.tracker && params.tracker.setParams({ reqUrl: fullUrl, accelerate: useAccelerate ? 'Y' : 'N' });
// 分块上传时给父级tracker设置url信息
Expand Down

0 comments on commit d1a433f

Please sign in to comment.