|
|
@@ -1,5 +1,7 @@ |
|
|
|
import Vue from 'vue'; |
|
|
|
import { FastForwardIcon } from 'vue-feather-icons'; |
|
|
|
import VueRouter from 'vue-router'; |
|
|
|
import { apost } from '../utils/api/login' |
|
|
|
|
|
|
|
Vue.use(VueRouter); |
|
|
|
|
|
|
@@ -17,168 +19,168 @@ const routes = [ |
|
|
|
{ |
|
|
|
path: '/Dashboard', |
|
|
|
name: 'side-menu-dashboard', |
|
|
|
meta: {title: '会员中心'}, |
|
|
|
meta: { title: '会员中心' }, |
|
|
|
component: () => import('@/views/Dashboard') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'inbox', |
|
|
|
name: 'side-menu-inbox', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Inbox') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'file-manager', |
|
|
|
name: 'side-menu-file-manager', |
|
|
|
meta: {title: '文件管理'}, |
|
|
|
meta: { title: '文件管理' }, |
|
|
|
component: () => import('@/views/FileManager') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'point-of-sale', |
|
|
|
name: 'side-menu-point-of-sale', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/PointOfSale') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'chat', |
|
|
|
name: 'side-menu-chat', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Chat') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'post', |
|
|
|
name: 'side-menu-post', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Post') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'crud-data-list', |
|
|
|
name: 'side-menu-crud-data-list', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/CrudDataList') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'crud-form', |
|
|
|
name: 'side-menu-crud-form', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/CrudForm') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'users-layout-1', |
|
|
|
name: 'side-menu-users-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/UsersLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'users-layout-2', |
|
|
|
name: 'side-menu-users-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/UsersLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'users-layout-3', |
|
|
|
name: 'side-menu-users-layout-3', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/UsersLayout3') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'profile-overview-1', |
|
|
|
name: 'side-menu-profile-overview-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/ProfileOverview1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'profile-overview-2', |
|
|
|
name: 'side-menu-profile-overview-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/ProfileOverview2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'profile-overview-3', |
|
|
|
name: 'side-menu-profile-overview-3', |
|
|
|
component: () => import('@/views/ProfileOverview3') |
|
|
|
path: 'profile-overview-3', |
|
|
|
name: 'side-menu-profile-overview-3', |
|
|
|
component: () => import('@/views/ProfileOverview3') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'wizard-layout-1', |
|
|
|
name: 'side-menu-wizard-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/WizardLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'wizard-layout-2', |
|
|
|
name: 'side-menu-wizard-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/WizardLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'wizard-layout-3', |
|
|
|
name: 'side-menu-wizard-layout-3', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/WizardLayout3') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'blog-layout-1', |
|
|
|
name: 'side-menu-blog-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/BlogLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'blog-layout-2', |
|
|
|
name: 'side-menu-blog-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/BlogLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'blog-layout-3', |
|
|
|
name: 'side-menu-blog-layout-3', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/BlogLayout3') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'pricing-layout-1', |
|
|
|
name: 'side-menu-pricing-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/PricingLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'pricing-layout-2', |
|
|
|
name: 'side-menu-pricing-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/PricingLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'invoice-layout-1', |
|
|
|
name: 'side-menu-invoice-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/InvoiceLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'invoice-layout-2', |
|
|
|
name: 'side-menu-invoice-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/InvoiceLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'faq-layout-1', |
|
|
|
name: 'side-menu-faq-layout-1', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/FaqLayout1') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'faq-layout-2', |
|
|
|
name: 'side-menu-faq-layout-2', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/FaqLayout2') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'faq-layout-3', |
|
|
|
name: 'side-menu-faq-layout-3', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/FaqLayout3') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'update-profile', |
|
|
|
name: 'side-menu-update-profile', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/UpdateProfile') |
|
|
|
}, |
|
|
|
{ |
|
|
@@ -189,157 +191,157 @@ const routes = [ |
|
|
|
{ |
|
|
|
path: 'regular-table', |
|
|
|
name: 'side-menu-regular-table', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/RegularTable') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'tabulator', |
|
|
|
name: 'side-menu-tabulator', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Tabulator') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'accordion', |
|
|
|
name: 'side-menu-accordion', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Accordion') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'button', |
|
|
|
name: 'side-menu-button', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Button') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'modal', |
|
|
|
name: 'side-menu-modal', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Modal') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'alert', |
|
|
|
name: 'side-menu-alert', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Alert') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'progress-bar', |
|
|
|
name: 'side-menu-progress-bar', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/ProgressBar') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'tooltip', |
|
|
|
name: 'side-menu-tooltip', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Tooltip') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'dropdown', |
|
|
|
name: 'side-menu-dropdown', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Dropdown') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'toast', |
|
|
|
name: 'side-menu-toast', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Toast') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'typography', |
|
|
|
name: 'side-menu-typography', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Typography') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'icon', |
|
|
|
name: 'side-menu-icon', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Icon') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'loading-icon', |
|
|
|
name: 'side-menu-loading-icon', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/LoadingIcon') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'regular-form', |
|
|
|
name: 'side-menu-regular-form', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/RegularForm') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'datepicker', |
|
|
|
name: 'side-menu-datepicker', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Datepicker') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'tail-select', |
|
|
|
name: 'side-menu-tail-select', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/TailSelect') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'file-upload', |
|
|
|
name: 'side-menu-file-upload', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/FileUpload') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'wysiwyg-editor', |
|
|
|
name: 'side-menu-wysiwyg-editor', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/WysiwygEditor') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'validation', |
|
|
|
name: 'side-menu-validation', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Validation') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'chart', |
|
|
|
name: 'side-menu-chart', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Chart') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'slider', |
|
|
|
name: 'side-menu-slider', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Slider') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'image-zoom', |
|
|
|
name: 'side-menu-image-zoom', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/ImageZoom') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'profile', |
|
|
|
name: 'profile', |
|
|
|
meta: {title: '个人资料'}, |
|
|
|
meta: { title: '个人资料' }, |
|
|
|
component: () => import('@/views/Profile') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'invitation', |
|
|
|
name: 'invitation', |
|
|
|
meta: {title: '邀请赚钱'}, |
|
|
|
meta: { title: '邀请赚钱' }, |
|
|
|
component: () => import('@/views/Invitation') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'app', |
|
|
|
name: 'app', |
|
|
|
meta: {title: '应用中心'}, |
|
|
|
meta: { title: '应用中心' }, |
|
|
|
component: () => import('@/views/App') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: 'myApp', |
|
|
|
name: 'my-app', |
|
|
|
meta: {title: '我的应用'}, |
|
|
|
meta: { title: '我的应用' }, |
|
|
|
component: () => import('@/views/MyApp') |
|
|
|
} |
|
|
|
] |
|
|
@@ -347,19 +349,19 @@ const routes = [ |
|
|
|
{ |
|
|
|
path: '/test', |
|
|
|
name: 'test', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Inbox') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: '/register', |
|
|
|
name: 'register', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/Register') |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: '/404', |
|
|
|
name: 'error-page', |
|
|
|
meta: {title: '管理中心'}, |
|
|
|
meta: { title: '管理中心' }, |
|
|
|
component: () => import('@/views/ErrorPage') |
|
|
|
}, |
|
|
|
{ |
|
|
@@ -377,14 +379,27 @@ const router = new VueRouter({ |
|
|
|
if (savedPosition) { |
|
|
|
return savedPosition; |
|
|
|
} else { |
|
|
|
return {x: 0, y: 0}; |
|
|
|
return { x: 0, y: 0 }; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
router.beforeEach((to, from, next) => { |
|
|
|
document.title = to.meta.title ? to.meta.title + ' - ZhiOS智莺' : 'ZhiOS智莺' |
|
|
|
if (to.path === '/') { |
|
|
|
apost("/api/sign/status").then((res) => { |
|
|
|
|
|
|
|
next('/Dashboard') |
|
|
|
// 用户登录未失效, 直接跳转到会员中心页面 |
|
|
|
}).catch(err=>{ |
|
|
|
return |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
next() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default router; |