We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10d7945 commit 03cdcd4Copy full SHA for 03cdcd4
blog-cms/src/api/cos.js
@@ -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