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.
|
/**
|
|
* 请求拦截
|
|
* @param {Object} http
|
|
*/
|
|
module.exports = (vm) => {
|
|
uni.$u.http.interceptors.request.use((config) => {
|
|
config.data = config.data || {}
|
|
config.header['X-Access-Token'] = uni.getStorageSync('token');
|
|
// config.header['Content-Type'] = 'application/json'
|
|
config.header['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
return config
|
|
}, config => {
|
|
return Promise.reject(config)
|
|
})
|
|
}
|
|
|
|
|