From 73bd92d9e2247652d8a9f272c56a7a9a77f9f1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BD=BB=E9=A3=8E2016?= <616036448@qq.com> Date: Wed, 4 Sep 2024 11:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=A4=B4=E5=83=8F=E4=B8=8A=E4=BC=A0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/user/component/userCenter.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Web/src/views/system/user/component/userCenter.vue b/Web/src/views/system/user/component/userCenter.vue index da71f31c..2bf241e5 100644 --- a/Web/src/views/system/user/component/userCenter.vue +++ b/Web/src/views/system/user/component/userCenter.vue @@ -219,6 +219,7 @@ watch(state.signOptions, () => { const uploadCropperImg = async (e: any) => { var res = await getAPI(SysFileApi).apiSysFileUploadAvatarPostForm(blobToFile(e.img, userInfos.value.account + '.png')); userInfos.value.avatar = getFileUrl(res.data.result!); + state.ruleFormBase.avatar = userInfos.value.avatar; }; // 打开电子签名页面 @@ -229,11 +230,14 @@ const openSignDialog = () => { // 保存并上传电子签名 const saveUploadSign = async () => { const { isEmpty, data } = signaturePadRef.value.saveSignature(); - if (isEmpty) return; - - var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(base64ToFile(data, userInfos.value.account + '.png')); - userInfos.value.signature = getFileUrl(res.data.result!); - + if (isEmpty) { + userInfos.value.signature = null; + state.ruleFormBase.signature = null; + } else { + var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(base64ToFile(data, userInfos.value.account + '.png')); + userInfos.value.signature = getFileUrl(res.data.result!); + state.ruleFormBase.signature = userInfos.value.signature; + } clearSign(); state.signDialogVisible = false; }; @@ -252,6 +256,7 @@ const clearSign = () => { const uploadSignFile = async (file: any) => { var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(file.raw); userInfos.value.signature = res.data.result?.url; + state.ruleFormBase.signature = userInfos.value.signature; }; // 获得电子签名文件列表