minio文件地址签名功能(使用签名地址):
签章图片处理,桌面设计主页的图片显示地址
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
:key="data.renderKey"
|
||||
>
|
||||
<div class="item" v-for="(item, index) in data.dataSource" :key="index">
|
||||
<div class="image"><img :src="item.backgroundUrl" /></div>
|
||||
<div class="image"><img :src="item.backgroundUrlFixed || item.backgroundUrl" /></div>
|
||||
<div class="edit" @click.stop="handleEdit(item.id)">{{ t('设计') }}</div>
|
||||
<div class="mark">
|
||||
<a-switch
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
align: 'left',
|
||||
customRender: ({ record }) => {
|
||||
return h(Image, {
|
||||
src: record.fileUrl,
|
||||
src: record.fileUrlFixed,
|
||||
width: '60px',
|
||||
height: '22px',
|
||||
});
|
||||
|
||||
@ -190,10 +190,13 @@
|
||||
onMounted(async () => {
|
||||
if (props.id) {
|
||||
data.info = { ...defaultInfo, ...cloneDeep(props.info) };
|
||||
// 回显时使用fileUrlFixed(如果有),否则使用fileUrl(改了)
|
||||
const displayUrl = props.info.fileUrlFixed || props.info.fileUrl;
|
||||
|
||||
if (data.info.fileType === StampFileTypeAttributes.UPLOAD_PICTURES) {
|
||||
data.photoUrl = data.info.fileUrl;
|
||||
data.photoUrl = displayUrl; // 显示用
|
||||
} else {
|
||||
data.signUrl = data.info.fileUrl;
|
||||
data.signUrl = displayUrl; // 显示用
|
||||
}
|
||||
} else {
|
||||
data.info = defaultInfo;
|
||||
@ -221,9 +224,13 @@
|
||||
data.info.fileUrl = base64;
|
||||
const blob = dataURLtoBlob(base64);
|
||||
|
||||
const fileUrl = await uploadBlobApi(blob, t('手写签名.png'));
|
||||
if (fileUrl) {
|
||||
data.signUrl = fileUrl;
|
||||
const response = await uploadBlobApi(blob, t('手写签名.png'));
|
||||
if (response) {
|
||||
// 存储原始URL到info.fileUrl(用于提交)(改了)
|
||||
data.info.fileUrl = response.fileUrl;
|
||||
|
||||
// 显示使用fileUrlFixed(如果有),否则使用fileUrl(改了)
|
||||
data.signUrl = response.fileUrlFixed || response.fileUrl;
|
||||
message.success(t('手写签章上传成功'));
|
||||
} else {
|
||||
message.error(t('手写签章上传失败'));
|
||||
@ -283,7 +290,11 @@
|
||||
if (info.file && info.file.response && info.file.response.code == 0) {
|
||||
message.success(t(`{name}上传成功!`, { name: info.file.name }));
|
||||
console.log(info, t('上传成功'));
|
||||
data.photoUrl = info.file.response.data.fileUrl;
|
||||
// 存储原始URL到info.fileUrl(用于提交)(改了)
|
||||
data.info.fileUrl = info.file.response.data.fileUrl;
|
||||
|
||||
// 显示使用fileUrlFixed(如果有),否则使用fileUrl (改了)
|
||||
data.photoUrl = info.file.response.data.fileUrlFixed || info.file.response.data.fileUrl;
|
||||
} else {
|
||||
message.error(t('上传照片失败'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user