From 188a3e0ac5042756e10c48d865c73cb9b336ef2f Mon Sep 17 00:00:00 2001
From: ssongliu <73214554+ssongliu@users.noreply.github.com>
Date: Mon, 10 Apr 2023 11:52:15 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=9B?=
=?UTF-8?q?=E5=BB=BA=E6=94=AF=E6=8C=81=E9=9A=8F=E6=9C=BA=E5=AF=86=E7=A0=81?=
=?UTF-8?q?=20(#555)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/views/database/mysql/create/index.vue | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/frontend/src/views/database/mysql/create/index.vue b/frontend/src/views/database/mysql/create/index.vue
index 96b883e2c..680dc63ea 100644
--- a/frontend/src/views/database/mysql/create/index.vue
+++ b/frontend/src/views/database/mysql/create/index.vue
@@ -23,7 +23,11 @@
-
+
+
+
+
+
@@ -64,6 +68,7 @@ import { ElForm } from 'element-plus';
import { addMysqlDB } from '@/api/modules/database';
import DrawerHeader from '@/components/drawer-header/index.vue';
import { MsgSuccess } from '@/utils/message';
+import { getRandomStr } from '@/utils/util';
const loading = ref();
const createVisiable = ref(false);
@@ -95,16 +100,20 @@ const acceptParams = (params: DialogProps): void => {
form.mysqlName = params.mysqlName;
form.format = 'utf8mb4';
form.username = '';
- form.password = '';
form.permission = '%';
form.permissionIPs = '';
form.description = '';
+ random();
createVisiable.value = true;
};
const handleClose = () => {
createVisiable.value = false;
};
+const random = async () => {
+ form.password = getRandomStr(16);
+};
+
const emit = defineEmits<{ (e: 'search'): void }>();
const onSubmit = async (formEl: FormInstance | undefined) => {
if (!formEl) return;