新增加路由器前缀通过环境变量配置
This commit is contained in:
parent
24ced6b9b5
commit
4d58a154cc
@ -20,6 +20,7 @@ namespace ZR.Admin.WebApi.Filters
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Permission { get; set; }
|
public string Permission { get; set; }
|
||||||
private bool HasPermi { get; set; }
|
private bool HasPermi { get; set; }
|
||||||
|
private bool HasRole { get; set; }
|
||||||
|
|
||||||
public ActionPermissionFilter() { }
|
public ActionPermissionFilter() { }
|
||||||
|
|
||||||
|
|||||||
@ -6,4 +6,4 @@ ENV = 'development'
|
|||||||
VUE_APP_BASE_API = 'http://localhost:8888/'
|
VUE_APP_BASE_API = 'http://localhost:8888/'
|
||||||
|
|
||||||
# 路由前缀
|
# 路由前缀
|
||||||
VUE_APP_ROUTER_PREFIX = ''
|
VUE_APP_ROUTER_PREFIX = '/admin'
|
||||||
|
|||||||
@ -5,4 +5,4 @@ ENV = 'production'
|
|||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/prod-api'
|
||||||
|
|
||||||
# 路由前缀
|
# 路由前缀
|
||||||
VUE_APP_ROUTER_PREFIX = ''
|
VUE_APP_ROUTER_PREFIX = '/admin/'
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export default {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch("LogOut").then(() => {
|
this.$store.dispatch("LogOut").then(() => {
|
||||||
location.href = "/index";
|
location.href = process.env.VUE_APP_ROUTER_PREFIX + "index";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -109,8 +109,8 @@ export const constantRoutes = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
|
base: process.env.VUE_APP_ROUTER_PREFIX,
|
||||||
mode: 'history', // 去掉url中的#
|
mode: 'history', // 去掉url中的#
|
||||||
// base: '',
|
|
||||||
// scrollBehavior: () => ({ y: 0 }),
|
// scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRoutes
|
routes: constantRoutes
|
||||||
})
|
})
|
||||||
|
|||||||
@ -54,7 +54,7 @@ service.interceptors.response.use(res => {
|
|||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = '/index';
|
location.href = process.env.VUE_APP_ROUTER_PREFIX + '/index';
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ module.exports = {
|
|||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.baidu.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.baidu.com/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.baidu.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.baidu.com/admin/,则设置 baseUrl 为 /admin/。
|
||||||
publicPath: process.env.VUE_ROUTER_PREFIX,
|
publicPath: process.env.VUE_APP_ROUTER_PREFIX,
|
||||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user