pull/571/head
零殇_Fanzero 2022-05-18 10:40:09 +08:00 committed by GitHub
parent dfd445f976
commit 2e3959bd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 19 deletions

View File

@ -63,7 +63,7 @@
</template> </template>
<span slot="title"> <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-icon type="copy" />
</a-button> </a-button>
</span> </span>
@ -74,11 +74,7 @@
<span slot="description">![{{ attachment.name }}]({{ attachment.path }})</span> <span slot="description">![{{ attachment.name }}]({{ attachment.path }})</span>
<span slot="title"> <span slot="title">
Markdown 格式 Markdown 格式
<a-button <a-button class="!p-0" type="link" @click="handleCopyLink(`![${attachment.name}](${attachment.path})`)">
class="!p-0"
type="link"
@click="handleCopyLink(`![${attachment.name}](${encodeURI(attachment.path)})`)"
>
<a-icon type="copy" /> <a-icon type="copy" />
</a-button> </a-button>
</span> </span>

View File

@ -72,7 +72,7 @@
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span> <span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
<span <span
v-else v-else
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }" :style="{ backgroundImage: `url('${item.thumbPath}')` }"
class="attachments-group-item-img" class="attachments-group-item-img"
loading="lazy" loading="lazy"
/> />
@ -259,7 +259,7 @@ export default {
return [] return []
} }
return this.list.selected.map(item => { return this.list.selected.map(item => {
return `![${item.name}](${encodeURI(item.path)})` return `![${item.name}](${item.path})`
}) })
}, },
htmlSyntaxList() { htmlSyntaxList() {
@ -267,7 +267,7 @@ export default {
return [] return []
} }
return this.list.selected.map(item => { 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) { if (!this.multiSelect) {
this.$emit('confirm', { this.$emit('confirm', {
raw: [attachment], raw: [attachment],
markdown: [`![${attachment.name}](${encodeURI(attachment.path)})`], markdown: [`![${attachment.name}](${attachment.path})`],
html: [`<img src="${encodeURI(attachment.path)}" alt="${attachment.name}">`] html: [`<img src="${attachment.path}" alt="${attachment.name}">`]
}) })
this.modalVisible = false this.modalVisible = false
return return

View File

@ -69,7 +69,7 @@ export default {
const attachment = response.data const attachment = response.data
resolve({ resolve({
name: attachment.name, name: attachment.name,
path: encodeURI(attachment.path) path: attachment.path
}) })
}) })
.catch(e => { .catch(e => {

View File

@ -52,7 +52,7 @@ export default {
}, },
handleSelectAttachment({ raw }) { handleSelectAttachment({ raw }) {
if (raw.length) { if (raw.length) {
this.$emit('input', encodeURI(raw[0].path)) this.$emit('input', raw[0].path)
} }
}, },
focus() { focus() {

View File

@ -457,7 +457,7 @@ export default {
*/ */
handleSelectPostThumbnail({ raw }) { handleSelectPostThumbnail({ raw }) {
if (raw.length) { if (raw.length) {
this.form.model.thumbnail = encodeURI(raw[0].path) this.form.model.thumbnail = raw[0].path
} }
this.attachmentSelectVisible = false this.attachmentSelectVisible = false
}, },

View File

@ -85,7 +85,7 @@
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span> <span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
<span <span
v-else v-else
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }" :style="{ backgroundImage: `url('${item.thumbPath}')` }"
class="attachments-group-item-img" class="attachments-group-item-img"
loading="lazy" loading="lazy"
/> />

View File

@ -405,7 +405,7 @@ export default {
*/ */
handleSelectSheetThumbnail({ raw }) { handleSelectSheetThumbnail({ raw }) {
if (raw.length) { if (raw.length) {
this.form.model.thumbnail = encodeURI(raw[0].path) this.form.model.thumbnail = raw[0].path
} }
this.attachmentSelectVisible = false this.attachmentSelectVisible = false
}, },

View File

@ -77,7 +77,7 @@
> >
<div class="photo-thumb photos-group-item"> <div class="photo-thumb photos-group-item">
<span <span
:style="{ backgroundImage: `url('${encodeURI(item.thumbnail)}')` }" :style="{ backgroundImage: `url('${item.thumbnail}')` }"
class="photos-group-item-img" class="photos-group-item-img"
loading="lazy" loading="lazy"
/> />

View File

@ -151,8 +151,8 @@ export default {
handleAttachmentSelected({ raw }) { handleAttachmentSelected({ raw }) {
if (raw.length) { if (raw.length) {
const { path, thumbPath, name } = raw[0] const { path, thumbPath, name } = raw[0]
this.$set(this.form.model, 'url', encodeURI(path)) this.$set(this.form.model, 'url', path)
this.$set(this.form.model, 'thumbnail', encodeURI(thumbPath)) this.$set(this.form.model, 'thumbnail', thumbPath)
this.$set(this.form.model, 'name', name) this.$set(this.form.model, 'name', name)
} }
this.attachmentSelectModal.visible = false this.attachmentSelectModal.visible = false