diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 87fa52f..8ba1e9c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -85,13 +85,14 @@ @@ -133,7 +134,8 @@ export default { copyright: '', recordPermissionNum: '', netdiskName: '', - netdiskLogo: this.$store.state.user.netdiskLogo + netdiskLogo: this.$store.state.user.netdiskLogo, + footerHtml: '' }, loginForm: { username: this.$route.query.username || '', @@ -186,9 +188,28 @@ export default { if (this.webstieRecord.netdiskName || this.webstieRecord.netdiskLogo) { this.$store.dispatch('user/setLogo', {netdiskName: this.webstieRecord.netdiskName, netdiskLogo: this.webstieRecord.netdiskLogo}) } + if (this.webstieRecord.footerHtml) { + this.$nextTick(() => { + this.loadScripts() + }) + } }) }, methods: { + loadScripts() { + const preview = this.$refs.footerHtml; + const scripts = preview.querySelectorAll('script'); + + scripts.forEach(script => { + const newScript = document.createElement('script'); + if (script.src) { + newScript.src = script.src; + } else { + newScript.innerHTML = script.innerHTML; + } + document.body.appendChild(newScript).parentNode.removeChild(newScript); + }); + }, showPwd() { if (this.passwordType === 'password') { this.passwordType = '' diff --git a/src/views/markdown/index.vue b/src/views/markdown/index.vue index 26f4b73..4842133 100644 --- a/src/views/markdown/index.vue +++ b/src/views/markdown/index.vue @@ -358,6 +358,9 @@ export default { hljs: { lineNumber: true }, + markdown: { + toc: true + }, }, cache: { enable: false, diff --git a/src/views/setting/articles/blogManager.vue b/src/views/setting/articles/blogManager.vue index 4e59a15..1819911 100644 --- a/src/views/setting/articles/blogManager.vue +++ b/src/views/setting/articles/blogManager.vue @@ -95,8 +95,26 @@
网站联网备案号文本:
+
自定义页脚html:
+ + +
+ 预览 + +
+ +