详情页

帝国CMS如何设置屏蔽页代码

时间:2023年12月14日

编辑:佚名

情景描述:当我们不想让用户直接看到真正的内容时候,但又不让蜘蛛发觉,以致快照更改,所以需要用到屏蔽页,这样既能兼顾用户浏览的需求,也能兼顾到蜘蛛,不至于快照被篡改的情况。
步骤:
1.制作一个txt文本文件,填充假页面代码,(注意,保存文件格式一定是txt文档)
源文件地址:https://www.cqgzfs.com/pageindex.txt
如下:
复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>霖溪雅信息网</title>
    <style>
        /* 全局样式 */
        body,
        ul,
        ol,
        li,
        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        form,
        fieldset,
        table,
        td,
        img,
        div {
            margin: 0;
            padding: 0;
            border: 0;
        }
        body {
            background: #fff;
            color: #666;
            font-size: 16px;
            font-family: SourceHanSansCN-Regular;
        }
        i,
        em {
            font-style: normal;
        }
        ul,
        ol {
            list-style-type: none;
        }
        select,
        input,
        img,
        select {
            vertical-align: middle;
        }
        a {
            text-decoration: none;
        }
        a:hover,
        a:active,
        a:focus {
            color: #333;
            /* text-decoration: underline; */
        }
        /* 清除浮动 */
        .clearfix:after {
            visibility: hidden;
            display: block;
            font-size: 0;
            content: " ";
            clear: both;
            height: 0;
        }
        .clearfix {
            zoom: 1;
        }
        .fl {
            float: left;
        }
        .fr {
            float: right;
        }
        /* 单行溢出省略号 */
        .one-txt-cut {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .customBody {
            background: #f5f6f8;
        }
        .customHead {
            width: 100%;
            background-color: #ffffff;
        }
        .customHead .customNav {
            width: 1140px;
            height: 158px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .customHead .customNav h1 {
            font-size: 60px;
            color: #333;
        }
        .customHead .customNav .logo {
            width: 244px;
            height: 47px;
        }
        .customMain {
            margin: 30px auto 0 auto;
            width: 1140px;
        }
        .customMain .leftBox {
            width: 749px;
            background-color: #ffffff;
            border: solid 1px #ededed;
            box-sizing: border-box;
        }
        .customMain .leftBox .headline {
            height: 152px;
            position: relative;
            padding: 0 57px;
            overflow: hidden;
            box-sizing: border-box;
            border-bottom: 1px solid #ededed;
        }
        .customMain .leftBox .headline .sign {
            position: absolute;
            top: 0;
            right: 60px;
        }
        .customMain .leftBox .headline h1 {
            font-size: 22px;
            color: #333333;
            line-height: 1;
            margin: 56px 0 17px 0px;
            margin-bottom: 17px;
        }
        .customMain .leftBox .headline .message {
            font-size: 12px;
            line-height: 1;
            color: #666666;
            width: 357px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .customMain .leftBox .content {
            padding: 24px 60px 85px 60px;
            box-sizing: border-box;
        }
        .customMain .leftBox .content .banner {
            width: 627px;
            height: 409px;
            margin-bottom: 28px;
        }
        .customMain .leftBox .content p {
            font-size: 14px;
            line-height: 30px;
            letter-spacing: 1px;
            color: #333333;
        }
        .customMain .rightBox {
            width: 360px;
        }
        .customMain .rightBox .box {
            margin-bottom: 24px;
            background-color: #ffffff;
            border: solid 1px #ededed;
            box-sizing: border-box;
        }
        .customMain .rightBox .box .title {
            padding: 0 22px;
            height: 65px;
            font-size: 22px;
            letter-spacing: 0px;
            color: #333333;
            box-sizing: border-box;
            border-bottom: solid 1px #ededed;
            display: flex;
            align-items: center;
            justify-self: center;
        }
        .customMain .rightBox .box .title i {
            width: 4px;
            height: 26px;
            background-color: #01a751;
            border-radius: 2px;
            margin-right: 12px;
        }
        .customMain .rightBox .box .imageText {
            padding: 24px 27px 38px 27px;
        }
        .customMain .rightBox .box .imageText img {
            width: 304px;
            height: 304px;
            margin-bottom: 35px;
        }
        .customMain .rightBox .box .imageText p {
            font-size: 14px;
            line-height: 27px;
            letter-spacing: 0px;
            color: #666666;
        }
        .customMain .rightBox .box .listText {
            width: 300px;
            margin: 27px auto 25px auto;
        }
        .customMain .rightBox .box .listText .item {
            padding-bottom: 25px;
            box-sizing: border-box;
        }
        .customMain .rightBox .box .listText .item p {
            font-size: 14px;
            line-height: 27px;
            letter-spacing: 0px;
            color: #333333;
        }
        .customMain .rightBox .box .listText .item em {
            display: block;
            font-size: 14px;
            line-height: 27px;
            letter-spacing: 0px;
            color: #666666;
            text-align: right;
        }
        /* 底部footer */
        .customFooter {
            text-align: center;
            padding: 65px 0 43px 0;
            line-height: 26px;
            box-sizing: border-box;
            font-size: 14px;
            color: #999999;
        }
    </style>
</head>
<body class="customBody" onselectstart="return false;" oncontextmenu="return false;">
    <div class="customHead">
        <div class="customNav">
            <h1>霖溪雅信息网</h1>
        </div>
    </div>
    <div class="customMain clearfix">
        <!-- 左侧内容 -->
        <div class="leftBox fl">
            <div class="headline">
                <img class="sign" src="http://www.gl766.com/images/ico.png" alt="">
                <h1>霖溪雅信息网</h1>
                <p class="message">
                    <span>日期:2022/05/01 15:55</span>
                    <span>来源:霖溪雅</span>
                    <span>人气:8652</span>
                </p>
            </div>
            <div class="content">
                <img class="banner" src="https://www.cqgzfs.com/pic1.jpg" alt="">
                <p>说实话,总有许多的话要说,因为我时刻被感动着,看着我们的大家庭,我真的很欣慰,也许当时在做出选择时,我损失一些东西,可是回头想想,我真的很幸运,我也很感动自己做出义无反顾的抉择,因为在这个大家庭里,我得到了之前我没有想到的东西,信任、满足、感动,还有我们将要实现的共同的目标。对于我现在的这个家庭,我只有真正的全力以赴,才对得起我自己,对得起我的这些家人。看着我的家庭人丁兴旺,而且大家团结一致,努力朝前的样子,我打心眼里高兴,说实话,和赵总的关系不但是上下级,更是姐妹,在她的身上,我学到了很多了东西,我看到了坚强、魄力、和她那独一无二的魅力,在她那里,我们没有错误,有的只是不断的提升,没有任何不信任,只有不断的鼓励,对于我们工作中的不足,她总是很巧妙帮我们回避,并且使得我们下次不再犯同样的错,当我们工作遇到困难时,她给我们更好、更快的解决办法,所有的问题到了她那里,就变得不是问题,而是我们向更高目标迈进的台阶,让我们在工作的过程中,不断地充满信心,不断地成长,并且也不断的自信,更是不断的提升。再看我们石总,虽然他是一位男士,但是我们如果碰到一些不理解的事情,我们还是很愿意和他交流,和他交流完之后,就感觉眼前一片阳光灿烂,他总是把所有的事情看得很透,说得很明白,总是给我们莫大的鼓励和支持,让我们每一个人的心理充满希望,而且也让我们很清楚,我们的目标要怎样做才能够得以实现,在我们的身上,总是能够得到赵总和石总他们的最大支持与帮助,说实话,在他们那里,我真的应该是能力成长过程中最大的受益者。我现在还有两个最好的合作伙伴,也是最好的姐妹,就是毛和刘,他们性格开朗,热情大方,做事情认真仔细,并且我们合作总是非常地默契,很多事情总是有共同的想法,总是不约而同的想到解决问题更多、更好的办法,对一个事情的总有共同的看法,这些总是让我们感到惊奇,好像是相互间心灵相通一样。我们有着共同的目标,有着共同的理想,相信我们之间的精诚合作,必能使我们这个大家庭的前程似锦,辉煌无限。我们的团队里面还有许多让我感动的事情,像前两天的时候,因为大家上的电话量比较大,很多人的嗓子都哑了,可是每一个都还在坚持,我给他们说,不行的话就休息一下,整理一下客户名单,或者理一下单子。可是他们说,最近我的业绩并不是很好,所以我一定要追上他们,我要坚持。我相信你之前说过的话,只有我今天努力的工作,才能有更好的成绩,我不能辜负你和毛主管对我们的期望,更不能让赵总失望,而且现在也只是嗓子有些疼,我多喝一些水就可以了,不会影响工作的。因此好几个人嗓子虽然疼,但是他们却一直都在坚持,不是他们不想休息,而是他们知道,自己想要什么,自己想要的要怎麽样才能实现,所以他们很努力,也很刻苦,还有好几次,有的女孩的身体不适,作为一个明眼人,一眼就能看出他们的不舒服,可是每当我问起他们的时候,他们都会给我说,没事,我多喝点热水,我还能坚持,说实话,我当时真的很感动,我就想,我们有这样一个能做事、愿做事、想做事的团队,还有什么目标我们达不到呢?还有什么梦想不能变为现实的呢?真的,跟着赵总和石总,加入到盛世兴隆这个团队,我真的很幸运,也真的感觉到自己选择绝对地正确,为了我们美好的明天,我们一定会努力向前的,为了我们更好的明天,加油吧!</p>
            </div>
        </div>
        <!-- 右侧边栏 -->
        <div class="rightBox fr">
            <div class="box">
                <h2 class="title"><i></i>关于我</h2>
                <div class="imageText">
                    <img src="https://www.cqgzfs.com/pic2.jpg" alt="">
                    <p>这是记录我的团队日常。我们在海南,欢迎合作。</p>
                </div>
            </div>
            <div class="box">
                <h2 class="title"><i></i>团队日常</h2>
                <div class="listText">
                    <div class="item">
                        <p>去海南三亚团建</p>
                        <em>--2022/10/1</em>
                    </div>
                    <div class="item">
                        <p>去长沙交流活动</p>
                        <em>--2021/10/12</em>
                    </div>
                    <div class="item">
                        <p>团队重大突破100万业绩</p>
                        <em>--2021/8/15</em>
                    </div>
                    <div class="item">
                        <p>记录公司人员架构</p>
                        <em>--2021/5/12</em>
                    </div>
                    <div class="item">
                        <p>开工大吉</p>
                        <em>--2021/2/01</em>
                    </div>
                    <div class="item">
                        <p>新的一年,加油</p>
                        <em>--2021/1/01</em>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="customFooter">
        <p>Copyright © 2021-2023 www.cqgzfs.com 版权所有</p>
        <a href="https://beian.miit.gov.cn/" target="_blank"></a>
        <p>声明: 本站所有图片和文章来自互联网 如有异议 请与本站联系。 本站为非赢利性网站 不接受任何赞助和广告。</p>
    </div>
</body>
</html>
2.在index页面的head内,填写JavaScript代码如下:
复制代码
<script>
    var path = window.location.pathname;
        if (path=='/'){
        document.ready = function ready(fn) {
            if (document.addEventListener) {
                document.addEventListener("DOMContentLoaded", function () {
                    document.removeEventListener("DOMContentLoaded", arguments.callee, false);
                    fn()
                }, false)
            } else {
                if (document.attachEvent) {
                    document.attachEvent("onreadystatechange", function () {
                        if (document.readyState == "complete") {
                            document.detachEvent("onreadystatechange", arguments.callee);
                            fn()
                        }
                    })
                }
            }
        };
        document.getElementsByTagName("html")[0].style.display = "none";
        (function () {
            var itis = true;
            var titles = document.title;
            document.title = "";
            document.ready(function () {
                try {
                    if (itis) {
                        $("body").html("");
                        $("body").load("/pageindex.txt", function () {
                            document.title = $(".headline h1").text();
                        });
                    } else {
                        document.title = titles;
                    }
                } catch (e) {
                }
                document.getElementsByTagName("html")[0].style.display = "block";
            })
        })();
        document.oncontextmenu = function (e) {
            var e = e || window.event;
            e.returnValue = false;
            return false
        };
        window.onkeydown = function (e) {
            if (e.ctrlKey && e.keyCode == 83) {
                e.preventDefault();
                e.returnValue = false;
                return false
            }
        };
    }
    </script>
复制代码
这样保存文件后,打开页面,即可显示为假页面
相关文章
猜你需要