diff --git a/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js b/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js index bb817d7f8b46a0c4cc0f905944472d954f429ab2..ff215484fcc88533cb03cd713cda878fff148608 100644 --- a/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js +++ b/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js @@ -1,7 +1,13 @@ // 扩展存储自定义域名 -const domain = "qiniu01.dcloud.net.cn"; + +var domain; // 如果只有一个域名,域名可以直接写在这里 module.exports = { - _before() {}, + _before() { + if (!domain) { + const provider = uniCloud.getCloudInfos()[0].provider; + domain = `hello-ext-storage-${provider}.dcloud.net.cn`; + } + }, getUploadFileOptions(data = {}) { let { cloudPath, // 前端传过来的文件路径