yuanyuan 3 lat temu
rodzic
commit
47a4b332c9

+ 11 - 0
src/main/zhi-rong-web/src/components/PageHeader.vue

@@ -406,6 +406,7 @@ export default {
         });
         });
     },
     },
     computed: {
     computed: {
+        ...mapState(['loginHome']),
         newsLists() {
         newsLists() {
             return [...this.newsList].filter((item, index) => {
             return [...this.newsList].filter((item, index) => {
                 return index < 4;
                 return index < 4;
@@ -426,7 +427,14 @@ export default {
                 : 'https://baixiaip.oss-cn-hangzhou.aliyuncs.com/image/2022-09-06-17-04-39jfwMIPtC.png';
                 : 'https://baixiaip.oss-cn-hangzhou.aliyuncs.com/image/2022-09-06-17-04-39jfwMIPtC.png';
         }
         }
     },
     },
+
     watch: {
     watch: {
+        loginHome() {
+            console.log('3846467a');
+            if (this.loginHome) {
+                this.$refs.registrationReset.login = true;
+            }
+        },
         $route() {
         $route() {
             if (
             if (
                 this.$route.name == 'newsDetail' ||
                 this.$route.name == 'newsDetail' ||
@@ -484,6 +492,9 @@ export default {
         } else {
         } else {
             this.toMeta = false;
             this.toMeta = false;
         }
         }
+        if (this.loginHome) {
+            this.$refs.registrationReset.login = true;
+        }
     },
     },
     methods: {
     methods: {
         navigation() {
         navigation() {

+ 21 - 14
src/main/zhi-rong-web/src/mixins/common.js

@@ -1,5 +1,7 @@
 import dayjs from 'dayjs';
 import dayjs from 'dayjs';
-import { checkSetting } from '../utils/getVariables.js'
+import {
+    checkSetting
+} from '../utils/getVariables.js'
 export default {
 export default {
     computed: {
     computed: {
         isLogin() {
         isLogin() {
@@ -103,7 +105,7 @@ export default {
                     phone: phone,
                     phone: phone,
                     code: code
                     code: code
                 })
                 })
-                .then(() => { })
+                .then(() => {})
                 .catch(e => {
                 .catch(e => {
                     this.$message.error(e.error);
                     this.$message.error(e.error);
                 });
                 });
@@ -111,13 +113,16 @@ export default {
         checkLogin(checkAuth = false) {
         checkLogin(checkAuth = false) {
             if (!this.isLogin) {
             if (!this.isLogin) {
                 this.$confirm('用户未登录,是否立即登录', '提示', {
                 this.$confirm('用户未登录,是否立即登录', '提示', {
-                    confirmButtonText: '立即登录',
-                    cancelButtonText: '取消'
-                })
+                        confirmButtonText: '立即登录',
+                        cancelButtonText: '取消'
+                    })
                     .then(() => {
                     .then(() => {
-                        this.$router.push({name:"home", query: {loginVerification: true}})
+                        this.$store.commit('loginVerification', true);
+                        this.$router.push({
+                            name: "home"
+                        });
                     })
                     })
-                    .catch(() => { });
+                    .catch(() => {});
 
 
                 return Promise.reject({
                 return Promise.reject({
                     error: '未登录'
                     error: '未登录'
@@ -128,9 +133,9 @@ export default {
                     return Promise.resolve();
                     return Promise.resolve();
                 } else {
                 } else {
                     this.$confirm('用户未认证,是否立即认证', '提示', {
                     this.$confirm('用户未认证,是否立即认证', '提示', {
-                        confirmButtonText: '立即认证',
-                        cancelButtonText: '取消'
-                    })
+                            confirmButtonText: '立即认证',
+                            cancelButtonText: '取消'
+                        })
                         .then(() => {
                         .then(() => {
                             this.$router.push('/userEdit')
                             this.$router.push('/userEdit')
                             // if (this.$store.state.personalInfo && info.status === 'PENDING') {
                             // if (this.$store.state.personalInfo && info.status === 'PENDING') {
@@ -147,7 +152,7 @@ export default {
                             //     this.$router.push('/authentications');
                             //     this.$router.push('/authentications');
                             // }
                             // }
                         })
                         })
-                        .catch(() => { });
+                        .catch(() => {});
                     return Promise.reject({
                     return Promise.reject({
                         error: '未认证'
                         error: '未认证'
                     });
                     });
@@ -161,13 +166,15 @@ export default {
                 this.$alert(res.value, '提示', {
                 this.$alert(res.value, '提示', {
                     confirmButtonText: '确定',
                     confirmButtonText: '确定',
                     center: true,
                     center: true,
-                    callback: () => { }
+                    callback: () => {}
                 });
                 });
             });
             });
         },
         },
         getSetting(flag = 1, keyName) {
         getSetting(flag = 1, keyName) {
             return this.$http
             return this.$http
-                .post('/setting/byFlag', { flag: flag })
+                .post('/setting/byFlag', {
+                    flag: flag
+                })
                 .then(res => {
                 .then(res => {
                     let list = res.map(item => {
                     let list = res.map(item => {
                         return {
                         return {
@@ -188,4 +195,4 @@ export default {
             checkSetting(list, this.getSetting)
             checkSetting(list, this.getSetting)
         }
         }
     }
     }
-};
+};

+ 22 - 24
src/main/zhi-rong-web/src/router/index.js

@@ -6,19 +6,19 @@ VueRouter.prototype.push = function push(location) {
     return originalPush.call(this, location).catch(err => err);
     return originalPush.call(this, location).catch(err => err);
 };
 };
 import store from '../store';
 import store from '../store';
-import { MessageBox } from 'element-ui';
+import {
+    MessageBox
+} from 'element-ui';
 Vue.use(VueRouter);
 Vue.use(VueRouter);
 
 
-const routes = [
-    {
+const routes = [{
         path: '/',
         path: '/',
         redirect: 'home'
         redirect: 'home'
     },
     },
     {
     {
         path: '/',
         path: '/',
         component: () => import('../views/Index.vue'),
         component: () => import('../views/Index.vue'),
-        children: [
-            {
+        children: [{
                 path: '/home',
                 path: '/home',
                 name: 'home',
                 name: 'home',
                 component: () => import('../views/Home.vue'),
                 component: () => import('../views/Home.vue'),
@@ -125,8 +125,7 @@ const routes = [
             {
             {
                 path: '/',
                 path: '/',
                 component: () => import('../views/legal/Index.vue'),
                 component: () => import('../views/legal/Index.vue'),
-                children: [
-                    {
+                children: [{
                         path: '/policy',
                         path: '/policy',
                         name: 'policy',
                         name: 'policy',
                         component: () => import('../views/legal/Policy.vue'),
                         component: () => import('../views/legal/Policy.vue'),
@@ -185,8 +184,7 @@ const routes = [
             {
             {
                 path: '/',
                 path: '/',
                 component: () => import('../views/market/Index.vue'),
                 component: () => import('../views/market/Index.vue'),
-                children: [
-                    {
+                children: [{
                         path: '/patent',
                         path: '/patent',
                         name: 'patent',
                         name: 'patent',
                         component: () => import('../views/market/Patent.vue'),
                         component: () => import('../views/market/Patent.vue'),
@@ -601,8 +599,7 @@ const routes = [
             {
             {
                 path: '/',
                 path: '/',
                 component: () => import('../views/user/UserMain.vue'),
                 component: () => import('../views/user/UserMain.vue'),
-                children: [
-                    {
+                children: [{
                         path: '/userEdit',
                         path: '/userEdit',
                         name: 'userEdit',
                         name: 'userEdit',
                         component: () => import('../views/user/UserEdit.vue'),
                         component: () => import('../views/user/UserEdit.vue'),
@@ -977,13 +974,14 @@ router.beforeEach((to, from, next) => {
                 if (to.meta.checkLogin) {
                 if (to.meta.checkLogin) {
                     next(false);
                     next(false);
                     MessageBox.confirm('用户未登录,是否立即登录', '提示', {
                     MessageBox.confirm('用户未登录,是否立即登录', '提示', {
-                        confirmButtonText: '立即登录',
-                        cancelButtonText: '取消'
-                    })
+                            confirmButtonText: '立即登录',
+                            cancelButtonText: '取消'
+                        })
                         .then(() => {
                         .then(() => {
-                            // router.push('/login');
-                            // router.push({name:"/home", params: {loginVerification: true}})
-                            router.push({name:"home", query: {loginVerification: true}})
+                            this.$store.commit('loginVerification', true);
+                            router.push({
+                                name: "home"
+                            })
                         })
                         })
                         .catch(() => {});
                         .catch(() => {});
                     // next('/login');
                     // next('/login');
@@ -993,9 +991,9 @@ router.beforeEach((to, from, next) => {
                         next(false);
                         next(false);
 
 
                         MessageBox.confirm('用户未认证,是否立即认证', '提示', {
                         MessageBox.confirm('用户未认证,是否立即认证', '提示', {
-                            confirmButtonText: '立即认证',
-                            cancelButtonText: '取消'
-                        })
+                                confirmButtonText: '立即认证',
+                                cancelButtonText: '取消'
+                            })
                             .then(() => {
                             .then(() => {
                                 router.push('/userEdit')
                                 router.push('/userEdit')
                                 // if (store.state.personalInfo && info.status === 'PENDING') {
                                 // if (store.state.personalInfo && info.status === 'PENDING') {
@@ -1035,9 +1033,9 @@ router.beforeEach((to, from, next) => {
             next(false);
             next(false);
 
 
             MessageBox.confirm('用户未认证,是否立即认证', '提示', {
             MessageBox.confirm('用户未认证,是否立即认证', '提示', {
-                confirmButtonText: '立即认证',
-                cancelButtonText: '取消'
-            })
+                    confirmButtonText: '立即认证',
+                    cancelButtonText: '取消'
+                })
                 .then(() => {
                 .then(() => {
                     router.push('/userEdit')
                     router.push('/userEdit')
                     // console.log(store.state.personalInfo);
                     // console.log(store.state.personalInfo);
@@ -1073,4 +1071,4 @@ router.beforeEach((to, from, next) => {
     }
     }
 });
 });
 
 
-export default router;
+export default router;

+ 6 - 1
src/main/zhi-rong-web/src/store/index.js

@@ -13,9 +13,14 @@ export default new Vuex.Store({
         personalInfo: null,
         personalInfo: null,
         showAdd: false,
         showAdd: false,
         flag: 0,
         flag: 0,
+        loginHome: false
         // loginType: false
         // loginType: false
     },
     },
     mutations: {
     mutations: {
+        loginVerification(state, loginHome) {
+            console.log(loginHome)
+            state.loginHome = loginHome
+        },
         modifyFlag(state, flag) {
         modifyFlag(state, flag) {
             state.flag = flag;
             state.flag = flag;
         },
         },
@@ -74,4 +79,4 @@ export default new Vuex.Store({
             });
             });
         }
         }
     }
     }
-});
+});

+ 14 - 7
src/main/zhi-rong-web/src/views/Home.vue

@@ -209,7 +209,12 @@
                         </div> -->
                         </div> -->
                     </div>
                     </div>
                     <div class="center-content_con_right_list">
                     <div class="center-content_con_right_list">
-                        <div class="center-content_con_right_list_con" v-for="item in supplyPatent" :key="item.id" @click="supplyPatents(item.id)">
+                        <div
+                            class="center-content_con_right_list_con"
+                            v-for="item in supplyPatent"
+                            :key="item.id"
+                            @click="supplyPatents(item.id)"
+                        >
                             <!-- <div style="margin-right: 20px">{{ formatTime(item.createdAt, 'YYYY.MM.DD') }}</div> -->
                             <!-- <div style="margin-right: 20px">{{ formatTime(item.createdAt, 'YYYY.MM.DD') }}</div> -->
                             <!-- <div class="center-content_con_right_list_con_One">
                             <!-- <div class="center-content_con_right_list_con_One">
                                 <div class="center-content_con_right_list_con_One_a">专利类型: {{ item.name }}</div>
                                 <div class="center-content_con_right_list_con_One_a">专利类型: {{ item.name }}</div>
@@ -241,7 +246,12 @@
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="center-content_con_right_list">
                     <div class="center-content_con_right_list">
-                        <div class="center-content_con_right_list_con" v-for="item in demandPatent" :key="item.id" @click="demandPatents(item.id)">
+                        <div
+                            class="center-content_con_right_list_con"
+                            v-for="item in demandPatent"
+                            :key="item.id"
+                            @click="demandPatents(item.id)"
+                        >
                             <!-- <div style="margin-right: 20px">{{ formatTime(item.createdAt, 'YYYY.MM.DD') }}</div> -->
                             <!-- <div style="margin-right: 20px">{{ formatTime(item.createdAt, 'YYYY.MM.DD') }}</div> -->
                             <!-- <div class="center-content_con_right_list_con_One">
                             <!-- <div class="center-content_con_right_list_con_One">
                                 <div class="center-content_con_right_list_con_One_a">专利类型: {{ item.name }}</div>
                                 <div class="center-content_con_right_list_con_One_a">专利类型: {{ item.name }}</div>
@@ -500,9 +510,6 @@ export default {
             this.demands = res;
             this.demands = res;
         });
         });
     },
     },
-    mounted() {
-        console.log(this.$route.query.loginVerification);
-    },
     methods: {
     methods: {
         handleClick(item) {
         handleClick(item) {
             this.active = item;
             this.active = item;
@@ -642,10 +649,10 @@ export default {
                 this.$router.push('/techProductDemand?tpType=PRODUCT');
                 this.$router.push('/techProductDemand?tpType=PRODUCT');
             }
             }
         },
         },
-        supplyPatents(id){
+        supplyPatents(id) {
             this.$router.push({ name: 'patentDetail', query: { id: id } });
             this.$router.push({ name: 'patentDetail', query: { id: id } });
         },
         },
-        demandPatents(id){
+        demandPatents(id) {
             this.$router.push({ name: 'patentDemandDetail', query: { id: id } });
             this.$router.push({ name: 'patentDemandDetail', query: { id: id } });
         },
         },
         changeCarousl() {
         changeCarousl() {