<template>
    <div class="page">
        <div class="content">
            <div v-html="detail"></div>
        </div>
    </div>
</template>

<script>
import resolveUrl from 'resolve-url';
export default {
    data() {
        return {
            detail: ''
        };
    },
    mounted() {
        let day = this.dayjs().format('YYYY-MM-DD');
        let page = this.$route.query.page || 'privacy';
        this.$http.get(`/${page}.html`).then(res => {
            let contents = res.split('<body>')[1].split('</body>');
            let detail = contents[0].replace(/古藏站/g, '古藏站');
            detail = detail.replace(/<\/h1>/, `</h1><h3>生效时间：【${day}】</h3><h3>更新时间：【${day}】</h3>`);
            this.detail = detail;
            // this.detail = res
        });
    },
    methods: {}
};
</script>

<style lang="less" scoped>
.page {
    background-color: @bg3;
    padding: 16px;
}
/deep/.content {
    background: @bg;
    border-radius: 8px;
    padding: 16px;
    .align-center {
        font-size: @font3;
        font-weight: bold;
        text-align: center;
        margin: 0;
        padding-bottom: 10px;
    }
    p {
        font-size: @font2;
        margin: 6px 0 0;
        color: @text3;
        word-break: break-all;
    }

    h4,
    h5,
    h6 {
        font-size: @font2;
        margin: 20px 0 0;
    }
    h3 {
        font-size: @font2;
        margin: 0;
    }
}
</style>
