Skip to content

Commit

Permalink
Merge pull request #57 from livehigh/feat/1.1.2
Browse files Browse the repository at this point in the history
Feat/1.1.2
  • Loading branch information
carsonxu authored Dec 1, 2021
2 parents c88774c + 54e7c31 commit 5fc9dc1
Show file tree
Hide file tree
Showing 11 changed files with 5,849 additions and 5,708 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
1. 把 demo/lib/cos-wx-sdk-v5.js 复制到自己小程序项目代码里,在需要上传文件的地方贴以下代码

```javascript

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

// 初始化实例
Expand Down Expand Up @@ -68,8 +72,10 @@ wx.chooseImage({
});
```

## 说明文档
## 说明文档

[使用例子](demo/demo-sdk.js)

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

其他大部分接口可以参考以下 JS SDK 文档 [接口文档](https://cloud.tencent.com/document/product/436/12260)
[接口文档](https://cloud.tencent.com/document/product/436/31953)
10 changes: 8 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ var config = {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}
]
},
Expand All @@ -66,7 +69,7 @@ if (process.env.NODE_ENV === 'production') {
'demo-album/project.config.json',
]);
config.watch = false;
config.output.filename = 'cos-wx-sdk-v5.js';
config.output.filename = 'cos-wx-sdk-v5.min.js';
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
Expand All @@ -92,7 +95,10 @@ webpack(config, function (err, stats) {
// 每次运行 npm run build,将 sourcePath 代码复制一份放入 targetPath
var sourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.js');
var targetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.js');
var minSourcePath = path.resolve(__dirname, './demo/lib/cos-wx-sdk-v5.min.js');
var mintTargetPath = path.resolve(__dirname, './demo-album/lib/cos-wx-sdk-v5.min.js');
fs.createReadStream(sourcePath).pipe(fs.createWriteStream(targetPath));
fs.createReadStream(minSourcePath).pipe(fs.createWriteStream(mintTargetPath));
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
Expand Down
Loading

0 comments on commit 5fc9dc1

Please sign in to comment.