diff --git a/client/src/api/index.js b/client/src/api/index.js index b0a9e4b..816be7f 100644 --- a/client/src/api/index.js +++ b/client/src/api/index.js @@ -21,7 +21,7 @@ api.interceptors.response.use( response => response.data, error => { const msg = error.response?.data?.message || '请求失败' - if (error.response?.status === 401) { + if (error.response?.status === 401 && !error.config.url.includes('/auth/login')) { localStorage.removeItem('token') localStorage.removeItem('user') router.push('/login') @@ -49,6 +49,8 @@ export const adminApi = { deleteUser: (id) => api.delete(`/admin/users/${id}`), getWorkdays: (year) => api.get('/admin/workdays', { params: { year } }), setWorkdays: (data) => api.post('/admin/workdays', data), + syncWorkdays: (year) => api.post('/admin/workdays/sync', { year }), + getHolidays: (year) => api.get('/admin/holidays', { params: { year } }), getSalesStats: (params) => api.get('/admin/stats/sales', { params }), getSalesDetail: (params) => api.get('/admin/stats/sales-detail', { params }), getRdStats: (params) => api.get('/admin/stats/rd', { params }), @@ -111,5 +113,6 @@ export const rdApi = { createTimesheet: (data) => api.post('/rd/timesheets', data), updateTimesheet: (id, data) => api.put(`/rd/timesheets/${id}`, data), deleteTimesheet: (id) => api.delete(`/rd/timesheets/${id}`), - getStats: (params) => api.get('/rd/stats', { params }) + getStats: (params) => api.get('/rd/stats', { params }), + getHolidays: (year) => api.get('/rd/holidays', { params: { year } }) } diff --git a/client/src/views/admin/Dashboard.vue b/client/src/views/admin/Dashboard.vue index 5a73014..f045805 100644 --- a/client/src/views/admin/Dashboard.vue +++ b/client/src/views/admin/Dashboard.vue @@ -265,14 +265,14 @@ - +