From 62d4432c006c781798d37d0d123f3a69298878cf Mon Sep 17 00:00:00 2001 From: kils Date: Wed, 24 Apr 2024 17:06:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=98=E5=82=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8F=8A=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 菜单管理功能优化: 1、建议组件名称tag可点击快捷输入 2、目录类型外链无意义,隐藏 --- src/views/system/menu/MenuAddModal.vue | 30 +++++++++++--------- src/views/system/storage/StorageAddModal.vue | 12 ++------ src/views/system/storage/type.ts | 1 - 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/views/system/menu/MenuAddModal.vue b/src/views/system/menu/MenuAddModal.vue index 363c1fd..6a40e64 100644 --- a/src/views/system/menu/MenuAddModal.vue +++ b/src/views/system/menu/MenuAddModal.vue @@ -50,7 +50,7 @@ @@ -65,18 +65,6 @@ - - - - - + + + + + @@ -188,6 +188,10 @@ const formRules = computed(() => { } }) +const inputRouteName = () => { + form.name = routeName.value +} + // 切换类型清除校验 const onChangeType = () => { formRef.value?.clearValidate() diff --git a/src/views/system/storage/StorageAddModal.vue b/src/views/system/storage/StorageAddModal.vue index 7fbfa4c..5d64308 100644 --- a/src/views/system/storage/StorageAddModal.vue +++ b/src/views/system/storage/StorageAddModal.vue @@ -100,7 +100,6 @@ const { width } = useWindowSize() const { storage_type_enum } = useDict('storage_type_enum') const dataId = ref('') -const updatedSecretKey = ref(false) const isUpdate = computed(() => !!dataId.value) const title = computed(() => (isUpdate.value ? '修改存储' : '新增存储')) const formRef = ref() @@ -120,7 +119,6 @@ const { form, resetForm } = useForm({ code: '', type: 2, accessKey: undefined, - secretKeyEncrypted: undefined, secretKey: undefined, endpoint: undefined, bucketName: undefined, @@ -154,18 +152,14 @@ const onUpdate = async (id: string) => { visible.value = true } -const updateSecretKey = () => { - updatedSecretKey.value = true -} - // 保存 const save = async () => { try { const isInvalid = await formRef.value?.validate() if (isInvalid) return false - const data = Object.assign({}, form) - if (data.type === 1) { - data.secretKey = updatedSecretKey.value ? encryptByRsa(form.secretKey) : form.secretKeyEncrypted + const data = { + ...form, + secretKey: form.type === 1 && !form.secretKey.includes('*') ? encryptByRsa(form.secretKey) : null } if (isUpdate.value) { await updateStorage(data, dataId.value) diff --git a/src/views/system/storage/type.ts b/src/views/system/storage/type.ts index b315798..d329730 100644 --- a/src/views/system/storage/type.ts +++ b/src/views/system/storage/type.ts @@ -4,7 +4,6 @@ export interface StorageReq { type: number accessKey: string secretKey: string - secretKeyEncrypted: string endpoint: string bucketName: string domain: string