From 8603d4347be2092490e535c96243a259c1167ef1 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:56:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mysql=20root=20=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9A=8F=E6=9C=BA=E5=92=8C=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20(#556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/mysql/root-password/index.vue | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/database/mysql/root-password/index.vue b/frontend/src/views/database/mysql/root-password/index.vue index fc84c6272..6a04929ac 100644 --- a/frontend/src/views/database/mysql/root-password/index.vue +++ b/frontend/src/views/database/mysql/root-password/index.vue @@ -7,7 +7,12 @@ - + + + @@ -38,6 +43,7 @@ import ConfirmDialog from '@/components/confirm-dialog/index.vue'; import { GetAppPassword } from '@/api/modules/app'; import DrawerHeader from '@/components/drawer-header/index.vue'; import { MsgSuccess } from '@/utils/message'; +import { getRandomStr } from '@/utils/util'; const loading = ref(false); @@ -57,6 +63,20 @@ const acceptParams = (): void => { dialogVisiable.value = true; }; +const random = async () => { + form.password = getRandomStr(16); +}; + +const copy = async () => { + let input = document.createElement('input'); + input.value = form.password; + document.body.appendChild(input); + input.select(); + document.execCommand('Copy'); + document.body.removeChild(input); + MsgSuccess(i18n.global.t('commons.msg.copySuccess')); +}; + const handleClose = () => { dialogVisiable.value = false; };