
File name
Commit message
Commit date
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 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 Hyuga from '../pages/Manager/approval/Hyuga.vue';
//근태관리
import ChuljangBokmyeongDetail from '../pages/Manager/attendance/ChuljangBokmyeongDetail.vue';
import ChuljangDetailAll from './Manager/attendance/ChuljangDetailAll.vue';
import ChuljangStatue from '../pages/Manager/attendance/ChuljangStatue.vue';
import ChuljangInsert from '../pages/Manager/attendance/ChuljangInsert.vue';
import myAttendance from '../pages/Manager/attendance/myAttendance.vue';
import buseoAttendance from '../pages/Manager/attendance/buseoAttendance.vue';
import attendance from '../pages/Manager/attendance/attendance.vue';
import AttendanceDetail from '../pages/Manager/attendance/AttendanceDetail.vue';
import hyugaStatue from '../pages/Manager/attendance/hyugaStatue.vue';
import HyugaInsert from '../pages/Manager/attendance/HyugaInsert.vue';
import HyugaDetail from '../pages/Manager/attendance/HyugaDetail.vue';
import BokmyeongInsert from '../pages/Manager/attendance/BokmyeongInsert.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 VhcleList from '../pages/Manager/asset/VhcleList.vue';
import CardList from '../pages/Manager/asset/CardList.vue';
import VhcleInfoManagement from '../pages/Manager/asset/VhcleInfoManagement.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, redirect: '/approval-management.page/approvalRequest.page',
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,
children: [
]
},
{ path: 'ChuljangPumui.page', name: 'ChuljangPumui', component: ChuljangPumui },
{ path: 'ChuljangBokmyeong.page', name: 'ChuljangBokmyeong', component: ChuljangBokmyeong },
{ path: 'Hyuga.page', name: 'Hyuga', component: Hyuga },
]
}, //결재관리
{
path: '/attendance-management.page', name: 'attendance', component: attendance, redirect: '/attendance-management.page/myAttendance.page',
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: 'ChuljangBokmyeongDetail.page', name: 'ChuljangBokmyeongDetail', component: ChuljangBokmyeongDetail },
{ path: 'ChuljangDetailAll.page', name: 'ChuljangDetailAll', component: ChuljangDetailAll },
]
}, //근태관리
{
path: '/task-management.page', name: 'task', component: task, redirect: '/task-management.page/projectStatue.page',
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, redirect: '/financial-management.page/salaryList.page',
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, redirect: '/asset-management.page/VhcleList.page',
children: [
{ path: 'VhcleList.page', name: 'VhcleList', component: VhcleList },
{ path: 'VhcleInfoManagement.page', name: 'VhcleInfoManagement', component: VhcleInfoManagement },
{ path: 'CardList.page', name: 'CardList', component: CardList },
{ path: 'CardInfoManagement.page', name: 'CardInfoManagement', component: CardInfoManagement },
]
}, //자산관리
{
path: '/hr-management.page', name: 'hr', component: hr, redirect: '/hr-management.page/hrSearch.page',
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, redirect: { name: 'userManagement' },
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;