feat: 重构后台路由并使用嵌套路由;添加图片上传功能

- 拆分 AdminView 为多个子页面组件,使用嵌套路由
- 拆分 MerchantView 为多个子页面组件,使用嵌套路由
- 创建 AdminLayout 和 MerchantLayout 布局组件
- 修复编译错误:IconSend 重复导入、IconDatabase 不存在
- 修复 HomeView 缺失 onMounted 导入
- 添加文件上传后端接口和静态资源映射
- 为商品和轮播图添加图片上传功能(支持预览、清除)
This commit is contained in:
wangziqi
2026-02-10 15:14:23 +08:00
parent a7ce0a089e
commit d6451cf188
29 changed files with 4948 additions and 479 deletions

View File

@@ -61,5 +61,21 @@ export const api = {
adminDeleteProduct: (id) => http.delete(`/api/admin/products/${id}`),
adminReviews: () => http.get('/api/admin/reviews'),
adminLogistics: () => http.get('/api/admin/logistics'),
adminInventory: () => http.get('/api/admin/inventory')
adminInventory: () => http.get('/api/admin/inventory'),
// File Upload
uploadImage: (file) => {
const formData = new FormData()
formData.append('file', file)
return http.post('/api/upload/image', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
},
uploadFile: (file) => {
const formData = new FormData()
formData.append('file', file)
return http.post('/api/upload', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
}