add: Tencent 404 public welfare page

This commit is contained in:
reco_luan 2019-09-20 11:02:28 +08:00
parent 965cc184e7
commit 511b1f75a7
2 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="theme-container">
<div class="theme-container" v-if="!noFoundPageByTencent">
<div class="content">
<h1>404</h1>
<blockquote>{{ getMsg() }}</blockquote>
@ -17,6 +17,21 @@ const msgs = [
]
export default {
computed: {
noFoundPageByTencent () {
return this.$themeConfig.noFoundPageByTencent !== false
}
},
mounted () {
if (this.noFoundPageByTencent) {
let dom = document.createElement('script')
dom.setAttribute('homePageName', '回到首页')
dom.setAttribute('homePageUrl', '/')
dom.setAttribute('src', '//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js')
document.body.append(dom)
}
},
methods: {
getMsg () {
return msgs[Math.floor(Math.random() * msgs.length)]

View File

@ -217,3 +217,22 @@ th, td
.vuepress-flowchart
overflow: auto
/************** 404 **************/
.mod_404 .desc {
.desc_link {
display: inline-block
// margin: 20px 0
background: #424242!important
color: #ffffff
padding: 6px 20px!important
text-decoration: none!important
border-radius: 4px
}
}
@media screen and (max-width: 720px) {
.mod_404 .desc {
margin: 50px 0
}
}