【商品详情】
1. 接入收藏逻辑
This commit is contained in:
1 parent
e68d39c99c
commit
8fbdec3738
2 files changed
+74
-34
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
// 检查是否收藏过商品
|
||||
export function isFavoriteExists(spuId) {
|
||||
return request.get('app-api/product/favorite/exits', {
|
||||
spuId
|
||||
});
|
||||
}
|
||||
|
||||
// 添加商品收藏
|
||||
export function createFavorite(spuId) {
|
||||
return request.post('app-api/product/favorite/create', {
|
||||
spuId
|
||||
});
|
||||
}
|
||||
|
||||
// 取消商品收藏
|
||||
export function deleteFavorite(spuId) {
|
||||
return request.delete('app-api/product/favorite/delete', {
|
||||
spuId
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user