mirror of https://github.com/halo-dev/halo-admin
encode (#568)
parent
dfd445f976
commit
2e3959bd12
|
@ -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"></span>
|
<span slot="description"></span>
|
||||||
<span slot="title">
|
<span slot="title">
|
||||||
Markdown 格式:
|
Markdown 格式:
|
||||||
<a-button
|
<a-button class="!p-0" type="link" @click="handleCopyLink(``)">
|
||||||
class="!p-0"
|
|
||||||
type="link"
|
|
||||||
@click="handleCopyLink(`})`)"
|
|
||||||
>
|
|
||||||
<a-icon type="copy" />
|
<a-icon type="copy" />
|
||||||
</a-button>
|
</a-button>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -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 `})`
|
return ``
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
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: [`})`],
|
markdown: [``],
|
||||||
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
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
|
@ -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"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
|
@ -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"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue