|
@@ -1,42 +1,32 @@
|
|
|
<template>
|
|
|
- <!-- 页面头部 -->
|
|
|
<header>
|
|
|
- <!-- 顶部导航 -->
|
|
|
<nav class="headerNav">
|
|
|
<div class="inner">
|
|
|
<div class="left">
|
|
|
<span>中农兴业网团</span>
|
|
|
- <span>旗下网站:
|
|
|
- <span>农业百强网站(政府类30强)</span>
|
|
|
- </span>
|
|
|
+ <span>旗下网站:<span>农业百强网站(政府类30强)</span></span>
|
|
|
</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="商圈">
|
|
|
- 商圈
|
|
|
+ <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="广告服务">
|
|
|
- 广告服务
|
|
|
+ <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon2.png" alt="广告服务">广告服务
|
|
|
</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="登录">
|
|
|
- 登录
|
|
|
+ <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="注册">
|
|
|
- 注册
|
|
|
+ <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 }}
|
|
|
+ <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="搜索">
|
|
|
- 搜索
|
|
|
+ <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/searchicon.png" alt="搜索">搜索
|
|
|
</button>
|
|
|
</div>
|
|
|
<ul class="userInfo11" v-if="isShow">
|
|
@@ -46,33 +36,26 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</nav>
|
|
|
- <!-- 头部logo -->
|
|
|
<div class="headerLogo">
|
|
|
<div class="inner">
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/image/logo1.png" alt="三农资讯网" class="left" @click="backHome">
|
|
|
+ <img :src="logo" :alt="webSiteName" class="left" @click="backHome">
|
|
|
<div class="titlead" v-if="adImg">
|
|
|
- <a href="http://sannongdy.org.cn/" title="三农资讯网_广告位1" v-if="adImg.image_url==null" target="_blank">
|
|
|
- <img :src="adImg.thumb" alt="三农资讯网_广告位1">
|
|
|
+ <a href="http://sannongdy.org.cn/" v-if="adImg.image_url==null" target="_blank">
|
|
|
+ <img :src="adImg.thumb" >
|
|
|
</a>
|
|
|
- <a :href="adImg.image_url" title="三农资讯网_广告位1" v-else>
|
|
|
- <img :src="adImg.image_src" alt="三农资讯网_广告位1">
|
|
|
+ <a :href="adImg.image_url" v-else>
|
|
|
+ <img :src="adImg.image_src">
|
|
|
</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <el-dialog v-model="dialogTableVisible" title="" width="800">
|
|
|
+ <el-dialog v-model="dialogTableVisible" width="800">
|
|
|
<div class="tips">
|
|
|
<p>
|
|
|
- <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/topic/tips.png" alt="">
|
|
|
- 提示:注册请联系管理员操作!
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- 联系电话:010-56019387
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- QQ : 2909421493 、213552413
|
|
|
+ <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/topic/tips.png"> 提示:注册请联系管理员操作!
|
|
|
</p>
|
|
|
+ <p>联系电话:010-56019387</p>
|
|
|
+ <p>QQ : 2909421493 、213552413</p>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</header>
|
|
@@ -80,11 +63,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
//1.加载基本依赖 start ---------------------------------------->
|
|
|
-import { ref, onMounted, watch } from 'vue'
|
|
|
-import { ElPopover, ElDialog } from 'element-plus'
|
|
|
+import { ref, watch } from 'vue'
|
|
|
+import { ElDialog } from 'element-plus'
|
|
|
import { getToken, setToken, removeToken } from '@/store/useCookieStore'
|
|
|
import { setTicket, removeTicket } from '@/store/useticketStore'
|
|
|
-
|
|
|
+//网站地址
|
|
|
const { $webUrl, $CwebUrl, $BwebUrl} = useNuxtApp()
|
|
|
//1.加载基本依赖 end ---------------------------------------->
|
|
|
|
|
@@ -100,7 +83,6 @@ if (ticket.value) {
|
|
|
if (token.value) {
|
|
|
setToken(token.value)
|
|
|
}
|
|
|
-
|
|
|
definePageMeta({
|
|
|
middleware: 'auth'
|
|
|
});
|
|
@@ -121,18 +103,26 @@ token1.value = getToken()
|
|
|
//检测登录状态
|
|
|
let tokenStatus = ref('');
|
|
|
tokenStatus.value = getToken()
|
|
|
-console.log(tokenStatus.value);
|
|
|
+if(tokenStatus.value == undefined){
|
|
|
+ console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
+ console.log('错误:未获取到用户token,如果在本地测试请忽略!');
|
|
|
+ console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
+}else{
|
|
|
+ console.log(tokenStatus.value);
|
|
|
+}
|
|
|
|
|
|
//点击登录按钮
|
|
|
let goLogin = () => {
|
|
|
+ //开启线上登录模式 start---------------------------------------->
|
|
|
isDel.value = 0
|
|
|
token1.value = getToken()
|
|
|
window.open($BwebUrl + "/auth/login.php?backurl=" + $CwebUrl, '_blank');
|
|
|
-
|
|
|
+ //开启线上登录模式 end---------------------------------------->
|
|
|
+
|
|
|
+ //开启本地登录模式 start---------------------------------------->
|
|
|
// window.location.href = $BwebUrl + "/auth/login.php?backurl=" + $CwebUrl;
|
|
|
//"http://adminpre.bjzxtw.org.cn/auth/login.php?backurl=http://nwpre.bjzxtw.org.cn";
|
|
|
- //token1.value = getToken()
|
|
|
- // navigateTo.back()
|
|
|
+ //开启本地登录模式 end---------------------------------------->
|
|
|
}
|
|
|
let dialogTableVisible = ref(false)
|
|
|
|
|
@@ -158,7 +148,7 @@ let getUserInfo = async () => {
|
|
|
method: 'GET',
|
|
|
query: {},
|
|
|
});
|
|
|
- console.log('用户信息:', responseStatus);
|
|
|
+ //console.log('用户信息:', responseStatus);
|
|
|
//如果能拿到信息,就赋值给username
|
|
|
if(responseStatus.code==200){
|
|
|
username.value = responseStatus.data.nickname
|
|
@@ -189,12 +179,9 @@ let getLoginStatus = async () => {
|
|
|
exit();
|
|
|
}
|
|
|
}
|
|
|
-//getLoginStatus();
|
|
|
-
|
|
|
+getLoginStatus();
|
|
|
//2.登录逻辑 end ---------------------------------------->
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//3.跳转菜单逻辑 start ---------------------------------------->
|
|
|
let gotosystem = () => {
|
|
|
let url = $BwebUrl + '/#/login?userurl=' + $CwebUrl;
|
|
@@ -250,14 +237,26 @@ let goTopic = () => {
|
|
|
|
|
|
//监听token状态
|
|
|
watch(token1, (newval, oldval) => {
|
|
|
- console.log(newval, oldval);
|
|
|
+ //console.log(newval, oldval);
|
|
|
showToken.value = newval
|
|
|
}, {
|
|
|
deep: true,
|
|
|
immediate: true,
|
|
|
})
|
|
|
-//3.跳转菜单逻辑 end ---------------------------------------->
|
|
|
|
|
|
+//获得网站logo
|
|
|
+const logo = ref("")
|
|
|
+const webSiteName = ref("")
|
|
|
+let getLogo = async () => {
|
|
|
+ const responseStatus = await requestDataPromise('/web/getWebsiteFootInfo', {
|
|
|
+ method: 'GET',
|
|
|
+ query: {},
|
|
|
+ });
|
|
|
+ logo.value = responseStatus.data.website_head.logo;
|
|
|
+ webSiteName.value = responseStatus.data.website_head.website_name;
|
|
|
+}
|
|
|
+getLogo();
|
|
|
+//3.跳转菜单逻辑 end ---------------------------------------->
|
|
|
|
|
|
//4.获取广告 start ---------------------------------------->
|
|
|
//let adList = ref([]);
|
|
@@ -430,9 +429,17 @@ header {
|
|
|
position: absolute;
|
|
|
bottom: 33px;
|
|
|
right: 26px;
|
|
|
- img {
|
|
|
+ width: 600px;
|
|
|
+ height: 120px;
|
|
|
+ overflow: hidden;
|
|
|
+ a {
|
|
|
+ display: block;
|
|
|
width: 600px;
|
|
|
height: 120px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
}
|
|
|
.inner {
|