fix: 全面修复项目问题
后端修复: - 验证码存储与校验机制 - 订单创建事务+库存扣减 - GetStats字段名错误 - VerifyEmail改为POST - 供应商更新字段白名单 - 文件删除安全检查 - 抽奖安全随机数 - 用户管理CRUD - 订单取消/确认收货 - 工单回复 - Toggle返回新数据 - 移除死代码 前端修复: - 404兜底路由 - 401软跳转 - API层统一 - 面包屑补充banners - 国际化完善 - 购物车并行删除 - 退出清理购物车 - 供应商Dashboard数据 - 工单详情页 - 订单取消/确认收货
This commit is contained in:
+19
-10
@@ -29,7 +29,7 @@ export const authApi = {
|
||||
login: (data: any) => api.post('/auth/login', data),
|
||||
forgotPassword: (data: any) => api.post('/auth/forgot-password', data),
|
||||
resetPassword: (data: any) => api.post('/auth/reset-password', data),
|
||||
verifyEmail: (params: any) => api.get('/auth/verify-email', { params }),
|
||||
verifyEmail: (data: any) => api.post('/auth/verify-email', data),
|
||||
sendVerifyCode: () => api.post('/users/send-verify-code'),
|
||||
}
|
||||
|
||||
@@ -72,6 +72,8 @@ export const orderApi = {
|
||||
getById: (id: number) => api.get(`/orders/${id}`),
|
||||
create: (data: any) => api.post('/orders', data),
|
||||
refund: (id: number, data: any) => api.post(`/orders/${id}/refund`, data),
|
||||
cancel: (id: number) => api.put(`/orders/${id}/cancel`),
|
||||
confirmReceipt: (id: number) => api.put(`/orders/${id}/confirm-receipt`),
|
||||
}
|
||||
|
||||
export const articleApi = {
|
||||
@@ -79,6 +81,10 @@ export const articleApi = {
|
||||
getById: (id: number) => api.get(`/articles/${id}`),
|
||||
}
|
||||
|
||||
export const bannerApi = {
|
||||
list: () => api.get('/banners'),
|
||||
}
|
||||
|
||||
export const lotteryApi = {
|
||||
list: () => api.get('/lotteries'),
|
||||
getById: (id: number) => api.get(`/lotteries/${id}`),
|
||||
@@ -89,10 +95,7 @@ export const ticketApi = {
|
||||
list: (params?: any) => api.get('/tickets', { params }),
|
||||
create: (data: any) => api.post('/tickets', data),
|
||||
getById: (id: number) => api.get(`/tickets/${id}`),
|
||||
}
|
||||
|
||||
export const menuApi = {
|
||||
list: () => api.get('/menus'),
|
||||
reply: (id: number, data: any) => api.post(`/tickets/${id}/reply`, data),
|
||||
}
|
||||
|
||||
export const supplierApi = {
|
||||
@@ -105,6 +108,11 @@ export const supplierApi = {
|
||||
}
|
||||
|
||||
export const adminApi = {
|
||||
getStats: () => api.get('/admin/stats'),
|
||||
getUsers: () => api.get('/admin/users'),
|
||||
updateUser: (id: number, data: any) => api.put(`/admin/users/${id}`, data),
|
||||
deleteUser: (id: number) => api.delete(`/admin/users/${id}`),
|
||||
|
||||
getCategories: () => api.get('/categories'),
|
||||
createCategory: (data: any) => api.post('/admin/categories', data),
|
||||
updateCategory: (id: number, data: any) => api.put(`/admin/categories/${id}`, data),
|
||||
@@ -147,11 +155,6 @@ export const adminApi = {
|
||||
updateSMTP: (data: any) => api.put('/admin/settings/smtp', data),
|
||||
updatePayment: (data: any) => api.put('/admin/settings/payment', data),
|
||||
|
||||
getMenus: () => api.get('/admin/menus'),
|
||||
createMenu: (data: any) => api.post('/admin/menus', data),
|
||||
updateMenu: (id: number, data: any) => api.put(`/admin/menus/${id}`, data),
|
||||
deleteMenu: (id: number) => api.delete(`/admin/menus/${id}`),
|
||||
|
||||
getInventory: () => api.get('/admin/inventory'),
|
||||
|
||||
getArticles: (params?: any) => api.get('/admin/articles', { params }),
|
||||
@@ -159,4 +162,10 @@ export const adminApi = {
|
||||
updateArticle: (id: number, data: any) => api.put(`/admin/articles/${id}`, data),
|
||||
deleteArticle: (id: number) => api.delete(`/admin/articles/${id}`),
|
||||
togglePinArticle: (id: number) => api.put(`/admin/articles/${id}/pin`),
|
||||
|
||||
getBanners: () => api.get('/admin/banners'),
|
||||
createBanner: (data: any) => api.post('/admin/banners', data),
|
||||
updateBanner: (id: number, data: any) => api.put(`/admin/banners/${id}`, data),
|
||||
deleteBanner: (id: number) => api.delete(`/admin/banners/${id}`),
|
||||
toggleBanner: (id: number) => api.put(`/admin/banners/${id}/toggle`),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user