You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.2 KiB
89 lines
2.2 KiB
import request from '@/utils/request'
|
|
|
|
// api地址
|
|
const api = {
|
|
userInfo: 'user/info',
|
|
assets: 'user/assets',
|
|
bindMobile: 'user/bindMobile',
|
|
personal: 'user/personal',
|
|
// 操作日志
|
|
oplogs: "slb/userself/v1/account/operation",
|
|
//重置密码
|
|
resetpwd:'slb/userself/v1/account/reset-pwd',
|
|
// 购物车
|
|
shop_cart: "tes/api/goods/getShoppingCar",
|
|
// 购物车
|
|
del_shop_cart: "AgencyAddress/order/delShoppingCa",
|
|
// 去结算
|
|
create_order: "AgencyAddress/order/createOrder",
|
|
// 发票管理
|
|
bill_manage: "AgencyAddress/order/getTicket",
|
|
}
|
|
|
|
// 当前登录的用户信息
|
|
export const info = (param, option) => {
|
|
const options = {
|
|
isPrompt: true, //(默认 true 说明:本接口抛出的错误是否提示)
|
|
load: true, //(默认 true 说明:本接口是否提示加载动画)
|
|
...option
|
|
}
|
|
return request.get(api.userInfo, param, options)
|
|
}
|
|
|
|
// 账户资产
|
|
export const assets = (param, option) => {
|
|
return request.get(api.assets, param, option)
|
|
}
|
|
|
|
// 绑定手机号
|
|
export const bindMobile = (data, option) => {
|
|
return request.post(api.bindMobile, data, option)
|
|
}
|
|
|
|
// 修改个人信息(头像昵称)
|
|
export const personal = (data, option) => {
|
|
return request.post(api.personal, data, option)
|
|
}
|
|
|
|
// 操作日志
|
|
export const oplogs = (param, option) => {
|
|
return request.get(api.oplogs, param, option)
|
|
}
|
|
|
|
// 重置用户密码
|
|
export const resetpass = (data,option) =>{
|
|
return request.post(api.resetpwd,data,option)
|
|
}
|
|
|
|
// 获取购物车列表
|
|
export function getShopCart(data){
|
|
return request.post(api.shop_cart,data)
|
|
}
|
|
|
|
// 删除购物车
|
|
export function delShopCart(param){
|
|
let paramArr = [];
|
|
for (let key in param) {
|
|
paramArr.push(key + '=' + param[key])
|
|
}
|
|
let paramStr = '?' + paramArr.join('&')
|
|
return request.post(api.del_shop_cart + paramStr)
|
|
}
|
|
|
|
// 删除购物车
|
|
export function createOrder(param){
|
|
let paramArr = [];
|
|
for (let key in param) {
|
|
paramArr.push(key + '=' + param[key])
|
|
}
|
|
let paramStr = '?' + paramArr.join('&')
|
|
return request.post(api.create_order + paramStr)
|
|
}
|
|
|
|
// 发票管理
|
|
export function getBillManage(data){
|
|
let option={header:{
|
|
"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"
|
|
}}
|
|
return request.post(api.bill_manage,data,option)
|
|
}
|