| | |
| | | import axios from 'axios' |
| | | import { ElMessage } from 'element-plus' |
| | | |
| | | const debug = true |
| | | const debug = false |
| | | |
| | | let ip1 = 'http://47.100.191.150:9005/' |
| | | var IP = '47.100.191.150' |
| | | var PORT = '9005' |
| | | if (debug) { |
| | | // IP = '192.168.0.103' |
| | | IP = 'localhost' |
| | | PORT = '9001' |
| | | } |
| | | |
| | | let ws = `${IP}:${PORT}` |
| | | let ip1 = `http://${IP}:${PORT}/` |
| | | |
| | | let ip1_file = 'http://47.100.191.150:9005/' |
| | | // let ip1 = 'https://fyami.com.cn:447/'; |
| | | // let ip1_file = 'https://fyami.com.cn:447/'; |
| | | let ip2 = 'https://fyami.com.cn/' |
| | | let ip2_file = 'https://fyami.com.cn/' |
| | | |
| | | if (debug) { |
| | | ip1 = 'http://192.168.0.138:8082/' |
| | | // ip1 = 'http://localhost:8080/' |
| | | // ip1_file = 'http://47.100.191.150:9005/'; |
| | | // ip2 = 'http://192.168.0.138:8080/'; |
| | | // ip2_file = 'https://fyami.com.cn/'; |
| | | } |
| | | |
| | | //飞羽监管 |
| | | const $fysp = axios.create({ |
| | |
| | | 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) { |
| | |
| | | ) |
| | | }) |
| | | |
| | | export { $fysp, $fytz } |
| | | export { $fysp, $fytz, ws } |