初始化提交
This commit is contained in:
81
src/api/user.ts
Normal file
81
src/api/user.ts
Normal file
@ -0,0 +1,81 @@
|
||||
import { http } from '@/http/alova'
|
||||
import type { IUserAddressListResult, IUserAddressDetailsResult, IUserCouponListResult } from '@/api/types/user'
|
||||
import type { IOrderListResult } from '@/api/types/teaSpecialist-order'
|
||||
import type { IUserResult } from '@/api/types/user'
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户个人信息
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return http.Post<IUserResult>('/storeapi/user/info')
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*/
|
||||
export interface IUpdateUserInfoParams {
|
||||
nickname?: string
|
||||
avatar?: string
|
||||
mobile?: number
|
||||
band_mobile?: string
|
||||
password?: string
|
||||
code?: string
|
||||
}
|
||||
|
||||
export function updateUserInfo(data: IUpdateUserInfoParams) {
|
||||
return http.Post('/storeapi/user/updateUser', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流水明细
|
||||
*/
|
||||
export interface IGetUserTransactionDetailsParams {
|
||||
page: number
|
||||
size: number
|
||||
end_time: string
|
||||
}
|
||||
|
||||
export function getUserTransactionDetails(data: IGetUserTransactionDetailsParams) {
|
||||
return http.Post<IOrderListResult>('/storeapi/user/balanceLogList', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流水明细详情(账单明细)
|
||||
*/
|
||||
export function getUserTransactionDetailsInfo(id: number) {
|
||||
return http.Post<any>('/storeapi/user/balanceLogDetails', { id })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
export interface IGetStoreVerificationCodeParams {
|
||||
mobile: string
|
||||
scene: string
|
||||
}
|
||||
|
||||
export function getVerificationCode(data: IGetStoreVerificationCodeParams) {
|
||||
return http.Post('/storeapi/sms/sendCode', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
export interface IResetPasswordParams {
|
||||
mobile: string
|
||||
code: string
|
||||
password: string
|
||||
password_confirm: string
|
||||
}
|
||||
|
||||
export function resetPassword(data: IResetPasswordParams) {
|
||||
return http.Post('/storeapi/storeLogin/resetPassword', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户余额
|
||||
*/
|
||||
export function getUserBalance(store_id: number) {
|
||||
return http.Post<any>('/storeapi/user/checkMoney', {store_id})
|
||||
}
|
||||
Reference in New Issue
Block a user