Riku
2025-06-23 ff82e86becbd200adabd2ce56fba1f6b3c6c37e1
src/api/index.js
@@ -1,12 +1,13 @@
import axios from 'axios'
import { ElMessage } from 'element-plus'
const debug = true
const debug = false
var IP = '47.100.191.150'
var PORT = '9005'
if (debug) {
  IP = '192.168.0.103'
  // IP = '192.168.0.103'
  IP = 'localhost'
  PORT = '9001'
}
@@ -40,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) {
@@ -64,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) {