zoukankan      html  css  js  c++  java
  • proxy跨域处理

    拿vue-cli举例,在项目目录中找到根目录下config文件夹下的index.js文件。配置在dev里面:

    dev: {
    
        // Paths
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: {
        '/api': { 
          target: 'http://www.abc.com', //目标接口域名 
          changeOrigin: true, //是否跨域 
          pathRewrite: { 
            '^/api': '/api' //重写接口 
          }
        },
       },
    
        // Various Dev Server settings
        host: 'localhost', // can be overwritten by process.env.HOST
        port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
        autoOpenBrowser: false,
        errorOverlay: true,
        notifyOnErrors: true,
        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
    
        
        /**
         * Source Maps
         */
    
        // https://webpack.js.org/configuration/devtool/#development
        devtool: 'cheap-module-eval-source-map',
    
        // If you have problems debugging vue-files in devtools,
        // set this to false - it *may* help
        // https://vue-loader.vuejs.org/en/options.html#cachebusting
        cacheBusting: true,
    
        cssSourceMap: true
      },
     
  • 相关阅读:
    ceph简易安装
    ceph安装
    nova计算节点部署
    onva控制节点部署
    nova介绍
    image部署
    glance镜像介绍
    keystone部署
    keystone介绍
    rabbimtq消息队列部署
  • 原文地址:https://www.cnblogs.com/Blogzlj/p/11023159.html
Copyright © 2011-2022 走看看