广告优化
This commit is contained in:
@@ -34,7 +34,7 @@ function CRUD(options) {
|
||||
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
||||
sort: ['id,desc'],
|
||||
// 等待时间
|
||||
time: 50,
|
||||
time: 1,
|
||||
// CRUD Method
|
||||
crudMethod: {
|
||||
add: (form) => {},
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<router-view :key="key" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<Ad v-show="showAd" />
|
||||
<div v-if="$store.state.settings.showFooter" id="el-main-footer">
|
||||
<span v-html="$store.state.settings.footerTxt" />
|
||||
<span v-if="$store.state.settings.caseNumber"> ⋅ </span>
|
||||
@@ -14,8 +15,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Ad from '@/components/Ad'
|
||||
export default {
|
||||
name: 'AppMain',
|
||||
components: { Ad },
|
||||
data() {
|
||||
return {
|
||||
showAd: true,
|
||||
list: ['/dashboard', '/monitor/online', '/monitor/logs',
|
||||
'/monitor/errorLog', '/monitor/server', '/sys-tools/generator',
|
||||
'/sys-tools/storage', '/components/echarts', '/components/icon',
|
||||
'/components/markdown', '/components/yaml', '']
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
cachedViews() {
|
||||
return this.$store.state.tagsView.cachedViews
|
||||
@@ -23,7 +35,23 @@ export default {
|
||||
key() {
|
||||
return this.$route.path
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route.path'(newPath) {
|
||||
// 判断是否包含在list中
|
||||
this.checkAd(newPath)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.checkAd(this.$route.path)
|
||||
},
|
||||
methods: {
|
||||
checkAd(path) {
|
||||
// 判断是否包含在list中
|
||||
this.showAd = !this.list.includes(path)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,16 +12,6 @@ NProgress.configure({ showSpinner: false })// NProgress Configuration
|
||||
const whiteList = ['/login']// no redirect whitelist
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
setTimeout(() => {
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
// 百度统计
|
||||
const hm = document.createElement('script')
|
||||
hm.src = 'https://hm.baidu.com/hm.js?300a24a5326d0e7a0ff1b14c4e8d9056'
|
||||
const s = document.getElementsByTagName('script')[0]
|
||||
s.parentNode.insertBefore(hm, s)
|
||||
})()
|
||||
}, 0)
|
||||
if (to.meta.title) {
|
||||
document.title = Config.title + ' - ' + to.meta.title
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||
<Ad />
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
||||
<h3 class="title">
|
||||
ELADMIN 后台管理系统
|
||||
@@ -43,7 +42,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Ad from '@/components/Ad'
|
||||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
import Config from '@/settings'
|
||||
import { getCodeImg } from '@/api/login'
|
||||
@@ -52,7 +50,6 @@ import qs from 'qs'
|
||||
import Background from '@/assets/images/background.webp'
|
||||
export default {
|
||||
name: 'Login',
|
||||
components: { Ad },
|
||||
data() {
|
||||
return {
|
||||
Background: Background,
|
||||
|
||||
Reference in New Issue
Block a user