| | |
| | | |
| | | const debug = true; |
| | | |
| | | // let ip1 = 'http://47.100.191.150:9005/'; |
| | | // 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 ip1 = 'http://47.100.191.150:9005/'; |
| | | 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_file = 'http://47.100.191.150:9005/'; |
| | | // ip2 = 'http://192.168.0.138:8080/'; |
| | | ip2 = 'http://192.168.0.138:8080/'; |
| | | // ip2_file = 'https://fyami.com.cn/'; |
| | | } |
| | | |
| | |
| | | i.interceptors.request.use( |
| | | function (config) { |
| | | // 在发送请求之前做些什么 |
| | | console.log('==>请求开始'); |
| | | console.log(`${config.baseURL}${config.url}`); |
| | | if (config.data) { |
| | | console.log('==>请求数据', config.data); |
| | | if (import.meta.env.DEV) { |
| | | console.log('==>请求开始'); |
| | | console.log(`${config.baseURL}${config.url}`); |
| | | if (config.data) { |
| | | console.log('==>请求数据', config.data); |
| | | } |
| | | } |
| | | return config; |
| | | }, |
| | | function (error) { |
| | | // 对请求错误做些什么 |
| | | console.log('==>请求开始'); |
| | | console.log(error); |
| | | if (import.meta.env.DEV) { |
| | | console.log('==>请求开始'); |
| | | console.log(error); |
| | | } |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |
| | |
| | | function (response) { |
| | | // 2xx 范围内的状态码都会触发该函数。 |
| | | // 对响应数据做点什么 |
| | | console.log(response); |
| | | console.log('==>请求结束'); |
| | | if (import.meta.env.DEV) { |
| | | console.log(response); |
| | | console.log('==>请求结束'); |
| | | } |
| | | if (response.status == 200) { |
| | | if (response.data.success != undefined && response.data.success != null) { |
| | | if (response.data.success == true) { |
| | |
| | | function (error) { |
| | | // 超出 2xx 范围的状态码都会触发该函数。 |
| | | // 对响应错误做点什么 |
| | | console.log(error); |
| | | console.log('==>请求结束'); |
| | | if (import.meta.env.DEV) { |
| | | console.log(error); |
| | | console.log('==>请求结束'); |
| | | } |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |