代码提交
This commit is contained in:
18
api/api.js
18
api/api.js
@ -144,3 +144,21 @@ const request = ['post', 'put', 'patch'].reduce((request, method) => {
|
||||
})
|
||||
|
||||
export default request
|
||||
|
||||
export const upload = (options)=>{
|
||||
const token = cookie.get('accessToken')
|
||||
return new Promise((resolve, reject)=>{
|
||||
uni.showLoading({title:'上传中'})
|
||||
uni.uploadFile({
|
||||
...options,
|
||||
header:{
|
||||
...options.headers,
|
||||
Authorization: 'Bearer ' + token.accessToken,
|
||||
},
|
||||
url:options.url?`${VUE_APP_API_URL}${options.url}`:VUE_APP_API_URL+'/member/user/update-avatar',
|
||||
success:(res)=>resolve(res),
|
||||
fail:(err)=>reject(err),
|
||||
complete:()=>uni.hideLoading()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -149,8 +149,8 @@ export function orderExpress(data) {
|
||||
export const wechatPay = (data) => api.post(`/order/pay`, data)
|
||||
|
||||
/**
|
||||
* 检查h5支付
|
||||
* 检查支付
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export const checkH5Pay = (data) => api.post(`/order/pay/orderQuery`, data)
|
||||
export const checkPay = (data) => api.post(`/order/pay/orderQuery`, data)
|
||||
|
@ -41,3 +41,4 @@ export function updateMobile(data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export const updateUserInfo = (data) => api.put(`/member/user/update-nickname?nickname=${ data.nickname }&birthday=${ data.birthday }&sex=${ data.sex }`)
|
||||
|
||||
|
Reference in New Issue
Block a user