| | |
| | | import md5 from 'md5'; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | // const ip = 'http://101.230.224.80:8082/'; |
| | | const ip = 'http://192.168.0.138:8080/'; |
| | | const url = 'http://47.100.191.150:9030/'; |
| | | // const url = 'http://192.168.1.9:8080/'; |
| | | const imgUrl = url + 'images/'; |
| | | |
| | | //飞羽监管 |
| | | const $clue = axios.create({ |
| | | baseURL: ip, |
| | | timeout: 10000, |
| | | baseURL: url, |
| | | timeout: 10000 |
| | | // headers: addHeaders() |
| | | }); |
| | | // console.log($clue); |
| | | |
| | | function addHeaders(headers) { |
| | | function getHeaders() { |
| | | const token = 'e6dc8bb9e1ff0ce973fb92b4af2e4c3f'; |
| | | |
| | | const date = new Date(); |
| | |
| | | console.log('==>请求结束'); |
| | | if (response.status == 200) { |
| | | if ( |
| | | response.data.code != undefined && |
| | | response.data.code != null |
| | | response.data.success != undefined && |
| | | response.data.success != null |
| | | ) { |
| | | if (response.data.code == 20000) { |
| | | if (response.data.success == true) { |
| | | return response.data.data; |
| | | } else { |
| | | return Promise.reject( |
| | | response.data.code + ', ' + response.data.message |
| | | ); |
| | | ElMessage({ |
| | | message: response.data.message, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(response.data.message); |
| | | } |
| | | } else { |
| | | return response; |
| | |
| | | ); |
| | | }); |
| | | |
| | | export { $clue }; |
| | | export { $clue, imgUrl }; |