From 876a4a311db4395f7dbed3f4e8aacfa77ee8dba8 Mon Sep 17 00:00:00 2001 From: VK <370725567@qq.com> Date: Fri, 8 Dec 2023 19:59:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=A9=E5=B1=95=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=9A=84=E5=9F=9F=E5=90=8D=E8=87=AA=E5=8A=A8=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E7=A9=BA=E9=97=B4provider=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cloudfunctions/ext-storage-co/index.obj.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js b/uniCloud-aliyun/cloudfunctions/ext-storage-co/index.obj.js index bb817d7..ff21548 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, // 前端传过来的文件路径 -- GitLab