mirror of https://github.com/halo-dev/halo-admin
encode (#568)
parent
dfd445f976
commit
2e3959bd12
|
@ -63,7 +63,7 @@
|
|||
</template>
|
||||
<span slot="title">
|
||||
普通链接:
|
||||
<a-button class="!p-0" type="link" @click="handleCopyLink(`${encodeURI(attachment.path)}`)">
|
||||
<a-button class="!p-0" type="link" @click="handleCopyLink(`${attachment.path}`)">
|
||||
<a-icon type="copy" />
|
||||
</a-button>
|
||||
</span>
|
||||
|
@ -74,11 +74,7 @@
|
|||
<span slot="description"></span>
|
||||
<span slot="title">
|
||||
Markdown 格式:
|
||||
<a-button
|
||||
class="!p-0"
|
||||
type="link"
|
||||
@click="handleCopyLink(`})`)"
|
||||
>
|
||||
<a-button class="!p-0" type="link" @click="handleCopyLink(``)">
|
||||
<a-icon type="copy" />
|
||||
</a-button>
|
||||
</span>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
||||
<span
|
||||
v-else
|
||||
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }"
|
||||
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
|
||||
class="attachments-group-item-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
@ -259,7 +259,7 @@ export default {
|
|||
return []
|
||||
}
|
||||
return this.list.selected.map(item => {
|
||||
return `})`
|
||||
return ``
|
||||
})
|
||||
},
|
||||
htmlSyntaxList() {
|
||||
|
@ -267,7 +267,7 @@ export default {
|
|||
return []
|
||||
}
|
||||
return this.list.selected.map(item => {
|
||||
return `<img src="${encodeURI(item.path)}" alt="${item.name}">`
|
||||
return `<img src="${item.path}" alt="${item.name}">`
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -378,8 +378,8 @@ export default {
|
|||
if (!this.multiSelect) {
|
||||
this.$emit('confirm', {
|
||||
raw: [attachment],
|
||||
markdown: [`})`],
|
||||
html: [`<img src="${encodeURI(attachment.path)}" alt="${attachment.name}">`]
|
||||
markdown: [``],
|
||||
html: [`<img src="${attachment.path}" alt="${attachment.name}">`]
|
||||
})
|
||||
this.modalVisible = false
|
||||
return
|
||||
|
|
|
@ -69,7 +69,7 @@ export default {
|
|||
const attachment = response.data
|
||||
resolve({
|
||||
name: attachment.name,
|
||||
path: encodeURI(attachment.path)
|
||||
path: attachment.path
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
|
|
|
@ -52,7 +52,7 @@ export default {
|
|||
},
|
||||
handleSelectAttachment({ raw }) {
|
||||
if (raw.length) {
|
||||
this.$emit('input', encodeURI(raw[0].path))
|
||||
this.$emit('input', raw[0].path)
|
||||
}
|
||||
},
|
||||
focus() {
|
||||
|
|
|
@ -457,7 +457,7 @@ export default {
|
|||
*/
|
||||
handleSelectPostThumbnail({ raw }) {
|
||||
if (raw.length) {
|
||||
this.form.model.thumbnail = encodeURI(raw[0].path)
|
||||
this.form.model.thumbnail = raw[0].path
|
||||
}
|
||||
this.attachmentSelectVisible = false
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
||||
<span
|
||||
v-else
|
||||
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }"
|
||||
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
|
||||
class="attachments-group-item-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
|
|
@ -405,7 +405,7 @@ export default {
|
|||
*/
|
||||
handleSelectSheetThumbnail({ raw }) {
|
||||
if (raw.length) {
|
||||
this.form.model.thumbnail = encodeURI(raw[0].path)
|
||||
this.form.model.thumbnail = raw[0].path
|
||||
}
|
||||
this.attachmentSelectVisible = false
|
||||
},
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
>
|
||||
<div class="photo-thumb photos-group-item">
|
||||
<span
|
||||
:style="{ backgroundImage: `url('${encodeURI(item.thumbnail)}')` }"
|
||||
:style="{ backgroundImage: `url('${item.thumbnail}')` }"
|
||||
class="photos-group-item-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
|
|
@ -151,8 +151,8 @@ export default {
|
|||
handleAttachmentSelected({ raw }) {
|
||||
if (raw.length) {
|
||||
const { path, thumbPath, name } = raw[0]
|
||||
this.$set(this.form.model, 'url', encodeURI(path))
|
||||
this.$set(this.form.model, 'thumbnail', encodeURI(thumbPath))
|
||||
this.$set(this.form.model, 'url', path)
|
||||
this.$set(this.form.model, 'thumbnail', thumbPath)
|
||||
this.$set(this.form.model, 'name', name)
|
||||
}
|
||||
this.attachmentSelectModal.visible = false
|
||||
|
|
Loading…
Reference in New Issue