迁移版本
This commit is contained in:
11
api/page/auth.js
Normal file
11
api/page/auth.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import {get, post} from '../request';
|
||||
|
||||
const prefix = 'auth/'
|
||||
export const loginApi = async (code, phoneCode, avatarUrl, nickName) => {
|
||||
return await post(`${prefix}login`, {
|
||||
code,
|
||||
phone_code: phoneCode,
|
||||
avatar: avatarUrl,
|
||||
nick_name: nickName
|
||||
})
|
||||
}
|
||||
30
api/page/cart.js
Normal file
30
api/page/cart.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import {get, post} from '../request';
|
||||
|
||||
const prefix = 'list/'
|
||||
|
||||
export const getCartListApi = async () => {
|
||||
return await get(`${prefix}list`)
|
||||
}
|
||||
export const getCartItemApi = async (id) => {
|
||||
return await get(`${prefix}detail`, {id})
|
||||
}
|
||||
export const createCartApi = async (params) => {
|
||||
return await post(`${prefix}create`, params)
|
||||
}
|
||||
export const deleteCartApi = async (id) => {
|
||||
return await post(`${prefix}delete`, {
|
||||
ids: [id]
|
||||
})
|
||||
}
|
||||
export const deleteCartItemApi = async (id) => {
|
||||
return await post(`${prefix}delete-item`, {
|
||||
ids: [id]
|
||||
})
|
||||
}
|
||||
export const toCartApi = async (listId, productId) => {
|
||||
return await post(`${prefix}to-cart`, {
|
||||
list_id: listId,
|
||||
product_id: productId
|
||||
})
|
||||
}
|
||||
|
||||
10
api/page/home.js
Normal file
10
api/page/home.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import {get} from '../request';
|
||||
|
||||
const prefix = 'home/'
|
||||
|
||||
export const getCarouselApi = async () => {
|
||||
return await get(`${prefix}carousel`)
|
||||
}
|
||||
export const getCategoryListApi = async () => {
|
||||
return await get(`${prefix}category-list`)
|
||||
}
|
||||
15
api/page/image.js
Normal file
15
api/page/image.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import {get, post} from '../request';
|
||||
|
||||
const prefix = 'w-oss/'
|
||||
|
||||
export const getImageApi = async (hash = '') => {
|
||||
return await get(`${prefix}getImage`, {
|
||||
hash
|
||||
})
|
||||
}
|
||||
export const uploadImageWatermarkApi = async (imageUrl = '', watermark = 'BRM') => {
|
||||
return await post(`${prefix}watermark`, {
|
||||
image_url: imageUrl,
|
||||
watermark
|
||||
})
|
||||
}
|
||||
14
api/page/product.js
Normal file
14
api/page/product.js
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
import {get} from '../request';
|
||||
|
||||
const prefix = 'product/'
|
||||
|
||||
export const getProductListApi = async (param) => {
|
||||
return await get(`${prefix}list`, param)
|
||||
}
|
||||
export const getCategoryListByPidApi = async (pid = 0) => {
|
||||
return await get(`${prefix}category-list-by-pid`, {pid})
|
||||
}
|
||||
export const getProductDetailApi = async (id = 0, p_user_id = 0) => {
|
||||
return await get(`${prefix}detail`, {id, p_user_id})
|
||||
}
|
||||
17
api/page/user.js
Normal file
17
api/page/user.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import {get, post} from '../request';
|
||||
|
||||
const prefix = 'user/'
|
||||
|
||||
export const getUserInfoApi = async () => {
|
||||
return await get(`${prefix}my-info`)
|
||||
}
|
||||
export const bandPhoneApi = async (phone) => {
|
||||
return await post(`${prefix}band-phone`, {
|
||||
phone: phone
|
||||
})
|
||||
}
|
||||
export const updateNickNameApi = async (nick_name) => {
|
||||
return await post(`${prefix}update-nick-name`, {
|
||||
nick_name
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user