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; }; // 获得电子签名文件列表