环卫车小程序前端代码
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.

16 lines
368 B

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. /**
  2. * 请求拦截
  3. * @param {Object} http
  4. */
  5. module.exports = (vm) => {
  6. uni.$u.http.interceptors.request.use((config) => {
  7. config.data = config.data || {}
  8. config.header['X-Access-Token'] = uni.getStorageSync('token');
  9. config.header['Content-Type'] = 'application/x-www-form-urlencoded'
  10. return config
  11. }, config => {
  12. return Promise.reject(config)
  13. })
  14. }