您好,欢迎来到星星旅游。
搜索
您的当前位置:首页vue.config.js文件配置

vue.config.js文件配置

来源:星星旅游

文件配置

module.exports = {
    baseUrl: './',
    productionSourceMap: false,
    // 输出文件目录
    outputDir: 'dist',
    devServer: {
        port: 9527, // 本地端口地址
        https: false, // https:{type:Boolean}
        open: process.platform === 'darwin',
        // 代理设置
        proxy: {
            '/api':{
                target:'http://www.baidu.com', // 后台url
                changeOrigin:true,  // 允许跨域
                ws: true,
                // 请求api
                pathRewrite:{
                    '^/api': ''  // 使用api代替接口请求地址
                }
            }
        }
    }
}

接口调用

test: function () {
   this.$http.get('/api/report/delivergoods/efficiency', 'D').then(res => {
        console.log(res)
    })
}

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- stra.cn 版权所有 赣ICP备2024042791号-4

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务