Skip to content

Commit 03cdcd4

Browse files
committed
新增腾讯云图库(最终修改)
1 parent 10d7945 commit 03cdcd4

File tree

2 files changed

+403
-0
lines changed

2 files changed

+403
-0
lines changed

blog-cms/src/api/cos.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import COS from 'cos-js-sdk-v5';
2+
3+
// todo 该cos只初始化一次,待优化
4+
// 未配置的情况下,点击腾讯云界面会报错, 请在配置后刷新页面
5+
const txyunConfig = JSON.parse(localStorage.getItem('txyunConfig'))
6+
console.log("cos配置:",txyunConfig)
7+
const cos = new COS({
8+
SecretId: txyunConfig.secretId,
9+
SecretKey: txyunConfig.secretKey,
10+
});
11+
12+
export default cos;

0 commit comments

Comments
 (0)