|
@@ -433,48 +433,52 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-//0.pinia单基本信息 start---------------------------------------->
|
|
|
+//0.获得基本信息单元 start---------------------------------------->
|
|
|
//0.1获得pinia源
|
|
|
import { useTemplateBaseStore } from '@/stores/templateBase'
|
|
|
const templateBaseStore = useTemplateBaseStore()
|
|
|
//0.2获得该页的皮肤id - 在每个组件中也是同样的获得方法
|
|
|
const skinId = ref("")
|
|
|
//0.3获得站点基本信息
|
|
|
-let getTemplateBaseInfo = async () => {
|
|
|
- const responseStatus = await requestDataPromise('/web/getWebsiteAllinfo', {
|
|
|
- method: 'GET',
|
|
|
- query: {
|
|
|
- 'link_textnum':24,
|
|
|
- 'link_imgnum':18,
|
|
|
- 'link_footnum':4
|
|
|
- },
|
|
|
+const responseStatus = await requestDataPromise('/web/getWebsiteAllinfo', {
|
|
|
+ method: 'GET',
|
|
|
+ query: {
|
|
|
+ 'link_textnum':24,
|
|
|
+ 'link_imgnum':18,
|
|
|
+ 'link_footnum':4
|
|
|
+ },
|
|
|
+});
|
|
|
+if (responseStatus.code == 200) {
|
|
|
+ //0.3.1设置站点基本信息
|
|
|
+ templateBaseStore.setWebSiteInfo(responseStatus.data)
|
|
|
+ //0.3.2设置皮肤id
|
|
|
+ skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
|
|
|
+ //0.3.3设置seo信息
|
|
|
+ let seoTitle = templateBaseStore.webSiteInfo.website_head.title;
|
|
|
+ let seoDescription = templateBaseStore.webSiteInfo.website_head.description;
|
|
|
+ let seoKeywords = templateBaseStore.webSiteInfo.website_head.keywords;
|
|
|
+ let seoSuffix = templateBaseStore.webSiteInfo.website_head.suffix;
|
|
|
+ let seoName = templateBaseStore.webSiteInfo.website_head.website_name;
|
|
|
+ useSeoMeta({
|
|
|
+ title: seoTitle + "_" + seoSuffix,
|
|
|
+ meta: [
|
|
|
+ { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
|
|
|
+ { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
|
|
|
+ ]
|
|
|
});
|
|
|
- if (responseStatus.code == 200) {
|
|
|
- templateBaseStore.setWebSiteInfo(responseStatus.data)
|
|
|
- skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
|
|
|
- }
|
|
|
}
|
|
|
-getTemplateBaseInfo();
|
|
|
//0.4获得广告池
|
|
|
-let getAdList = async (adKey) => {
|
|
|
- const responseStatus = await requestDataPromise('/web/getWebsiteAdvertisement', {
|
|
|
- method: 'GET',
|
|
|
- query: {
|
|
|
-
|
|
|
- },
|
|
|
- });
|
|
|
- if (responseStatus.code == 200) {
|
|
|
- //console.log(responseStatus.data)
|
|
|
- templateBaseStore.setAdList(responseStatus.data)
|
|
|
- //获取广告
|
|
|
- //adImg.value = requestAd(templateBaseStore.webAdList,templateBaseStore.webSiteInfo.website_head.ad_key + "_" + "top")
|
|
|
- }
|
|
|
+const adResponseStatus = await requestDataPromise('/web/getWebsiteAdvertisement', {
|
|
|
+ method: 'GET',
|
|
|
+ query: {},
|
|
|
+});
|
|
|
+if (adResponseStatus.code == 200) {
|
|
|
+ //console.log(responseStatus.data)
|
|
|
+ templateBaseStore.setAdList(adResponseStatus.data)
|
|
|
+ //获取广告
|
|
|
+ //adImg.value = requestAd(templateBaseStore.webAdList,templateBaseStore.webSiteInfo.website_head.ad_key + "_" + "top")
|
|
|
}
|
|
|
-getAdList();
|
|
|
-//0.5设置seo信息
|
|
|
-
|
|
|
-
|
|
|
-//0.pinia单基本信息 end---------------------------------------->
|
|
|
+//0.获得基本信息单元 end---------------------------------------->
|
|
|
|
|
|
//1.加载页面必备组件 start---------------------------------------->
|
|
|
import { ref, onMounted } from 'vue';
|
|
@@ -483,31 +487,6 @@ import { ElMessage } from 'element-plus';
|
|
|
|
|
|
//2.页面数据 start---------------------------------------->
|
|
|
//2.页面数据 end---------------------------------------->
|
|
|
-
|
|
|
-//5.设置seo数据 start---------------------------------------->
|
|
|
-//获取seo数据
|
|
|
-const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
|
|
|
- method: 'GET',
|
|
|
- query: {},
|
|
|
-});
|
|
|
-if (setData.code == 200) {
|
|
|
- let seoTitle = setData.data.website_head.title;
|
|
|
- let seoDescription = setData.data.website_head.description;
|
|
|
- let seoKeywords = setData.data.website_head.keywords;
|
|
|
- let seoSuffix = setData.data.website_head.suffix;
|
|
|
- let seoName = setData.data.website_head.website_name;
|
|
|
-
|
|
|
- useSeoMeta({
|
|
|
- title: seoTitle + "_" + seoSuffix,
|
|
|
- meta: [
|
|
|
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
|
|
|
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
|
|
|
- ]
|
|
|
- });
|
|
|
-} else {
|
|
|
- //console.log("设置首页SEO出错!", setData.message)
|
|
|
-}
|
|
|
-//5.设置seo数据 start---------------------------------------->
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|