From 47357dc26619698b2c1b1ae38b080ba372b9a833 Mon Sep 17 00:00:00 2001 From: carsonxu <459452372@qq.com> Date: Wed, 7 Nov 2018 16:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6dd257..fe95537 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,20 @@ var cos = new COS({ getAuthorization: function (options, callback) { // 异步获取签名 wx.request({ -            url: 'https://example.com/sign', // 步骤二提供的签名接口 +            url: 'https://example.com/server/sts.php', // 步骤二提供的签名接口            data: { Method: options.Method,                Key: options.Key }, dataType: 'text', success: function (result) { - callback(result.data); + var data = result.data; + callback({ + TmpSecretId: data.credentials && data.credentials.tmpSecretId, + TmpSecretKey: data.credentials && data.credentials.tmpSecretKey, + XCosSecurityToken: data.credentials && data.credentials.sessionToken, + ExpiredTime: data.expiredTime, + }); } }); }