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;