From 4591e44a624c304286379e9626f52ffde829e231 Mon Sep 17 00:00:00 2001
From: ssongliu <73214554+ssongliu@users.noreply.github.com>
Date: Wed, 10 Jan 2024 16:45:43 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20PostgreSQL=20?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=81=A2=E5=A4=8D=E6=8A=A5=E9=94=99=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=20(#3560)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/upload/index.vue | 38 ++++++++++++++----------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/frontend/src/components/upload/index.vue b/frontend/src/components/upload/index.vue
index 097a5b097..b6fb0cbb9 100644
--- a/frontend/src/components/upload/index.vue
+++ b/frontend/src/components/upload/index.vue
@@ -21,7 +21,11 @@
:stroke-width="12"
:percentage="uploadPercent"
>
-
+
{{ $t('database.supportUpType') }}
{{ $t('database.zipFormat') }}
@@ -130,20 +134,24 @@ const acceptParams = async (params: DialogProps): Promise => {
remark.value = params.remark;
const pathRes = await loadBaseDir();
- if (type.value === 'mysql') {
- title.value = name.value + ' [ ' + detailName.value + ' ]';
- }
- if (type.value === 'website' || type.value === 'app') {
- title.value = name.value;
- }
- let dir = type.value === 'mysql' || type.value === 'mariadb' ? 'database/' + type.value : type.value;
- if (detailName.value) {
- baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/${detailName.value}/`;
- } else {
- baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/`;
- }
- if (type.value === 'website') {
- baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`;
+ switch (type.value) {
+ case 'mysql':
+ case 'mariadb':
+ case 'postgresql':
+ title.value = name.value + ' [ ' + detailName.value + ' ]';
+ if (detailName.value) {
+ baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/${detailName.value}/`;
+ } else {
+ baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`;
+ }
+ break;
+ case 'website':
+ title.value = name.value;
+ baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`;
+ break;
+ case 'app':
+ title.value = name.value;
+ baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`;
}
upVisible.value = true;
search();