Merge pull request '修复个人中心头像上传bug' (#124) from 616036448/Admin.NET.Pro:main into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/124
This commit is contained in:
commit
f0b4368952
@ -219,6 +219,7 @@ watch(state.signOptions, () => {
|
|||||||
const uploadCropperImg = async (e: any) => {
|
const uploadCropperImg = async (e: any) => {
|
||||||
var res = await getAPI(SysFileApi).apiSysFileUploadAvatarPostForm(blobToFile(e.img, userInfos.value.account + '.png'));
|
var res = await getAPI(SysFileApi).apiSysFileUploadAvatarPostForm(blobToFile(e.img, userInfos.value.account + '.png'));
|
||||||
userInfos.value.avatar = getFileUrl(res.data.result!);
|
userInfos.value.avatar = getFileUrl(res.data.result!);
|
||||||
|
state.ruleFormBase.avatar = userInfos.value.avatar;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开电子签名页面
|
// 打开电子签名页面
|
||||||
@ -229,11 +230,14 @@ const openSignDialog = () => {
|
|||||||
// 保存并上传电子签名
|
// 保存并上传电子签名
|
||||||
const saveUploadSign = async () => {
|
const saveUploadSign = async () => {
|
||||||
const { isEmpty, data } = signaturePadRef.value.saveSignature();
|
const { isEmpty, data } = signaturePadRef.value.saveSignature();
|
||||||
if (isEmpty) return;
|
if (isEmpty) {
|
||||||
|
userInfos.value.signature = null;
|
||||||
var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(base64ToFile(data, userInfos.value.account + '.png'));
|
state.ruleFormBase.signature = null;
|
||||||
userInfos.value.signature = getFileUrl(res.data.result!);
|
} 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();
|
clearSign();
|
||||||
state.signDialogVisible = false;
|
state.signDialogVisible = false;
|
||||||
};
|
};
|
||||||
@ -252,6 +256,7 @@ const clearSign = () => {
|
|||||||
const uploadSignFile = async (file: any) => {
|
const uploadSignFile = async (file: any) => {
|
||||||
var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(file.raw);
|
var res = await getAPI(SysFileApi).apiSysFileUploadSignaturePostForm(file.raw);
|
||||||
userInfos.value.signature = res.data.result?.url;
|
userInfos.value.signature = res.data.result?.url;
|
||||||
|
state.ruleFormBase.signature = userInfos.value.signature;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获得电子签名文件列表
|
// 获得电子签名文件列表
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user