配置式,是否使用第三方登录,是否显示系统菜单
This commit is contained in:
parent
4aca5a138e
commit
04892007e9
2
public/config.js
vendored
2
public/config.js
vendored
|
|
@ -3,6 +3,8 @@ window._CONFIG = {
|
||||||
ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg',
|
ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg',
|
||||||
RoadProviderUrl: '',
|
RoadProviderUrl: '',
|
||||||
TerrainProviderUrl: '/map/mapTerrain/',
|
TerrainProviderUrl: '/map/mapTerrain/',
|
||||||
|
showSystemMenu: false,
|
||||||
|
useThirdLogin: false,
|
||||||
thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin',
|
thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin',
|
||||||
clientId: '0123456789',
|
clientId: '0123456789',
|
||||||
evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin',
|
evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin',
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ router.beforeEach((to, from, next) => {
|
||||||
})
|
})
|
||||||
// 失败时,获取用户信息失败时,调用登出,来清空历史保留信息
|
// 失败时,获取用户信息失败时,调用登出,来清空历史保留信息
|
||||||
store.dispatch('Logout').then(() => {
|
store.dispatch('Logout').then(() => {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (window._CONFIG.useThirdLogin) {
|
||||||
openThirdLogin()
|
openThirdLogin()
|
||||||
} else {
|
} else {
|
||||||
next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
||||||
|
|
@ -74,7 +74,7 @@ router.beforeEach((to, from, next) => {
|
||||||
// 在免登录名单,直接进入
|
// 在免登录名单,直接进入
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (window._CONFIG.useThirdLogin) {
|
||||||
openThirdLogin()
|
openThirdLogin()
|
||||||
} else {
|
} else {
|
||||||
next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export const generatorDynamicRouter = (token) => {
|
||||||
// 后端数据, 根级树数组, 根级 PID
|
// 后端数据, 根级树数组, 根级 PID
|
||||||
listToTree(data, childrenNav, '')
|
listToTree(data, childrenNav, '')
|
||||||
console.log('childrenNav', childrenNav)
|
console.log('childrenNav', childrenNav)
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (window._CONFIG.showSystemMenu) {
|
||||||
childrenNav.push(systemNav)
|
childrenNav.push(systemNav)
|
||||||
}
|
}
|
||||||
const routers = generator(childrenNav)
|
const routers = generator(childrenNav)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ const errorHandler = (error) => {
|
||||||
if (token) {
|
if (token) {
|
||||||
store.dispatch('Logout').then(() => {
|
store.dispatch('Logout').then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (window._CONFIG.useThirdLogin) {
|
||||||
openThirdLogin()
|
openThirdLogin()
|
||||||
} else {
|
} else {
|
||||||
window.location = '/user/login?redirect=' + window.location.pathname
|
window.location = '/user/login?redirect=' + window.location.pathname
|
||||||
|
|
@ -47,7 +47,7 @@ const errorHandler = (error) => {
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (window._CONFIG.useThirdLogin) {
|
||||||
openThirdLogin()
|
openThirdLogin()
|
||||||
} else {
|
} else {
|
||||||
window.location = '/user/login?redirect=' + window.location.pathname
|
window.location = '/user/login?redirect=' + window.location.pathname
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ export default {
|
||||||
onCancel() {},
|
onCancel() {},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (window._CONFIG.useThirdLogin) {
|
||||||
this.$store.dispatch('Logout').then(() => {
|
this.$store.dispatch('Logout').then(() => {
|
||||||
openThirdLogin()
|
openThirdLogin()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user