Commit c25bba40 authored by lvweichao's avatar lvweichao

update: static file router

parent 63e70c36
......@@ -10,7 +10,7 @@ const goods = require('./controllers/goods');
const router = Router();
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}/user/:type`, user.query)
......
......@@ -4,22 +4,22 @@ export const HEADER_CONFIG = {
logo: 'http://si1.go2yd.com/get-image/0ZAJxXeZ6iu',
menuItems: [
{
path: '/enterprise/certification',
path: '/op/enterprise/certification',
name: '企业认证管理',
key: 'enterprise',
},
{
path: '/lifeNo',
path: '/op/lifeNo',
name: '生活号管理',
key: 'lifeNo',
},
{
path: '/roleManageRole',
path: '/op/roleManageRole',
name: '角色管理',
key: 'role',
},
{
path: '/user',
path: '/op/user',
name: '用户管理',
key: 'user',
}
......
......@@ -32,7 +32,7 @@ router.beforeResolve(async (to, from, next) => {
}
if (!checkPathAuth(to.path)) {
router.push('/403')
router.push({name: 'Forbidden'})
} else {
next()
}
......
const headerConfig = [
{
name: "商品管理",
path: "/goods/list"
path: "/op/goods/list"
},
{
name: "分销",
path: "/goods/retail"
path: "/op/goods/retail"
},
];
......
......@@ -3,17 +3,21 @@
*/
const goodsRouters = [
{
path: "/goods/list",
path: "/op/goods",
redirect: "/op/goods/list"
},
{
path: "/op/goods/list",
name: "GoodsList",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/List")
},
{
path: "/goods/detail",
path: "/op/goods/detail",
name: "GoodsDetail",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Goods/Detail")
},
{
path: "/goods/retail",
path: "/op/goods/retail",
name: "GoodsRetail",
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 LifeNoDetail from "../pages/Life-no/life-no-detail.vue";
......@@ -13,24 +13,24 @@ import goodsRouter from "./Goods/index";
const routes = [
{
path: "/",
path: "/op/enterprise",
redirect: "/enterprise/certification"
},
{
path: "/404",
path: "/op/404",
name: "NotFound",
component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/notFound")
},
{
path: "/403",
path: "/op/403",
name: "Forbidden",
component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Catch/forbidden")
},
// 企业认证管理
{
path: "/enterprise/certification",
path: "/op/enterprise/certification",
name: "Certification",
component: () =>
import(
......@@ -41,7 +41,7 @@ const routes = [
}
},
{
path: "/enterprise/audit",
path: "/op/enterprise/audit",
name: "Audit",
component: () =>
import(/* webpackChunkName: "enterprise" */ "@/pages/Enterprise/Audit"),
......@@ -50,7 +50,7 @@ const routes = [
}
},
{
path: "/enterprise/establish",
path: "/op/enterprise/establish",
name: "Establish",
component: () =>
import(
......@@ -62,7 +62,7 @@ const routes = [
},
//生活号管理
{
path: "/lifeNo",
path: "/op/lifeNo",
name: "LifeNo",
component: LifeNo,
meta: {
......@@ -70,24 +70,24 @@ const routes = [
}
},
{
path: "/lifeNoDetail",
path: "/op/lifeNoDetail",
name: "LifeNoDetail",
component: LifeNoDetail
},
//用户管理
{
path: "/user",
name: "User",
path: "/op/user",
name: "/op/User",
component: User
},
{
path: "/userDetail",
path: "/op/userDetail",
name: "UserDetail",
component: UserDetail
},
//角色管理
{
path: "/roleAddRole",
path: "/op/roleAddRole",
name: "AddRole",
component: AddRole,
meta: {
......@@ -96,7 +96,7 @@ const routes = [
}
},
{
path: "/roleManageRole",
path: "/op/roleManageRole",
name: "ManageRole",
component: ManageRole,
meta: {
......@@ -105,7 +105,7 @@ const routes = [
}
},
{
path: "/roleRoleDetail",
path: "/op/roleRoleDetail",
name: "RoleDetail",
component: RoleDetail,
meta: {
......@@ -118,7 +118,7 @@ const routes = [
console.log(routes);
const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
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