赞
踩
代码一 import axios from 'axios' export const PhoneApi = axios.create( { baseURL: '/api', timeout: 100000 } ) export const PbApi = axios.create( { baseURL: '/pb', timeout: 100000 } ) PhoneApi.interceptors.response.use( (response) => { return response }, (error) => { const paramsErrorStatus = error.response.status if ( paramsErrorStatus == 403 ) { error['paramsErrorMsg'] = '请检查密码、账号是否与卡片一致' } else { error['paramsErrorMsg'] = '请稍后重试!!!' } return Promise.reject(error) } )
代码二
// PhoneApi.defaults.headers.common['user-timestamp'] = mdObject["tttt"]
// PhoneApi.defaults.headers.common['user-key'] = mdObject["aaaaaa"]
PhoneApi.post("reem/vip/", userInfo, {
headers: {
'user-timestamp': mdObject["ttt"],
'user-key': mdObject["aaaa"],
}
}).then( (resp) => {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。