<template>
    <div class="container">
        <!--友情链接组件1开始-->
        <div class="common_friendlink_pc_1"><!--使用此组件，请复制此div-->
            <div class="fastlink">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="fastlink-body">
                                <span class="sp1">培训机构：</span>
                                <ul class="fastlink-body-ul">
                                    <li v-for="(item,index) in getLinksData" :key="index">
                                        <a :href="item.url" target="__blank">{{item.name}}</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--友情链接组件1结束-->
    </div>
</template>

<script type="text/babel">
    import formMixin from '../../../src/mixins/formMixin';
    import lenye_base from 'lenye_base';

    export default {
        name: 'FriendlyLinks',
        mixins: [formMixin],
        components: {},
        data() {
            return {
                // 站点数据
                siteData: '',
                // 用户信息
                userData: '',
                //  获取得信息
                getLinksData: []
            };
        },
        created() {
        },
        mounted() {
            this.getLink();
        },
        methods: {
            getLink() {
                const that = this;
                var obj = {
                    url: lenye_base.api_url.setting.querySiteLinks,
                    data: {},
                    Ajax: function (data) {
                        that.getLinksData = data.data;
                        console.log('友情连接', that.getLinksData);
                    }
                };
                this.getData(obj);
            },
            // 请求函数
            getData(obj) {
                // 请求的api，格式为 lenye_base.api_url.setting.queryShowPage
                const url = obj.url;
                //请求的数据，类型是对象
                const data = obj.data;
                // 只能是箭头函数
                const Ajax = obj.Ajax;
                lenye_base.httpPost(lenye_base.base_data.getapiUrl() + url, lenye_base.base_data.getformatting(
                    data), Ajax);
            }
        }
    };
</script>
