bugfix: ORDERS_CREATE_UR修正为

MY_ORDERS_CREATE_URL
This commit is contained in:
jqtmviyu@gmail.com 2021-03-06 21:38:48 +08:00
parent 6b1ac948fd
commit bbab09950b

View File

@ -20,6 +20,11 @@ const GOODS_DETAIOL_URL = '/goods/detail'
// 获取用户token // 获取用户token
const USERS_WXLOGIN_URL = '/users/wxlogin' const USERS_WXLOGIN_URL = '/users/wxlogin'
// 创建订单
const MY_ORDERS_CREATE_URL = '/my/orders/create'
const token = uni.getStorageSync('token') || ''
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作 // 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
const install = (Vue, vm) => { const install = (Vue, vm) => {
// 首页 // 首页
@ -44,7 +49,13 @@ const install = (Vue, vm) => {
getCategories, getCategories,
getGoods, getGoods,
getGoodsDetail, getGoodsDetail,
getUserToken: (params = {}) => vm.$u.post(USERS_WXLOGIN_URL, params) // 获取token
getUserToken: (params = {}) => vm.$u.post(USERS_WXLOGIN_URL, params),
// 创建订单
createOrders: (params = {}) => vm.$u.post(MY_ORDERS_CREATE_URL, params, {
Authorization: token
}),
} }
} }