|
@@ -2,35 +2,17 @@
|
|
|
<header>
|
|
|
<nav class="headerNav">
|
|
|
<div class="inner">
|
|
|
- <div class="left">
|
|
|
- <span class="znxy">
|
|
|
- <a href="http://znxyw.org.cn/" target="_blank">中农兴业网团 {{ templateBaseStore.webSiteName }}</a>
|
|
|
- </span>
|
|
|
- <span>旗下网站 · 农业百强网站(科教文化类十强)</span>
|
|
|
- </div>
|
|
|
+ <div class="left">你好,欢迎来到{{webSiteName}}!</div>
|
|
|
<div class="right">
|
|
|
<div class="menu">
|
|
|
- <button class="reg" @click="goTopic">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon1.png" alt="商圈">商圈
|
|
|
- </button>
|
|
|
- <button class="reg" @click="goAdvertising">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon2.png" alt="广告服务">广告服务
|
|
|
- </button>
|
|
|
+ <button class="reg" @click="goTopic"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon1.png">商圈</button>
|
|
|
+ <button class="reg" @click="goAdvertising"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon2.png">广告服务</button>
|
|
|
</div>
|
|
|
<div class="right-top-menu">
|
|
|
- <button class="reg" @click="goLogin" v-show="!showToken">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png" alt="登录">登录
|
|
|
- </button>
|
|
|
- <button class="reg" @click="goRegister" v-show="!showToken">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon4.png" alt="注册">注册
|
|
|
- </button>
|
|
|
- <button class="reg" @click="userCenter" v-show="showToken">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png" alt="用户信息">{{
|
|
|
- username }}
|
|
|
- </button>
|
|
|
- <button class="reg" @click="goSearch">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/searchicon.png" alt="搜索">搜索
|
|
|
- </button>
|
|
|
+ <button class="reg" @click="goLogin" v-show="!showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png">登录</button>
|
|
|
+ <button class="reg" @click="goRegister" v-show="!showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon4.png">注册</button>
|
|
|
+ <button class="reg" @click="userCenter" v-show="showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png">{{username}}</button>
|
|
|
+ <button class="reg" @click="goSearch"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/searchicon.png">搜索</button>
|
|
|
</div>
|
|
|
<ul class="userInfo11" v-if="isShow">
|
|
|
<li @click="gotosystem">个人中心</li>
|
|
@@ -43,21 +25,14 @@
|
|
|
<div class="inner">
|
|
|
<img :src="logo" :alt="webSiteName" class="left" @click="backHome">
|
|
|
<div class="titlead" v-if="adImg">
|
|
|
- <a href="http://sannongdy.org.cn/" v-if="adImg.image_url == null" target="_blank"
|
|
|
- :title="adImg.introduce">
|
|
|
- <img :src="adImg.thumb" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag">
|
|
|
- </a>
|
|
|
- <a :href="adImg.image_url" v-else :title="adImg.introduce">
|
|
|
- <img :src="adImg.image_src" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag">
|
|
|
- </a>
|
|
|
+ <a href="http://sannongdy.org.cn/" v-if="adImg.image_url == null" target="_blank" :title="adImg.introduce"><img :src="adImg.thumb" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag"></a>
|
|
|
+ <a :href="adImg.image_url" v-else :title="adImg.introduce"><img :src="adImg.image_src" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag"></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-dialog v-model="dialogTableVisible" width="800">
|
|
|
<div class="tips">
|
|
|
- <p>
|
|
|
- <img src="@/public/topic/tips.png"> 提示:注册请联系管理员操作!
|
|
|
- </p>
|
|
|
+ <p><img src="@/public/topic/tips.png"> 提示:注册请联系管理员操作!</p>
|
|
|
<p>联系电话:010-56019387</p>
|
|
|
<p>QQ : 2909421493 、213552413</p>
|
|
|
</div>
|
|
@@ -66,16 +41,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { useTemplateBaseStore } from '@/stores/templateBase'
|
|
|
-const templateBaseStore = useTemplateBaseStore()
|
|
|
-console.log(123456)
|
|
|
-console.log(templateBaseStore.webSiteName)
|
|
|
+
|
|
|
|
|
|
//1.加载基本依赖 start ---------------------------------------->
|
|
|
import { ref, watch, onMounted } from 'vue'
|
|
|
import { ElDialog } from 'element-plus'
|
|
|
import { getToken, setToken, removeToken } from '@/store/useCookieStore'
|
|
|
import { setTicket, removeTicket } from '@/store/useticketStore'
|
|
|
+import { useTemplateBaseStore } from '@/stores/templateBase'
|
|
|
+const templateBaseStore = useTemplateBaseStore()
|
|
|
//网站地址
|
|
|
const { $webUrl, $CwebUrl, $BwebUrl, $LoginWebUrl } = useNuxtApp()
|
|
|
//1.加载基本依赖 end ---------------------------------------->
|
|
@@ -115,9 +89,9 @@ token1.value = getToken()
|
|
|
let tokenStatus = ref('');
|
|
|
tokenStatus.value = getToken()
|
|
|
if (tokenStatus.value == undefined) {
|
|
|
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
- console.log('错误:未获取到用户token,如果在本地测试请忽略!');
|
|
|
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
+ // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
+ // console.log('错误:未获取到用户token,如果在本地测试请忽略!');
|
|
|
+ // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
} else {
|
|
|
console.log(tokenStatus.value);
|
|
|
}
|
|
@@ -240,24 +214,6 @@ watch(token1, (newval, oldval) => {
|
|
|
deep: true,
|
|
|
immediate: true,
|
|
|
})
|
|
|
-
|
|
|
-//获得网站logo
|
|
|
-const logo = ref("")
|
|
|
-const webSiteName = ref("")
|
|
|
-let getLogo = async () => {
|
|
|
- const responseStatus = await requestDataPromise('/web/getWebsiteHead', {
|
|
|
- method: 'GET',
|
|
|
- query: {},
|
|
|
- });
|
|
|
- if (responseStatus.code == 200) {
|
|
|
- logo.value = responseStatus.data.logo;
|
|
|
- webSiteName.value = responseStatus.data.website_name;
|
|
|
- templateBaseStore.setWebSiteName(responseStatus.data.website_name)
|
|
|
- } else if (responseStatus.code == 0) {
|
|
|
- window.location.href = $CwebUrl + '/404';
|
|
|
- }
|
|
|
-}
|
|
|
-getLogo();
|
|
|
//3.跳转菜单逻辑 end ---------------------------------------->
|
|
|
|
|
|
//4.获取广告 start ---------------------------------------->
|
|
@@ -283,7 +239,7 @@ onMounted(async () => {
|
|
|
|
|
|
if (token == undefined) {
|
|
|
//如果没有获取到token 不访问后端获取在线状态
|
|
|
- console.log("没有获取到token!无需查询登录状态!")
|
|
|
+ //console.log("没有获取到token!无需查询登录状态!")
|
|
|
showToken.value = false;
|
|
|
|
|
|
} else {
|
|
@@ -331,17 +287,18 @@ onMounted(async () => {
|
|
|
//从客户端获取广告
|
|
|
//从客户端获取行政职能部门 加快打开速度
|
|
|
const { $webUrl, $CwebUrl } = useNuxtApp();
|
|
|
+
|
|
|
//广告1
|
|
|
- let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_top`
|
|
|
- const responseAd1 = await fetch(url, {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'application/json',
|
|
|
- 'Userurl': $CwebUrl,
|
|
|
- 'Origin': $CwebUrl
|
|
|
- }
|
|
|
- });
|
|
|
- const resultAd1 = await responseAd1.json();
|
|
|
- adImg.value = resultAd1.data[0];
|
|
|
+ // let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_top`
|
|
|
+ // const responseAd1 = await fetch(url, {
|
|
|
+ // headers: {
|
|
|
+ // 'Content-Type': 'application/json',
|
|
|
+ // 'Userurl': $CwebUrl,
|
|
|
+ // 'Origin': $CwebUrl
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // const resultAd1 = await responseAd1.json();
|
|
|
+ // adImg.value = resultAd1.data[0];
|
|
|
|
|
|
//从客户端获取用户名
|
|
|
let userInfoUrl = `${$webUrl}/user/getUserInfo`
|
|
@@ -358,6 +315,23 @@ onMounted(async () => {
|
|
|
}
|
|
|
})
|
|
|
//5.获取登录状态 end ---------------------------------------->
|
|
|
+
|
|
|
+
|
|
|
+//6.获得网站基本信息与广告池 start ---------------------------------------->
|
|
|
+//获得网站logo
|
|
|
+const logo = ref("")
|
|
|
+const webSiteName = ref("")
|
|
|
+if(templateBaseStore.webSiteInfo.website_head){
|
|
|
+ logo.value = templateBaseStore.webSiteInfo.website_head.logo;
|
|
|
+ webSiteName.value = templateBaseStore.webSiteInfo.website_head.title;
|
|
|
+}
|
|
|
+//adImg.value
|
|
|
+//获得广告
|
|
|
+if(templateBaseStore.webAdList){
|
|
|
+ //console.log(templateBaseStore.webAdList)
|
|
|
+ adImg.value = requestAd(templateBaseStore.webAdList,templateBaseStore.webSiteInfo.website_head.ad_key + "_" + "top")
|
|
|
+}
|
|
|
+//6.获得网站基本信息与广告池 end ---------------------------------------->
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|