55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
import {
|
|
request
|
|
} from "../http";
|
|
// 公共API
|
|
const apiPath = {
|
|
loginUrl: '/api/user/wx/login', //登录
|
|
registerUrl: '/api/user/wx/register', //注册,
|
|
updateUserInfo: '/api/user-info/update-self',
|
|
csaNo: '/api/csa/get', //获取客服编号
|
|
createContact: '/api/proj-contact/save', //创建联系人
|
|
mineAccount: '/api/user-info/get-user-self', //获取我的账户余额
|
|
minePackageCount: '/api/proj/servicepkg/packageorder/count/self', //我的套餐包剩余
|
|
uploadImg: '/api/file/v2/upload-image', //上传图片
|
|
userInfo: '/api/user-info/get-self', //获取我的个人信息
|
|
mineOrder: '/api/order/listpage/self', //我的订单
|
|
}
|
|
class UserService {
|
|
static doLogin(data) {
|
|
return request(apiPath.loginUrl, "POST", data, null, 'operator', false)
|
|
}
|
|
static doRegister(data) {
|
|
return request(apiPath.registerUrl, "POST", data, null, 'operator', false)
|
|
}
|
|
static doUpdateUserInfo(data) {
|
|
return request(apiPath.updateUserInfo, "PUT", data)
|
|
}
|
|
static doGetCsaNo() {
|
|
return request(apiPath.csaNo, "GET")
|
|
}
|
|
static doCreateContact(data) {
|
|
return request(apiPath.createContact, "POST", data)
|
|
}
|
|
//获取我的账户余额
|
|
static doGetMineAccount() {
|
|
return request(apiPath.mineAccount, "GET")
|
|
}
|
|
//获取我的套餐包
|
|
static doGetMinePackageCount() {
|
|
return request(apiPath.minePackageCount, "GET")
|
|
}
|
|
//上传图片
|
|
static doUploadImg(data) {
|
|
return request(apiPath.uploadImg, "POST", data)
|
|
}
|
|
//获取个人信息
|
|
static doGetUserInfo() {
|
|
return request(apiPath.userInfo, "GET")
|
|
}
|
|
//获取我的订单
|
|
static doGetMineOrder(data) {
|
|
return request(apiPath.mineOrder, "GET", data)
|
|
}
|
|
}
|
|
|
|
export default UserService; |