修复个人中心头像上传bug
This commit is contained in:
parent
6a5d016235
commit
73bd92d9e2
@ -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;
|
||||
};
|
||||
|
||||
// 获得电子签名文件列表
|
||||
|
||||
Loading…
Reference in New Issue
Block a user