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