Browse Source

1.0.0:修改动态路由

master
chengkun 4 years ago
parent
commit
1c48e399e4
  1. 2
      .env.development
  2. 2
      .env.staging
  3. 65
      src/router/index.js
  4. 2
      vue.config.js

2
.env.development

@ -4,7 +4,7 @@ VUE_APP_TITLE = bnyer管理系统
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 若依管理系统/开发环境 # bnyer管理系统/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
# 路由懒加载 # 路由懒加载

2
.env.staging

@ -6,5 +6,5 @@ NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
# 若依管理系统/测试环境 # bnyer管理系统/测试环境
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = '/stage-api'

65
src/router/index.js

@ -74,71 +74,6 @@ export const constantRoutes = [
} }
] ]
}, },
{
path: '/feedback',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/img/feedback'),
name: 'Feedback',
meta: { title: '反馈信息', icon: 'dashboard', affix: true }
}
]
},
{
path: '/type',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/img/type'),
name: 'Type',
meta: { title: '图片类型', icon: 'dashboard', affix: true }
}
]
},
{
path: '/banner',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/img/banner'),
name: 'Banner',
meta: { title: 'banner', icon: 'dashboard', affix: true }
}
]
},
{
path: '/tiktokUser',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/img/tiktokUser'),
name: 'TiktokUser',
meta: { title: 'tiktokUser', icon: 'dashboard', affix: true }
}
]
},
{
path: '/tiktokImg',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/img/tiktokImg'),
name: 'TiktokImg',
meta: { title: 'tiktokImg', icon: 'dashboard', affix: true }
}
]
},
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,

2
vue.config.js

@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:7010`, target: `http://localhost:7010`, //http://localhost:7010
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save