1
2
3
4
5
6
7
8
9
10
11
12
13
| /**
| * 请求拦截
| * @param {Object} http
| */
| module.exports = (vm) => {
| uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
| console.log(config)
| config.header['Cookie'] = 'eva-auth-token=' + vm.$store.state.session
| uni.showLoading({ title: '请求中' });
| config.data = config.data || {}
| return config
| }, (config) => Promise.reject(config)) // 可使用async await 做异步操作
| }
|
|