riku
2025-07-08 91513e171078ed6b0887f87b9fced33895d6d3fb
src/api/index.js
@@ -1,22 +1,24 @@
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({
@@ -39,11 +41,11 @@
  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) {
@@ -63,6 +65,11 @@
    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) {
@@ -97,4 +104,4 @@
  )
})
export { $fysp, $fytz }
export { $fysp, $fytz, ws }