Skip to content

Commit 5fc9dc1

Browse files
authored
Merge pull request #57 from livehigh/feat/1.1.2
Feat/1.1.2
2 parents c88774c + 54e7c31 commit 5fc9dc1

File tree

11 files changed

+5849
-5708
lines changed

11 files changed

+5849
-5708
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
1. 把 demo/lib/cos-wx-sdk-v5.js 复制到自己小程序项目代码里,在需要上传文件的地方贴以下代码
1919

2020
```javascript
21+
22+
// 存储桶名称,由bucketname-appid 组成,appid必须填入,可以在COS控制台查看存储桶名称。 https://console.cloud.tencent.com/cos5/bucket
2123
var Bucket = 'test-1250000000';
24+
// 存储桶Region可以在COS控制台指定存储桶的概览页查看 https://console.cloud.tencent.com/cos5/bucket/
25+
// 关于地域的详情见 https://cloud.tencent.com/document/product/436/6224
2226
var Region = 'ap-guangzhou';
2327

2428
// 初始化实例
@@ -68,8 +72,10 @@ wx.chooseImage({
6872
});
6973
```
7074

71-
## 说明文档
75+
## 说明文档
76+
77+
[使用例子](demo/demo-sdk.js)
7278

73-
完整文档有待完善,不支持分片相关接口,上传下载相关方法请查看源码和例子 [使用例子](demo/demo-sdk.js)
79+
[快速入门](https://cloud.tencent.com/document/product/436/31953)
7480

75-
其他大部分接口可以参考以下 JS SDK 文档 [接口文档](https://cloud.tencent.com/document/product/436/12260)
81+
[接口文档](https://cloud.tencent.com/document/product/436/31953)

build.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ var config = {
4545
rules: [
4646
{
4747
test: /\.m?js$/,
48-
exclude: /(node_modules|bower_components)/,
48+
loader: 'babel-loader',
49+
options: {
50+
presets: ['es2015']
51+
}
4952
}
5053
]
5154
},
@@ -66,7 +69,7 @@ if (process.env.NODE_ENV === 'production') {
6669
'demo-album/project.config.json',
6770
]);
6871
config.watch = false;
69-
config.output.filename = 'cos-wx-sdk-v5.js';
72+
config.output.filename = 'cos-wx-sdk-v5.min.js';
7073
config.plugins = (config.plugins || []).concat([
7174
new webpack.DefinePlugin({
7275
'process.env': {
@@ -92,7 +95,10 @@ webpack(config, function (err, stats) {
9295
// 每次运行 npm run build,将 sourcePath 代码复制一份放入 targetPath
9396
var sourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.js');
9497
var targetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.js');
98+
var minSourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.min.js');
99+
var mintTargetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.min.js');
95100
fs.createReadStream(sourcePath).pipe(fs.createWriteStream(targetPath));
101+
fs.createReadStream(minSourcePath).pipe(fs.createWriteStream(mintTargetPath));
96102
if (err) throw err
97103
process.stdout.write(stats.toString({
98104
colors: true,

0 commit comments

Comments
 (0)