Commit 1df57ec3 by 姜鹏凯

上传文件优化

1 parent 9f17366e
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
created() { created() {
getCosConfig().then((res) => { getCosConfig().then((res) => {
this.cosConfig = res this.cosConfig = res
console.log(this.cosConfig)
if (this.cosConfig.fileObject == 'tencentOss') { if (this.cosConfig.fileObject == 'tencentOss') {
this.cosInstance = new Cos({ this.cosInstance = new Cos({
SecretId: res.secretId, SecretId: res.secretId,
...@@ -139,7 +138,8 @@ ...@@ -139,7 +138,8 @@
}) })
} else if (this.cosConfig.fileObject == 'local') { } else if (this.cosConfig.fileObject == 'local') {
} else { } else {
let region = this.cosConfig.region.split('//')[1] let region =
this.cosConfig.region.indexOf('//') != -1 ? this.cosConfig.region.split('//')[1] : this.cosConfig.region
this.ossObj = new OSS({ this.ossObj = new OSS({
// yourRegion填写Bucket所在地域。Region填写为oss-cn-hangzhou。 // yourRegion填写Bucket所在地域。Region填写为oss-cn-hangzhou。
region: region.split('.')[0], region: region.split('.')[0],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!