Commit c25bba40 authored by lvweichao's avatar lvweichao

update: static file router

parent 63e70c36
...@@ -10,7 +10,7 @@ const goods = require('./controllers/goods'); ...@@ -10,7 +10,7 @@ const goods = require('./controllers/goods');
const router = Router(); const router = Router();
const API_VERSION = "/api/v1"; const API_VERSION = "/api/v1";
router.get('/', static.index) router.get(/^\/op.*/, static.index)
router.get(`${API_VERSION}/fetch_user`, system.fetch_user); router.get(`${API_VERSION}/fetch_user`, system.fetch_user);
router.get(`${API_VERSION}/user/:type`, user.query) router.get(`${API_VERSION}/user/:type`, user.query)
......
...@@ -4,22 +4,22 @@ export const HEADER_CONFIG = { ...@@ -4,22 +4,22 @@ export const HEADER_CONFIG = {
logo: 'http://si1.go2yd.com/get-image/0ZAJxXeZ6iu', logo: 'http://si1.go2yd.com/get-image/0ZAJxXeZ6iu',
menuItems: [ menuItems: [
{ {
path: '/enterprise/certification', path: '/op/enterprise/certification',
name: '企业认证管理', name: '企业认证管理',
key: 'enterprise', key: 'enterprise',
}, },
{ {
path: '/lifeNo', path: '/op/lifeNo',
name: '生活号管理', name: '生活号管理',
key: 'lifeNo', key: 'lifeNo',
}, },
{ {
path: '/roleManageRole', path: '/op/roleManageRole',
name: '角色管理', name: '角色管理',
key: 'role', key: 'role',
}, },
{ {
path: '/user', path: '/op/user',
name: '用户管理', name: '用户管理',
key: 'user', key: 'user',
} }
......
...@@ -32,7 +32,7 @@ router.beforeResolve(async (to, from, next) => { ...@@ -32,7 +32,7 @@ router.beforeResolve(async (to, from, next) => {
} }
if (!checkPathAuth(to.path)) { if (!checkPathAuth(to.path)) {
router.push('/403') router.push({name: 'Forbidden'})
} else { } else {
next() next()
} }
......
const headerConfig = [ const headerConfig = [
{ {
name: "商品管理", name: "商品管理",
path: "/goods/list" path: "/op/goods/list"
}, },
{ {
name: "分销", name: "分销",
path: "/goods/retail" path: "/op/goods/retail"
}, },
]; ];
......
...@@ -3,17 +3,21 @@ ...@@ -3,17 +3,21 @@
*/ */
const goodsRouters = [ const goodsRouters = [
{ {
path: "/goods/list", path: "/op/goods",
redirect: "/op/goods/list"
},
{
path: "/op/goods/list",
name: "GoodsList", name: "GoodsList",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/List") component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/List")
}, },
{ {
path: "/goods/detail", path: "/op/goods/detail",
name: "GoodsDetail", name: "GoodsDetail",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/Detail") component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/Detail")
}, },
{ {
path: "/goods/retail", path: "/op/goods/retail",
name: "GoodsRetail", name: "GoodsRetail",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/Retail") component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/Retail")
} }
......
import { createRouter, createWebHashHistory } from "vue-router"; import { createRouter, createWebHistory } from "vue-router";
import LifeNo from "../pages/Life-no/index.vue"; import LifeNo from "../pages/Life-no/index.vue";
import LifeNoDetail from "../pages/Life-no/life-no-detail.vue"; import LifeNoDetail from "../pages/Life-no/life-no-detail.vue";
...@@ -13,24 +13,24 @@ import goodsRouter from "./Goods/index"; ...@@ -13,24 +13,24 @@ import goodsRouter from "./Goods/index";
const routes = [ const routes = [
{ {
path: "/", path: "/op/enterprise",
redirect: "/enterprise/certification" redirect: "/enterprise/certification"
}, },
{ {
path: "/404", path: "/op/404",
name: "NotFound", name: "NotFound",
component: () => component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/notFound") import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/notFound")
}, },
{ {
path: "/403", path: "/op/403",
name: "Forbidden", name: "Forbidden",
component: () => component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/forbidden") import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/forbidden")
}, },
// 企业认证管理 // 企业认证管理
{ {
path: "/enterprise/certification", path: "/op/enterprise/certification",
name: "Certification", name: "Certification",
component: () => component: () =>
import( import(
...@@ -41,7 +41,7 @@ const routes = [ ...@@ -41,7 +41,7 @@ const routes = [
} }
}, },
{ {
path: "/enterprise/audit", path: "/op/enterprise/audit",
name: "Audit", name: "Audit",
component: () => component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Enterprise/Audit"), import(/* webpackChunkName: "enterprise" */ "@/pages/Enterprise/Audit"),
...@@ -50,7 +50,7 @@ const routes = [ ...@@ -50,7 +50,7 @@ const routes = [
} }
}, },
{ {
path: "/enterprise/establish", path: "/op/enterprise/establish",
name: "Establish", name: "Establish",
component: () => component: () =>
import( import(
...@@ -62,7 +62,7 @@ const routes = [ ...@@ -62,7 +62,7 @@ const routes = [
}, },
//生活号管理 //生活号管理
{ {
path: "/lifeNo", path: "/op/lifeNo",
name: "LifeNo", name: "LifeNo",
component: LifeNo, component: LifeNo,
meta: { meta: {
...@@ -70,24 +70,24 @@ const routes = [ ...@@ -70,24 +70,24 @@ const routes = [
} }
}, },
{ {
path: "/lifeNoDetail", path: "/op/lifeNoDetail",
name: "LifeNoDetail", name: "LifeNoDetail",
component: LifeNoDetail component: LifeNoDetail
}, },
//用户管理 //用户管理
{ {
path: "/user", path: "/op/user",
name: "User", name: "/op/User",
component: User component: User
}, },
{ {
path: "/userDetail", path: "/op/userDetail",
name: "UserDetail", name: "UserDetail",
component: UserDetail component: UserDetail
}, },
//角色管理 //角色管理
{ {
path: "/roleAddRole", path: "/op/roleAddRole",
name: "AddRole", name: "AddRole",
component: AddRole, component: AddRole,
meta: { meta: {
...@@ -96,7 +96,7 @@ const routes = [ ...@@ -96,7 +96,7 @@ const routes = [
} }
}, },
{ {
path: "/roleManageRole", path: "/op/roleManageRole",
name: "ManageRole", name: "ManageRole",
component: ManageRole, component: ManageRole,
meta: { meta: {
...@@ -105,7 +105,7 @@ const routes = [ ...@@ -105,7 +105,7 @@ const routes = [
} }
}, },
{ {
path: "/roleRoleDetail", path: "/op/roleRoleDetail",
name: "RoleDetail", name: "RoleDetail",
component: RoleDetail, component: RoleDetail,
meta: { meta: {
...@@ -118,7 +118,7 @@ const routes = [ ...@@ -118,7 +118,7 @@ const routes = [
console.log(routes); console.log(routes);
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(), history: createWebHistory(),
routes routes
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment