Browse Source

修改bug

修改bug
dangyunlong 1 month ago
parent
commit
1ac488e50a

+ 1 - 1
.nuxt/dev/index.mjs

@@ -180,7 +180,7 @@ const _RyJtz6y3Rh = (function(nitro) {
 
 const rootDir = "D:/MyProject/gogs/sannongzixunwang_web_ssr/sannongzixunwang_web";
 
-const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"},{"name":"description","content":"三农资讯网"},{"name":"keywords","content":"三农资讯网"}],"link":[],"style":[],"script":[],"noscript":[],"title":"三农资讯网"};
+const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"},{"name":"description","content":""},{"name":"keywords","content":""}],"link":[],"style":[],"script":[],"noscript":[],"title":""};
 
 const appRootTag = "div";
 

+ 1 - 1
.nuxt/manifest/latest.json

@@ -1 +1 @@
-{"id":"dev","timestamp":1742172707284}
+{"id":"dev","timestamp":1742195571609}

+ 1 - 0
.nuxt/manifest/meta/49e5706e-f426-4f06-bd53-2b0ec905064c.json

@@ -0,0 +1 @@
+{"id":"49e5706e-f426-4f06-bd53-2b0ec905064c","timestamp":1742195174611,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 0 - 1
.nuxt/manifest/meta/9fc5bffd-0583-4198-bc43-ae7cbe25731c.json

@@ -1 +0,0 @@
-{"id":"9fc5bffd-0583-4198-bc43-ae7cbe25731c","timestamp":1741950331512,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 1 - 1
.nuxt/manifest/meta/dev.json

@@ -1 +1 @@
-{"id":"dev","timestamp":1742172707284,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
+{"id":"dev","timestamp":1742195571609,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 3 - 3
.nuxt/nitro.json

@@ -1,5 +1,5 @@
 {
-  "date": "2025-03-17T00:51:55.752Z",
+  "date": "2025-03-17T07:12:54.719Z",
   "preset": "nitro-dev",
   "framework": {
     "name": "nuxt",
@@ -9,9 +9,9 @@
     "nitro": "2.10.4"
   },
   "dev": {
-    "pid": 12660,
+    "pid": 2040,
     "workerAddress": {
-      "socketPath": "\\\\.\\pipe\\nitro\\worker-12660-1.sock"
+      "socketPath": "\\\\.\\pipe\\nitro\\worker-2040-1.sock"
     }
   }
 }

+ 1 - 1
.nuxt/tsconfig.json

@@ -102,7 +102,7 @@
         "./imports"
       ],
       "#app-manifest": [
-        "./manifest/meta/dev"
+        "./manifest/meta/dev.json"
       ],
       "#components": [
         "./components"

+ 1 - 1
assets/css/foot.less

@@ -5,7 +5,7 @@
 .foot_img_box{
     overflow:hidden;
     display:block;
-    margin:40px auto 0;
+    margin:20px auto 0;
     width:100%; 
     display: flex;
     flex-wrap: wrap;

+ 8 - 1
assets/css/index.less

@@ -596,10 +596,17 @@
     }
     .adBox1 {
         margin-bottom: 20px;
-        img {
+        width: 450px;
+        height: 290px;
+        overflow: hidden;
+        a {
+            display: block;
             width: 450px;
             height: 290px;
         }
+        img {
+            width: 100%;
+        }
     }
     .scienceLeft {
         width: 720px;

+ 14 - 10
components/home/Advertising.vue

@@ -2,11 +2,11 @@
     <!-- 广告位 -->
     <div class="adversing" v-if="imgurl">
         <div class="inner">
-            <a href="http://nzgxw.org.cn/" title="三农资讯网_广告位2" v-if="imgurl.image_url==null" target="_blank">
-                <img :src="imgurl.thumb" alt="三农资讯网_广告位2">
+            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank">
+                <img :src="imgurl.thumb">
             </a>
-            <a :href="imgurl.image_url" title="三农资讯网_广告位2" v-else>
-                <img :src="imgurl.image_src" alt="三农资讯网_广告位2">
+            <a :href="imgurl.image_url" v-else>
+                <img :src="imgurl.image_src">
             </a>
         </div>
     </div>
@@ -21,13 +21,17 @@ const props = defineProps({
 <style lang="less">
 // 广告位logo
 .adversing {
-    width: 100%;
+    width: 1200px;
     height: 90px;
-    margin: 30px 0 30px;
-
-    img {
-        width: 1200px;
-        height: 90px;
+    margin:0 auto;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    overflow: hidden;
+    a {
+        display: block;
     }
+    img {
+        width: 100%;
+    }  
 }
 </style>

+ 1 - 1
components/home/SecondaryHeading.vue

@@ -101,7 +101,7 @@ getPageData();
             margin-left: 40px;
             display: inline-block;
             vertical-align: middle;
-            width: 28px;
+            width: 32px;
             height: 36px;
             padding: 3px 7px;
             border: 0.5px solid #129502;

+ 15 - 7
components/home/TopTen.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="topTenTitle">
         <div class="inner" v-if="imgurl">
-            <a href="http://nzgxw.org.cn/" title="三农资讯网_广告位" v-if="imgurl.image_url==null" target="_blank">
-                <img :src="imgurl.thumb" alt="三农资讯网_广告位">
+            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank">
+                <img :src="imgurl.thumb" >
             </a>
-            <a :href="imgurl.image_url" title="三农资讯网_广告位" v-else>
-                <img :src="imgurl.image_src" alt="三农资讯网_广告位">
+            <a :href="imgurl.image_url" v-else>
+                <img :src="imgurl.image_src">
             </a>
         </div>
     </div>
@@ -20,12 +20,20 @@
 <style lang="less">
 // 十强称号logo
 .topTenTitle {
-    width: 100%;
+    width: 1200px;
     height: 90px;
-    margin: 25px 0 15px;
-    img {
+    margin: 0 auto;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    overflow: hidden;
+    a {
+        display: block;
         width: 1200px;
         height: 90px;
+        overflow: hidden;
+    }
+    img {
+        width: 1200px;
     }
 }
 </style>

+ 9 - 9
components/home/foot.vue

@@ -1,10 +1,10 @@
-    <template>
+ <template>
     <footer class="index_foot">
-        <div class="index_foot_name_box">
+        <!-- <div class="index_foot_name_box">
             <div class="index_foot_name">YOUQING</div>
             <div class="index_foot_name">友情链接</div>
             <div class="index_foot_name">LIANJIE</div>		
-        </div>
+        </div> -->
         <div class="foot_img_box"> 
             <a :href="item.url" v-for="(item, index) in bottomLink" :title="item.title" target="_blank">
                 <img :src="item.logo_url" :alt="item.title">
@@ -26,17 +26,15 @@
                 </NuxtLink>
             </span>
         </div>
-        <div class="foot_text_box">
-            <!-- <p>{{ bottomBase.statistics_onetext }} <a :href="'http://' + bottomBase.statistics_twourl">中农兴业</a> {{ bottomBase.statistics_twotext }}</p> -->
+        <div class="foot_text_box" v-if="bottomBase">
             <p>{{ bottomBase.statistics_onetext }} <a :href="bottomBase.record_number_url" :title="中农兴业">中农兴业</a> {{ bottomBase.statistics_twotext }}</p>
-            <p>{{ bottomBase.organizer }} <a :href="currentDomain" :title="三农资讯网">三农资讯网</a> {{ currentDomainUrl }} 版权所有。</p>
-            <!-- <p><img :src="bottomBase.icp_number_img"><a :href="'http://' + bottomBase.statistics_twourl">{{ bottomBase.record_number }}</a> <a :href="'http://' + bottomBase.icp_number_url">{{ bottomBase.icp_number }}</a> </p> -->
+            <p>{{ bottomBase.organizer }} <a :href="currentDomain" :title="webSiteName">{{ webSiteName }}</a> {{ currentDomainUrl }} 版权所有。</p>
             <p><a :href="bottomBase.record_number_url" title="ICP备案号">{{ bottomBase.record_number }}</a> &nbsp;&nbsp; <img :src="bottomBase.icp_number_img"><a :href="bottomBase.icp_number_url" title="京公网安备案号">{{ bottomBase.icp_number }}</a> </p>
             <p>{{ bottomBase.email }}</p>
             <p>{{ bottomBase.company_address }}</p>
             <p>{{ bottomBase.contact_number }}</p>
         </div>
-        <div class="foot_logo_out" >
+        <div class="foot_logo_out" v-if="bottomBase">
             <a :href="'http://' + bottomBase.company_url" :title="bottomBase.company_name">
                 <img :src="bottomBase.project_logo" class="floatLogoLeft" :alt="bottomBase.company_name">
             </a>
@@ -49,7 +47,7 @@
                 <img :src="item.logo_url" :alt="item.title">
             </a>
         </div>
- 		</footer>	
+ 	</footer>	
 </template>
 
 <script setup>
@@ -107,6 +105,7 @@ async function getModelData4() {
 getModelData4();
 //5.获得底部基本信息
 const bottomBase = ref({})
+const webSiteName = ref("")
 async function getModelData5() {
     const mkdata =  await requestDataPromise('/web/getWebsiteFootInfo', {
         method: 'GET',
@@ -114,6 +113,7 @@ async function getModelData5() {
         },
     });
     bottomBase.value = mkdata.data.website_foot;
+    webSiteName.value = mkdata.data.website_head.title;
 }
 getModelData5();
 

+ 3 - 3
components/home/foot1.vue

@@ -10,7 +10,7 @@
                 </NuxtLink>
             </span>
         </div>
-        <div class="foot_text_box">
+        <div class="foot_text_box" v-if="bottomBase">
            <!-- <p>{{ bottomBase.statistics_onetext }} <a :href="'http://' + bottomBase.statistics_twourl">中农兴业</a> {{ bottomBase.statistics_twotext }}</p> -->
            <p>{{ bottomBase.statistics_onetext }} <a :href="bottomBase.record_number_url" title="中农兴业">中农兴业</a> {{ bottomBase.statistics_twotext }}</p>
             <p>{{ bottomBase.organizer }} <a :href="currentDomain" title="三农资讯网">三农资讯网</a> {{ currentDomainUrl }} 版权所有。</p>
@@ -20,7 +20,7 @@
             <p>{{ bottomBase.company_address }}</p>
             <p>{{ bottomBase.contact_number }}</p>
         </div>
-        <div class="foot_logo_out" >
+        <div class="foot_logo_out" v-if="bottomBase">
             <a :href="'http://' + bottomBase.company_url" :title="bottomBase.company_name">
                 <img :src="bottomBase.project_logo" class="floatLogoLeft" :alt="bottomBase.company_name">
             </a>
@@ -33,7 +33,7 @@
                 <img :src="item.logo_url" alt="">
             </a>
         </div>
- 		</footer>	
+ 	</footer>	
 </template>
 
 <script setup>

+ 56 - 49
components/home/pageHead.vue

@@ -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 {

+ 3 - 11
components/home/pageNavigation.vue

@@ -147,20 +147,12 @@ let regionList = ref("")
 
 //选择省
 let areaArrList = async () => {
-    const { data: mkdata, error: mkdataError } =  requestData('/web/selectWebsiteArea', {
+    const mkdata =  await requestDataPromise('/web/selectWebsiteArea', {
         method: 'GET',
         query: {},
     });
-    if (mkdataError.value) {
-       //console.log()
-    } else {
-        console.log(department.value)
-        if (mkdata.value) {
-            console.log(mkdata.value)
-            //areaList.value = mkdata.value.data;
-            provinceList.value = mkdata.value.data;
-        }
-    }
+
+    provinceList.value = mkdata.data;
 }
 //一开始只需要获取一下省
 areaArrList();

+ 4 - 4
components/home/pageNavigation1.vue

@@ -95,9 +95,9 @@ let departmentList = async () => {
     if (mkdataError.value) {
        //console.log()
     } else {
-        console.log(department.value)
+        //console.log(department.value)
         if (mkdata.value) {
-            console.log(mkdata.value.data.department)
+            //console.log(mkdata.value.data.department)
             department.value = mkdata.value.data.department;
         }
     }
@@ -130,9 +130,9 @@ let areaArrList = async () => {
     if (mkdataError.value) {
        //console.log()
     } else {
-        console.log(department.value)
+        //console.log(department.value)
         if (mkdata.value) {
-            console.log(mkdata.value)
+            //console.log(mkdata.value)
             areaList.value = mkdata.value.data;
             provinceList.value = mkdata.value.data;
         }

+ 14 - 14
composables/getData.js

@@ -8,7 +8,7 @@ import { getToken } from '@/store/useCookieStore';
 // requestData方法 如果只是单一请求,可以直接调用这个方法
 function requestData(url, options = {}) {
     //获得全局变量中的webUrl和userUrl
-    const { $webUrl, $userUrl } = useNuxtApp()
+    const { $webUrl, $userUrl,$CwebUrl } = useNuxtApp()
     let fullUrl = $webUrl + url;
    
     // 生成唯一的 key
@@ -17,10 +17,10 @@ function requestData(url, options = {}) {
     // 设置默认的请求头
     const headers = {
         'Content-Type': 'application/json',
-        'Userurl': 'nwpre.bjzxtw.org.cn',
+        'Userurl': $CwebUrl,
         'token': getToken(),
         //'Origin': 'http://nwpre.bjzxtw.org.cn',//pre
-        'Origin':$userUrl,
+        'Origin': $CwebUrl,
     };
 
     // 确定请求方法
@@ -43,22 +43,22 @@ function requestData(url, options = {}) {
 function requestDataPromise(url, options = {}) {
     return new Promise(async (resolve, reject) => {
         //获得全局变量中的webUrl和userUrl
-        const { $webUrl, $userUrl } = useNuxtApp()
+        const { $webUrl, $userUrl , $CwebUrl } = useNuxtApp()
         let fullUrl = $webUrl + url;
 
         let key = `${url}-${JSON.stringify(options.query)}`;
 
-        console.log(555555555)
-        console.log(key)
+        // console.log(555555555)
+        // console.log(key)
         //let key =  "abc" 不能为固定值
         //let key = Math.random().toString(36).substring(2, 15); 不能为固定方法 都会留下缓存
 
         // 设置默认的请求头
         const headers = {
             'Content-Type': 'application/json',
-            'Userurl': 'nwpre.bjzxtw.org.cn',
+            'Userurl': $CwebUrl,
             'token': getToken(),
-            'Origin': $userUrl,
+            'Origin': $CwebUrl,
         };
 
         // 确定请求方法
@@ -92,7 +92,7 @@ function requestDataPromise(url, options = {}) {
 function requestDataWebUrl(url, options = {}) {
     return new Promise(async (resolve, reject) => {
         //获得全局变量中的webUrl和userUrl
-        const { $webUrl, $userUrl } = useNuxtApp()
+        const { $webUrl, $userUrl, $CwebUrl } = useNuxtApp()
         let fullUrl = `${url}`;
 
         // 生成唯一的 key
@@ -101,9 +101,9 @@ function requestDataWebUrl(url, options = {}) {
         // 设置默认的请求头
         const headers = {
             'Content-Type': 'application/json',
-            'Userurl': 'nwpre.bjzxtw.org.cn',
+            'Userurl': $CwebUrl,
             'token': getToken(),
-            'Origin': $userUrl,
+            'Origin': $CwebUrl,
         };
 
         // 确定请求方法
@@ -136,7 +136,7 @@ function requestDataWebUrl(url, options = {}) {
 function requestHome(url, options = {}) {
     return new Promise(async (resolve, reject) => {
         //获得全局变量中的webUrl和userUrl
-        const { $webUrl, $userUrl } = useNuxtApp()
+        const { $webUrl, $userUrl,$CwebUrl } = useNuxtApp()
         let fullUrl = $webUrl + url;
 
         let key = `${url}-${JSON.stringify(options.query)}`;
@@ -147,9 +147,9 @@ function requestHome(url, options = {}) {
         // 设置默认的请求头
         const headers = {
             'Content-Type': 'application/json',
-            'Userurl': 'nwpre.bjzxtw.org.cn',
+            'Userurl': $CwebUrl,
             'token': getToken(),
-            'Origin': $userUrl,
+            'Origin': $CwebUrl,
         };
 
         // 确定请求方法

+ 3 - 3
nuxt.config.js

@@ -3,10 +3,10 @@ export default defineNuxtConfig({
   ssr: true,
   app: {
     head: {
-      title: '三农资讯网',
+      title: '',
       meta: [
-        { name: 'description', content: '三农资讯网' },
-        { name: 'keywords', content: '三农资讯网' },
+        { name: 'description', content: '' },
+        { name: 'keywords', content: '' },
       ],
     },
   },

+ 13 - 13
pages/index.vue

@@ -98,11 +98,11 @@
                 </div>
                 <div class="scienceRight" v-if="pageData.length>=4">
                     <div class="adBox1" v-if="adImg3">
-                        <a href="http://nzgxw.org.cn/" title="三农资讯网_广告位3" v-if="adImg3.image_url==null" target="_blank">
-                            <img :src="adImg3.thumb" alt="三农资讯网_广告位3">
+                        <a href="http://nzgxw.org.cn/" v-if="adImg3.image_url==null" target="_blank">
+                            <img :src="adImg3.thumb" >
                         </a>
-                        <a :href="adImg3.image_url" title="三农资讯网_广告位3" v-else>
-                            <img :src="adImg3.image_src" alt="三农资讯网_广告位3">
+                        <a :href="adImg3.image_url" v-else>
+                            <img :src="adImg3.image_src">
                         </a>
                     </div>
                     <!-- 模块四 三农之窗 pagedata[3] -->
@@ -647,10 +647,10 @@
 
         <div class="titleBox" v-if="adImg5">
             <a href="http://nzgxw.org.cn/" v-if="adImg5.image_url==null" target="_blank">
-                <img :src="adImg5.thumb" alt="三农资讯网_广告位4">
+                <img :src="adImg5.thumb">
             </a>
             <a :href="adImg5.image_url" v-else target="_blank">
-                <img :src="adImg5.image_src" alt="三农资讯网_广告位4">
+                <img :src="adImg5.image_src">
             </a>
         </div>
 
@@ -1370,8 +1370,6 @@ async function getAdData(){
             }
             if(item.ad_tag == 'SNZXWT_INDEDX_0003'){
                 adImg3.value = item;
-                console.log(777888)
-                console.log(item.image_src==null)
             }
             if(item.ad_tag == 'SNZXWT_INDEDX_0004'){
                 adImg4.value = item;
@@ -1387,7 +1385,7 @@ async function getAdData(){
         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
     }
 }
-//getAdData();
+getAdData();
 //2.交互方法 end---------------------------------------->
 
 //3.页面基本信息 start---------------------------------------->
@@ -2041,12 +2039,14 @@ 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,
+        title: seoTitle + "_" + seoSuffix,
         meta: [
-            { name: 'description', content: seoDescription },
-            { name: 'keywords', content: seoKeywords }
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
         ]
     });
 }else{

+ 46 - 24
pages/newsDetail/[id].vue

@@ -89,18 +89,25 @@ async function getPageData() {
             'articleid': articleId
         },
     });
-    //获取内容
-    newsDetail.value = mkdata.data;
-    //获取路径
-    routLevelTitle.value = newsDetail.value.cat_name;
-    routLevelId.value = newsDetail.value.category_id;
-    //获取发布时间
-    time.value = newsDetail.value.updated_at.split(' ')[0];
-    //修正标题长度
-    if (newsDetail.value.title.length >= 30) {
-        routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
-    } else {
-        routeNewsTtitle.value = newsDetail.value.title
+    if(mkdata.code==200){
+        //获取内容
+        newsDetail.value = mkdata.data;
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.title.length >= 30) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.title
+        }
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:",mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
     }
 }
 getPageData();
@@ -110,7 +117,14 @@ getPageData();
 let adList = ref([]);
 async function getAdData(){
     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'DETAIL'}});
-    adList.value = adData.data;
+    if(adData.code==200){
+        adList.value = adData.data;
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情页广告列表")
+        console.log("后端错误反馈:",adData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
 }
 getAdData();
 //2.页面数据 end ---------------------------------------->
@@ -123,18 +137,26 @@ const setData =  await requestDataPromise('/web/selectWebsiteArticleInfo', {
         'articleid': articleId
     },
 });
+if(setData.code==200){
+    let seoTitle = setData.data.title;
+    let seoDescription = setData.data.introduce;
+    let seoKeywords = setData.data.keyword;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
 
-let seoTitle = setData.data.title + "_三农资讯网_全国政务信息一体化应用平台";
-let seoDescription = setData.data.introduce + "_三农资讯网_全国政务信息一体化应用平台";
-let seoKeywords = setData.data.keyword + "_三农资讯网_全国政务信息一体化应用平台";
-
-useSeoMeta({
-    title: seoTitle,
-    meta: [
-        { name: 'description', content: seoDescription },
-        { name: 'keywords', content: seoKeywords }
-    ]
-});
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
+        ]
+    });
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置详情页面SEO数据")
+    console.log("后端错误反馈:",setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
 //4.设置seo信息 end---------------------------------------->
 </script>
 

+ 46 - 14
pages/newsList/[id].vue

@@ -80,7 +80,14 @@ id.value = route.query.id;
 let adList = ref([]);
 async function getAdData(){
     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'LIST'}});
-    adList.value = adData.data;
+    if(adData.code==200){
+        adList.value = adData.data;
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取广告列表")
+        console.log("后端错误反馈:",adData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
 }
 getAdData();
 
@@ -95,8 +102,15 @@ let newslists = async () => {
             'catid':articleId
         },
     });
-    newsList.value = listData.data.rows;
-    total.value = listData.data.count;
+    if(listData.code==200){
+        newsList.value = listData.data.rows;
+        total.value = listData.data.count;
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:",listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
 }
 //获得列表
 newslists();
@@ -117,7 +131,14 @@ let getPageName = async () => {
             'catid': articleId
         },
     });
-    name.value = pageName.data.alias
+    if(pageName.code==200){
+        name.value = pageName.data.alias
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:设置页面标题")
+        console.log("后端错误反馈:",pageName.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
 }
 //获得列表
 getPageName();
@@ -133,17 +154,28 @@ const setData =  await requestDataPromise('/web/getWebsiteCategoryHead', {
     },
 });
 
-let seoTitle = setData.data.seo_title + "_三农资讯网_全国政务信息一体化应用平台";
-let seoDescription = setData.data.seo_description + "_三农资讯网_全国政务信息一体化应用平台";
-let seoKeywords = setData.data.seo_keywords + "_三农资讯网_全国政务信息一体化应用平台";
+if(setData.code == 200){
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
+        ]
+    });
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置列表页面SEO数据")
+    console.log("后端错误反馈:",setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
 
-useSeoMeta({
-    title: seoTitle,
-    meta: [
-        { name: 'description', content: seoDescription},
-        { name: 'keywords', content: seoKeywords}
-    ]
-});
 //4.设置seo信息 end---------------------------------------->
 </script>
 

+ 102 - 85
pages/primaryNavigation/[id].vue

@@ -686,13 +686,15 @@ let qhtabs = function (number) {
 //2.3 展示广告
 const adList = ref([]);
 async function getAdData(){
-    const mkdata = await requestDataPromise('/web/getWebsiteAdvertisement',{
-        method:'GET',
-        query:{
-            'ad_tag':'CATEGORY'
-        }
-    });
-    adList.value = mkdata.data;
+    const mkdata = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'CATEGORY'}});
+    if(mkdata.code == 200){
+        adList.value = mkdata.data;
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:分类页广告")
+        console.log("后端错误反馈:",mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
 }
 getAdData();
 //2.页面交互效果 end ---------------------------------------->
@@ -747,75 +749,83 @@ try {
             'num': 14
         },
     });
-    console.log("成功获取网站导航池!:", navigateData.data);
-    // 遍历可用的导航池放到页面中
-    for (let index in navigateData.data) {
-        let data = {
-            title: navigateData.data[index].name,
-            cid: navigateData.data[index].category_id,
-            children_count: navigateData.data[index].children_count,
-            alias: navigateData.data[index].alias,
-            data:[],
-            data1:[],
-            data2:[],
-            data3:[],
-            data4:[],
-            category_id1:"",
-            category_id2:"",
-            category_id3:"",
-            category_id4:"",
-            title1: "",
-            title2: "",
-            title3: "",
-            title4: ""
-        };
-        if (navigateData.data[index].is_url == 1) {
-            // 处理 URL 的逻辑
-        } else {
-            pageData.value.push(data);
+    if(navigateData.code == 200){
+        // 遍历可用的导航池放到页面中
+        for (let index in navigateData.data) {
+            let data = {
+                title: navigateData.data[index].name,
+                cid: navigateData.data[index].category_id,
+                children_count: navigateData.data[index].children_count,
+                alias: navigateData.data[index].alias,
+                data:[],
+                data1:[],
+                data2:[],
+                data3:[],
+                data4:[],
+                category_id1:"",
+                category_id2:"",
+                category_id3:"",
+                category_id4:"",
+                title1: "",
+                title2: "",
+                title3: "",
+                title4: ""
+            };
+            if (navigateData.data[index].is_url == 1) {
+                // 处理 URL 的逻辑
+            } else {
+                pageData.value.push(data);
+            }
         }
+        //导航池加载完毕,开始申请模块数据
+        await getPageData1();
+        await getPageData1_data2();
+        await getPageData1_data3();
+        await getPageData2();
+        await getPageData3();
+        await getPageData3_data2();
+        await getPageData4();
+        await getPageData4_data2();
+        await getPageData5();
+        await getPageData5_data2();
+        await getPageData6();
+        await getPageData6_data2();
+        await getPageData7();
+        await getPageData7_data2();
+        await getPageData8();
+        await getPageData9();
+        await getPageData10();
+        await getPageData11();
+        await getPageData12();
+        await getPageData12_data2();
+        await getPageData12_data3();
+        await getPageData13();
+        if(navSize.value>=1){
+            await getPageData13_data1();
+        }
+        if(navSize.value>=2){
+            await getPageData13_data2();
+        }
+        if(navSize.value>=3){
+            await getPageData13_data3();
+        }
+        if(navSize.value>=4){
+            await getPageData13_data4();
+        }
+        await getPageData14();
+        await getPageData14_data2();
+        await getPageData14_data3();
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:分类页导航池")
+        console.log("后端错误反馈:",navigateData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
     }
-
-    //导航池加载完毕,开始申请模块数据
-    await getPageData1();
-    await getPageData1_data2();
-    await getPageData1_data3();
-    await getPageData2();
-    await getPageData3();
-    await getPageData3_data2();
-    await getPageData4();
-    await getPageData4_data2();
-    await getPageData5();
-    await getPageData5_data2();
-    await getPageData6();
-    await getPageData6_data2();
-    await getPageData7();
-    await getPageData7_data2();
-    await getPageData8();
-    await getPageData9();
-    await getPageData10();
-    await getPageData11();
-    await getPageData12();
-    await getPageData12_data2();
-    await getPageData12_data3();
-    await getPageData13();
-    if(navSize.value>=1){
-        await getPageData13_data1();
-    }
-    if(navSize.value>=2){
-        await getPageData13_data2();
-    }
-    if(navSize.value>=3){
-        await getPageData13_data3();
-    }
-    if(navSize.value>=4){
-        await getPageData13_data4();
-    }
-    await getPageData14();
-    await getPageData14_data2();
-    await getPageData14_data3();
 } catch (error) {
-    console.error('获取页面导航失败!:', error);
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:分类页导航渲染阶段")
+    console.log("错误:导航池渲染执行接口出错!请检查首页的14的模块的具体执行方法!")
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
 
 //模块1
@@ -866,8 +876,6 @@ async function getPageData2() {
     pageData.value[1].data = mkdata.data;
 }
 
-
-
 //模块3
 async function getPageData3() {
     const mkdata =  await requestDataPromise('/web/getWebsiteModelArticles', {
@@ -1193,17 +1201,26 @@ const setData =  await requestDataPromise('/web/getWebsiteCategoryHead', {
     },
 });
 
-let seoTitle = setData.data.seo_title + "_三农资讯网_全国政务信息一体化应用平台";
-let seoDescription = setData.data.seo_description + "_三农资讯网_全国政务信息一体化应用平台";
-let seoKeywords = setData.data.seo_keywords + "_三农资讯网_全国政务信息一体化应用平台";
+if(setData.code == 200){
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
 
-useSeoMeta({
-    title: seoTitle,
-    meta: [
-        { name: 'description', content: seoDescription },
-        { name: 'keywords', content: seoKeywords }
-    ]
-});
+    useSeoMeta({
+        title: seoTitle + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
+        ]
+    });
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置分类页面SEO数据")
+    console.log("后端错误反馈:",setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
 //4.设置seo信息 end---------------------------------------->
 </script>
 

+ 5 - 3
pages/search/[id].vue

@@ -239,12 +239,14 @@ const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
 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,
+    title: seoTitle + "_" + seoSuffix,
     meta: [
-        { name: 'description', content: seoDescription },
-        { name: 'keywords', content: seoKeywords }
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
     ]
 });
 //4.设置seo信息 end---------------------------------------->

+ 5 - 3
pages/speciaArticle/[id].vue

@@ -118,12 +118,14 @@ const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
 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,
+    title: seoTitle + "_" + seoSuffix,
     meta: [
-        { name: 'description', content: seoDescription },
-        { name: 'keywords', content: seoKeywords }
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
     ]
 });
 //4.设置seo信息 end---------------------------------------->

+ 5 - 3
pages/specialList/[id].vue

@@ -126,12 +126,14 @@ const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
 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,
+    title: seoTitle + "_" + seoSuffix,
     meta: [
-        { name: 'description', content: seoDescription },
-        { name: 'keywords', content: seoKeywords }
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
     ]
 });
 //3.设置seo信息 end---------------------------------------->

+ 13 - 0
plugins/globals.js

@@ -4,6 +4,19 @@ export default defineNuxtPlugin((nuxtApp) => {
   nuxtApp.provide('CwebUrl', 'http://nwpre.bjzxtw.org.cn')
   nuxtApp.provide('BwebUrl', 'http://adminpre.bjzxtw.org.cn')
   nuxtApp.provide('userUrl', 'http://localhost:3000')
+  
+  //乡村网
+  // nuxtApp.provide('webUrl', 'http://apipre1.bjzxtw.org.cn:29501')
+  // nuxtApp.provide('CwebUrl', 'http://pre.china-village.com.cn')
+  // nuxtApp.provide('BwebUrl', 'http://adminpre.bjzxtw.org.cn')
+  // nuxtApp.provide('userUrl', 'http://localhost:3000')
+
+  //农民网
+  // nuxtApp.provide('webUrl', 'http://apipre1.bjzxtw.org.cn:29501')
+  // nuxtApp.provide('CwebUrl', 'http://pre.nmwwt.org')
+  // nuxtApp.provide('BwebUrl', 'http://adminpre.bjzxtw.org.cn')
+  // nuxtApp.provide('userUrl', 'http://localhost:3000')
+
   //Dev环境
   // nuxtApp.provide('webUrl', 'http://apidev.bjzxtw.org.cn')
   // nuxtApp.provide('CwebUrl', 'http://nwdev.bjzxtw.org.cn')