refactor: improve code formatting and structure in product index view
- Enhanced readability by adjusting indentation and spacing in the template. - Consolidated repeated code blocks for better maintainability. - Added functionality for changing product status (上架/下架) with confirmation prompts. - Updated the handleDelete function to maintain consistent formatting. - Ensured all API calls and data handling are properly formatted for clarity.
This commit is contained in:
@@ -42,3 +42,16 @@ export function delProduct(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 上架/下架商品
|
||||
export function changeProductStatus(id, status) {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/service/product/status',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user