一些问题的修复
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import api from './index'
|
||||
|
||||
export interface SendVerificationCodeRequest {
|
||||
phone: string
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
account: string
|
||||
password: string
|
||||
@@ -48,7 +52,17 @@ export interface RefreshTokenResponse {
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
export interface ResetPasswordRequest {
|
||||
phone: string
|
||||
verificationCode: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
export const authApi = {
|
||||
sendVerificationCode: (data: SendVerificationCodeRequest) => {
|
||||
return api.post('/user/send-verification-code', data)
|
||||
},
|
||||
|
||||
login: (data: LoginRequest) => {
|
||||
return api.post<LoginResponse>('/user/login', data)
|
||||
},
|
||||
@@ -75,5 +89,9 @@ export const authApi = {
|
||||
|
||||
getUserInfo: () => {
|
||||
return api.get<UserInfo>('/user/info')
|
||||
},
|
||||
|
||||
resetPasswordByPhone: (data: ResetPasswordRequest) => {
|
||||
return api.post('/user/reset-password-by-phone', data)
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,11 @@ export const cartApi = {
|
||||
return api.delete(`/cart/remove/${productId}`)
|
||||
},
|
||||
|
||||
// 批量从购物车移除作品
|
||||
batchRemoveFromCart: (cartItemIds: number[]) => {
|
||||
return api.post('/cart/batch-remove', cartItemIds)
|
||||
},
|
||||
|
||||
// 更新购物车作品数量
|
||||
updateCartQuantity: (item: CartItem) => {
|
||||
return api.put('/cart/update', item)
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import api from './index'
|
||||
|
||||
interface OrderItem {
|
||||
productId: number
|
||||
quantity: number
|
||||
artistId?: number
|
||||
}
|
||||
|
||||
interface CreateOrderRequest {
|
||||
couponId?: number
|
||||
artistId?: number
|
||||
items: OrderItem[]
|
||||
}
|
||||
|
||||
export const orderApi = {
|
||||
@@ -36,5 +42,10 @@ export const orderApi = {
|
||||
return api.put(`/order/admin/process/${orderId}`, {}, {
|
||||
params: { status }
|
||||
})
|
||||
},
|
||||
|
||||
// 美甲师查看自己的订单
|
||||
getArtistOrders: () => {
|
||||
return api.get('/order/artist/list')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user