
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import { createWebHistory, createRouter } from "vue-router";
import Main from '../pages/main/Main.vue';
import Login from '../pages/User/Login.vue';
import Join from '../pages/User/Join.vue';
import MyPage from '../pages/User/MyPage.vue';
// import Main2 from '../pages/main/Main2.vue';
// import HomeView from "../pages/HomeView.vue";
// import AboutView from "../pages/AboutView.vue";
// 직원
import ChuljangList from '../pages/Employee/ChuljangList.vue';
import HyugaList from '../pages/Employee/HyugaList.vue';
import HyugaOk from '../pages/Employee/HyugaOk.vue';
// 결재관리
import approval from '../pages/Manager/approval/approval.vue';
import approvalList from '../pages/Manager/approval/approvalList.vue';
import approvalRequest from '../pages/Manager/approval/approvalRequest.vue';
import ChuljangPumui from '../pages/Manager/approval/ChuljangPumui.vue';
import ChuljangBokmyeong from '../pages/Manager/approval/ChuljangBokmyeong.vue';
//근태관리
import ChuljangPumuiDetail from '../pages/Manager/attendance/ChuljangPumuiDetail.vue';
import ChuljangBokmyeongDetail from '../pages/Manager/attendance/ChuljangBokmyeongDetail.vue';
import ChuljangDetailAll from '../pages/Manager/attendance/ChuljangDetailAll.vue';
import attendance from '../pages/Manager/attendance/attendance.vue';
import myAttendance from '../pages/Manager/attendance/myAttendance.vue';
import buseoAttendance from '../pages/Manager/attendance/buseoAttendance.vue';
import AttendanceDetail from '../pages/Manager/attendance/AttendanceDetail.vue';
import hyugaStatue from '../pages/Manager/attendance/hyugaStatue.vue';
import HyugaInsert from '../pages/Manager/approval/HyugaInsert.vue';
import HyugaDetail from '../pages/Manager/approval/HyugaDetail.vue';
import BokmyeongInsert from '../pages/Manager/attendance/BokmyeongInsert.vue';
import ChuljangStatue from '../pages/Manager/attendance/ChuljangStatue.vue';
import ChuljangInsert from '../pages/Manager/attendance/ChuljangInsert.vue';
import task from '../pages/Manager/task/task.vue';
import projectStatue from '../pages/Manager/task/projectStatue.vue';
import projectDetail from '../pages/Manager/task/projectDetail.vue';
import meetingInsert from '../pages/Manager/task/meetingInsert.vue';
import meetingDetail from '../pages/Manager/task/meetingDetail.vue';
import projectInsert from '../pages/Manager/task/projectInsert.vue';
import projectTuib from '../pages/Manager/task/projectTuib.vue';
import projectTuibDetail from '../pages/Manager/task/projectTuibDetail.vue';
import financial from '../pages/Manager/financial/financial.vue';
import salaryList from '../pages/Manager/financial/salaryList.vue';
import employeeSalaryList from '../pages/Manager/financial/employeeSalaryList.vue';
import employeeSalaryDetail from '../pages/Manager/financial/employeeSalaryDetail.vue';
import employeeSalaryInsert from '../pages/Manager/financial/employeeSalaryInsert.vue';
import ChuljangCostList from '../pages/Manager/financial/ChuljangCostList.vue';
import MeetingCostList from '../pages/Manager/financial/MeetingCostList.vue';
import asset from '../pages/Manager/asset/asset.vue';
import CarList from '../pages/Manager/asset/CarList.vue';
import CardList from '../pages/Manager/asset/CardList.vue';
import CarInfoManagement from '../pages/Manager/asset/CarInfoManagement.vue';
import CardInfoManagement from '../pages/Manager/asset/CardInfoManagement.vue';
import hr from '../pages/Manager/hr/hr.vue';
import hrSearch from '../pages/Manager/hr/hrSearch.vue';
import hrManagement from '../pages/Manager/hr/hrManagement.vue';
import hrDetail from '../pages/Manager/hr/hrDetail.vue';
import hrInsert from '../pages/Manager/hr/hrInsert.vue';
import buseoManagement from '../pages/Manager/hr/buseoManagement.vue';
import system from '../pages/Manager/system/system.vue';
import userManagement from '../pages/Manager/system/userManagement.vue';
import accessControlManagement from '../pages/Manager/system/accessControlManagement.vue';
import commonCodeManagement from '../pages/Manager/system/commonCodeManagement.vue';
import commonCodeInsert from '../pages/Manager/system/commonCodeInsert.vue';
import commonCodeDetail from '../pages/Manager/system/commonCodeDetail.vue';
const routes = [
/* 메인화면 */
{ path: '/', name: '/', component: Main},
{ path: '/login.page', name: 'Login', component: Login},
{ path: '/join.page', name: 'Join', component: Join},
{ path: '/MyPage.page', name: 'MyPage', component: MyPage},
{ path: '/ChuljangList.page', name: 'ChuljangList', component: ChuljangList },
{ path: '/HyugaList.page', name: 'HyugaList', component: HyugaList },
{ path: '/HyugaOk.page', name: 'HyugaOk', component: HyugaOk },
{ path: '/approval-management.page', name: 'approval', component: approval,
children: [
{
path: '/approvalRequest.page', // => /approval-management.page/list
name: 'approvalRequest',
component: approvalRequest,
children: [
]
},
{
path: '/approvalList.page', // => /approval-management.page/detail/123
name: 'approvalList',
component: approvalList
},
{ path: '/ChuljangPumui.page', name: 'ChuljangPumui', component: ChuljangPumui },
{ path: '/ChuljangBokmyeong.page', name: 'ChuljangBokmyeong', component: ChuljangBokmyeong },
]
}, //결재관리
{ path: '/attendance-management.page', name: 'attendance', component: attendance,
children: [
{ path: '/myAttendance.page', name: 'myAttendance', component: myAttendance },
{ path: '/buseoAttendance.page', name: 'buseoAttendance', component: buseoAttendance },
{ path: '/AttendanceDetail.page', name: 'AttendanceDetail', component: AttendanceDetail },
{ path: '/hyugaStatue.page', name: 'hyugaStatue', component: hyugaStatue },
{ path: '/HyugaDetail.page', name: 'HyugaDetail', component: HyugaDetail },
{ path: '/HyugaInsert.page', name: 'HyugaInsert', component: HyugaInsert },
{ path: '/ChuljangStatue.page', name: 'ChuljangStatue', component: ChuljangStatue },
{ path: '/BokmyeongInsert.page', name: 'BokmyeongInsert', component: BokmyeongInsert },
{ path: '/ChuljangInsert.page', name: 'ChuljangInsert', component: ChuljangInsert },
{ path: '/ChuljangPumuiDetail.page', name: 'ChuljangPumuiDetail', component: ChuljangPumuiDetail },
{ path: '/ChuljangBokmyeongDetail.page', name: 'ChuljangBokmyeongDetail', component: ChuljangBokmyeongDetail },
{ path: '/ChuljangDetailAll.page', name: 'ChuljangDetailAll', component: ChuljangDetailAll },
]
}, //근태관리
{ path: '/task-management.page', name: 'task', component: task,
children: [
{ path: '/projectStatue.page', name: 'projectStatue', component: projectStatue },
{ path: '/projectDetail.page', name: 'projectDetail', component: projectDetail },
{ path: '/meetingInsert.page', name: 'meetingInsert', component: meetingInsert },
{ path: '/meetingDetail.page', name: 'meetingDetail', component: meetingDetail },
{ path: '/projectInsert.page', name: 'projectInsert', component: projectInsert },
{ path: '/projectTuib.page', name: 'projectTuib', component: projectTuib },
{ path: '/projectTuibDetail.page', name: 'projectTuibDetail', component: projectTuibDetail },
]
}, //업무관리
{ path: '/financial-management.page', name: 'financial', component: financial,
children: [
{ path: '/salaryList.page', name: 'salaryList', component: salaryList },
{ path: '/employeeSalaryList.page', name: 'employeeSalaryList', component: employeeSalaryList },
{ path: '/employeeSalaryDetail.page', name: 'employeeSalaryDetail', component: employeeSalaryDetail },
{ path: '/employeeSalaryInsert.page', name: 'employeeSalaryInsert', component: employeeSalaryInsert },
{ path: '/ChuljangCostList.page', name: 'ChuljangCostList', component: ChuljangCostList },
{ path: '/MeetingCostList.page', name: 'MeetingCostList', component: MeetingCostList },
]
}, //재무관리
{ path: '/asset-management.page', name: 'asset', component: asset,
children: [
{ path: '/CarList.page', name: 'CarList', component: CarList },
{ path: '/CarInfoManagement.page', name: 'CarInfoManagement', component: CarInfoManagement },
{ path: '/CardList.page', name: 'CardList', component: CardList },
{ path: '/CardInfoManagement.page', name: 'CardInfoManagement', component: CardInfoManagement },
]
}, //자산관리
{ path: '/hr-management.page', name: 'hr', component: hr,
children: [
{ path: '/hrSearch.page', name: 'hrSearch', component: hrSearch },
{ path: '/hrManagement.page', name: 'hrManagement', component: hrManagement },
{ path: '/hrDetail.page', name: 'hrDetail', component: hrDetail },
{ path: '/hrInsert.page', name: 'hrInsert', component: hrInsert },
{ path: '/buseoManagement.page', name: 'buseoManagement', component: buseoManagement },
]
}, //인사관리
{ path: '/system-management.page', name: 'system', component: system,
children:[
{ path: '/userManagement.page', name: 'userManagement', component: userManagement },
{ path: '/accessControlManagement.page', name: 'accessControlManagement', component: accessControlManagement },
{ path: '/commonCodeManagement.page', name: 'commonCodeManagement', component: commonCodeManagement },
{ path: '/commonCodeInsert.page', name: 'commonCodeInsert', component: commonCodeInsert },
{ path: '/commonCodeDetail.page', name: 'commonCodeDetail', component: commonCodeDetail },
]
}, //시스템관리
];
const AppRouter = createRouter({
history: createWebHistory(),
routes,
});
// Add navigation guard
AppRouter.beforeEach((to, from, next) => {
// Check login status
const isLoggedIn = localStorage.getItem('isLoggedIn') === 'true';
// If not logged in and trying to access any page other than login, redirect to login page
if (!isLoggedIn && to.path !== '/login.page') {
next('/login.page');
}
// If logged in and trying to access login page, redirect to main page
else if (isLoggedIn && to.path === '/login.page') {
next('/');
}
else {
next(); // Proceed to requested route
}
});
export default AppRouter;