统一 HandsontablePro 液态筛选表头、批量输入与自动列增强;请求日志改用公共列表组件;同步收件地址解析与 H5/PC 下单相关改动。 Co-authored-by: Cursor <cursoragent@cursor.com>
255 lines
6.7 KiB
TypeScript
255 lines
6.7 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router';
|
|
import NProgress from 'nprogress'; // progress bar
|
|
import 'nprogress/nprogress.css';
|
|
|
|
import { appRoutes } from './routes';
|
|
import { REDIRECT_MAIN, NOT_FOUND_ROUTE } from './routes/base';
|
|
import createRouteGuard from './guard';
|
|
|
|
NProgress.configure({
|
|
showSpinner: false,
|
|
speed: 280,
|
|
minimum: 0.12,
|
|
trickleSpeed: 160,
|
|
}); // NProgress Configuration
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
name: 'login',
|
|
component: () => import('@/views/login/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
loginPortal: 'customer',
|
|
},
|
|
},
|
|
{
|
|
path: '/login',
|
|
redirect: (to) => ({ path: '/', query: to.query, hash: to.hash }),
|
|
},
|
|
{
|
|
path: '/admin',
|
|
name: 'adminLogin',
|
|
component: () => import('@/views/login/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
loginPortal: 'admin',
|
|
},
|
|
},
|
|
{
|
|
path: '/track/query',
|
|
name: 'H5TrackQuery',
|
|
component: () => import('@/views/h5/track-query/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
{
|
|
path: '/h5',
|
|
name: 'H5CustomerCenter',
|
|
component: () => import('@/views/h5/customer-center/layout.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
hideInMenu: true,
|
|
customerPortalOnly: true,
|
|
},
|
|
children: [
|
|
{
|
|
path: '',
|
|
name: 'H5CustomerCenterIndex',
|
|
redirect: () => {
|
|
const token =
|
|
localStorage.getItem('rbac_access_token') ||
|
|
localStorage.getItem('token');
|
|
return token ? '/h5/orders' : '/h5/login';
|
|
},
|
|
},
|
|
{
|
|
path: 'assistant',
|
|
name: 'H5Assistant',
|
|
component: () => import('@/views/h5/customer-center/assistant/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.tab.assistant',
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'price',
|
|
name: 'H5Price',
|
|
component: () => import('@/views/h5/customer-center/price/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.tab.price',
|
|
},
|
|
},
|
|
{
|
|
path: 'orders',
|
|
name: 'H5Orders',
|
|
component: () => import('@/views/h5/customer-center/orders/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.tab.orders',
|
|
},
|
|
},
|
|
{
|
|
path: 'orders/:id',
|
|
name: 'H5OrderDetail',
|
|
component: () => import('@/views/h5/customer-center/orders/detail.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.orders.detail.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'me',
|
|
name: 'H5Me',
|
|
component: () => import('@/views/h5/customer-center/me/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.tab.me',
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'login',
|
|
name: 'H5Login',
|
|
component: () => import('@/views/h5/customer-center/login/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
locale: 'h5.login.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'recharge',
|
|
name: 'H5Recharge',
|
|
component: () => import('@/views/h5/customer-center/recharge/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.recharge.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'place-order',
|
|
name: 'H5PlaceOrder',
|
|
component: () => import('@/views/h5/customer-center/place-order/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.placeOrder.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'coupons',
|
|
name: 'H5Coupons',
|
|
component: () => import('@/views/h5/customer-center/coupons/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.coupons.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'invite',
|
|
name: 'H5Invite',
|
|
component: () => import('@/views/h5/customer-center/invite/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.invite.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
{
|
|
path: 'commission',
|
|
name: 'H5Commission',
|
|
component: () => import('@/views/h5/customer-center/commission/index.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
locale: 'h5.commission.title',
|
|
h5HideTabBar: true,
|
|
h5HideHeader: true,
|
|
},
|
|
},
|
|
// 未知 /h5/* 回落客户中心,避免空白页
|
|
{
|
|
path: ':pathMatch(.*)*',
|
|
name: 'H5CustomerCenterFallback',
|
|
redirect: () => {
|
|
const token =
|
|
localStorage.getItem('rbac_access_token') ||
|
|
localStorage.getItem('token');
|
|
return token ? '/h5/orders' : '/h5/login';
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/wechat/register',
|
|
name: 'WechatRegister',
|
|
component: () => import('@/views/wechat/register/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
{
|
|
path: '/register',
|
|
name: 'CustomerRegister',
|
|
component: () => import('@/views/register/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
{
|
|
path: '/wechat/bind',
|
|
name: 'WechatBind',
|
|
component: () => import('@/views/wechat/bind/index.vue'),
|
|
meta: {
|
|
requiresAuth: false,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
{
|
|
path: '/oauth/platform-store/:platform',
|
|
name: 'PlatformStoreOAuthCallback',
|
|
component: () => import('@/views/order/platformStore/oauthCallback.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
{
|
|
path: '/Plugin/AddPackage',
|
|
name: 'PluginAddPackage',
|
|
component: () => import('@/views/plugin/AddPackage.vue'),
|
|
meta: {
|
|
requiresAuth: true,
|
|
hideInMenu: true,
|
|
},
|
|
},
|
|
...appRoutes,
|
|
REDIRECT_MAIN,
|
|
NOT_FOUND_ROUTE,
|
|
],
|
|
scrollBehavior() {
|
|
return { top: 0 };
|
|
},
|
|
});
|
|
|
|
createRouteGuard(router);
|
|
|
|
export default router;
|