请求方式使用的是axios,在main.js中添加baseURL

在下面配置中加上axios.defaults.baseURL = 'http://xxxx:18081';即可

Vue.use(VueAxios, axios)
axios.defaults.baseURL = 'http://localhost:18081';

再次发送请求时就不用带前缀了

this.axios(
        {
          url: '/api-admin/user/selectServiceOrSenderTest/1/',
          method: 'GET',
          data: {}
        }
      ).then(response => {
        console.log(response)
      })
Logo

前往低代码交流专区

更多推荐