mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 01:17:51 +09:00
sysMgt 배치 상세까지 접근 가능하도록 라우터 설정
This commit is contained in:
@@ -54,8 +54,8 @@ const router = new Router({
|
|||||||
...profileRoutes,
|
...profileRoutes,
|
||||||
...mntrngRoutes,
|
...mntrngRoutes,
|
||||||
...riskmgtRoutes,
|
...riskmgtRoutes,
|
||||||
...homeMgtRoutes,
|
|
||||||
...monthRoutes,
|
...monthRoutes,
|
||||||
|
...homeMgtRoutes,
|
||||||
//{path: '*', name: 'error404'}
|
//{path: '*', name: 'error404'}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -66,19 +66,20 @@ const router = new Router({
|
|||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
const isPublic = to.matched.some((record) => record.meta.public);
|
const isPublic = to.matched.some((record) => record.meta.public);
|
||||||
const loggedIn = !!tokenSvc.getToken();
|
const loggedIn = !!tokenSvc.getToken();
|
||||||
|
store.commit('login/setLoginPathUrl', isPublic + '/' + loggedIn + to.fullPath);
|
||||||
if (!isPublic && !loggedIn) {
|
if (!isPublic && !loggedIn) {
|
||||||
store.commit('login/setLoginPathUrl', 1);
|
|
||||||
return next('/login');
|
return next('/login');
|
||||||
} else {
|
} else {
|
||||||
var nextUrl = to.fullPath;
|
var nextUrl = to.fullPath;
|
||||||
var fromUrl = from.fullPath;
|
var fromUrl = from.fullPath;
|
||||||
|
|
||||||
|
console.log(fromUrl);
|
||||||
|
|
||||||
var menuUrls = store.getters['login/getMenuUrls'];
|
var menuUrls = store.getters['login/getMenuUrls'];
|
||||||
if (menuUrls.length > 0) {
|
if (menuUrls.length > 0) {
|
||||||
var moveFlag = false;
|
var moveFlag = false;
|
||||||
for (var i = 0; i < menuUrls.length; i++) {
|
for (var i = 0; i < menuUrls.length; i++) {
|
||||||
var targetUrl = menuUrls[i];
|
var targetUrl = menuUrls[i];
|
||||||
console.log('nextUrl : ' + nextUrl + ' /// targetUrl : ' + targetUrl);
|
|
||||||
if (nextUrl == targetUrl) {
|
if (nextUrl == targetUrl) {
|
||||||
moveFlag = true;
|
moveFlag = true;
|
||||||
if (fromUrl != '/' && fromUrl != '/view/error/404' && fromUrl != '/view/error/500') {
|
if (fromUrl != '/' && fromUrl != '/view/error/404' && fromUrl != '/view/error/500') {
|
||||||
@@ -174,23 +175,19 @@ router.beforeEach((to, from, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// url Check 권한 관리
|
// url Check 권한 관리
|
||||||
if (nextUrl == '/sysMgt/authAdd' || nextUrl == '/sysMgt/authModify') {
|
if (
|
||||||
|
nextUrl == '/sysMgt/authAdd' ||
|
||||||
|
nextUrl == '/sysMgt/authModify' ||
|
||||||
|
nextUrl == '/sysMgt/authModify' ||
|
||||||
|
nextUrl == '/sysMgt/batchDetail'
|
||||||
|
) {
|
||||||
for (var i = 0; i < menuUrls.length; i++) {
|
for (var i = 0; i < menuUrls.length; i++) {
|
||||||
if (menuUrls[i] == '/sysMgt/authList') {
|
if (menuUrls[i] == '/sysMgt/authList') {
|
||||||
moveFlag = true;
|
moveFlag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// url 홈페이지 관리
|
|
||||||
/* if (nextUrl == '/homeMgt/notice' || nextUrl == '/homeMgt/faq') {
|
|
||||||
moveFlag = true;
|
|
||||||
} */
|
|
||||||
|
|
||||||
// url 배치 모니터링
|
|
||||||
/* if (nextUrl == '/sysMgt/batchList' || '/sysMgt/batchDetail') {
|
|
||||||
moveFlag = true;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (!moveFlag) {
|
if (!moveFlag) {
|
||||||
if (
|
if (
|
||||||
fromUrl == '/login' ||
|
fromUrl == '/login' ||
|
||||||
@@ -198,7 +195,6 @@ router.beforeEach((to, from, next) => {
|
|||||||
fromUrl == '/view/login/resetPassword' ||
|
fromUrl == '/view/login/resetPassword' ||
|
||||||
fromUrl == '/view/login/updatePassword'
|
fromUrl == '/view/login/updatePassword'
|
||||||
) {
|
) {
|
||||||
store.commit('login/setLoginPathUrl', 2);
|
|
||||||
return next('/login');
|
return next('/login');
|
||||||
}
|
}
|
||||||
// store.commit("login/isErrorPage", true);
|
// store.commit("login/isErrorPage", true);
|
||||||
@@ -211,15 +207,13 @@ router.beforeEach((to, from, next) => {
|
|||||||
nextUrl == '/view/login/updatePassword'
|
nextUrl == '/view/login/updatePassword'
|
||||||
) {
|
) {
|
||||||
if (fromUrl != '/login') {
|
if (fromUrl != '/login') {
|
||||||
store.commit('login/setLoginPathUrl', 3);
|
|
||||||
return next('/login');
|
return next('/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextUrl == '/') {
|
if (nextUrl === '/') {
|
||||||
const rootUrl = store.getters['login/getRootUrl'];
|
const rootUrl = store.getters['login/getRootUrl'];
|
||||||
if (rootUrl == null) {
|
if (rootUrl == null) {
|
||||||
store.commit('login/setLoginPathUrl', 4);
|
|
||||||
return next('/login');
|
return next('/login');
|
||||||
}
|
}
|
||||||
return next(rootUrl);
|
return next(rootUrl);
|
||||||
@@ -228,7 +222,6 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (nextUrl == '/login' && loggedIn) {
|
if (nextUrl == '/login' && loggedIn) {
|
||||||
const rootUrl = store.getters['login/getRootUrl'];
|
const rootUrl = store.getters['login/getRootUrl'];
|
||||||
if (rootUrl == null) {
|
if (rootUrl == null) {
|
||||||
store.commit('login/setLoginPathUrl', 5);
|
|
||||||
return next('/login');
|
return next('/login');
|
||||||
}
|
}
|
||||||
return next(rootUrl);
|
return next(rootUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user