| | |
| | | import axios from 'axios' |
| | | import { ElMessage } from 'element-plus' |
| | | |
| | | const debug = true |
| | | const debug = false |
| | | |
| | | var IP = '47.100.191.150' |
| | | var PORT = '9005' |
| | |
| | | i.interceptors.request.use( |
| | | function (config) { |
| | | // 在发送请求之前做些什么 |
| | | console.log('==>请求开始') |
| | | console.log(`${config.baseURL}${config.url}`) |
| | | if (config.data) { |
| | | console.log('==>请求数据', config.data) |
| | | } |
| | | // console.log('==>请求开始') |
| | | // console.log(`${config.baseURL}${config.url}`) |
| | | // if (config.data) { |
| | | // console.log('==>请求数据', config.data) |
| | | // } |
| | | return config |
| | | }, |
| | | function (error) { |
| | |
| | | function (response) { |
| | | // 2xx 范围内的状态码都会触发该函数。 |
| | | // 对响应数据做点什么 |
| | | console.log('==>请求开始') |
| | | console.log(`${response.config.baseURL}${response.config.url}`) |
| | | if (response.config.data) { |
| | | console.log('==>请求数据', response.config.data) |
| | | } |
| | | console.log(response) |
| | | console.log('==>请求结束') |
| | | if (response.status == 200) { |