vue写的前端框架设置成https前缀

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ufan94/article/details/81043940

1。cnpm安装依赖

sudo cnpm install moment
sudo cnpm install nice-try

2。在webpack.config.js中修改配置,配置成https请求

  devServer: {
        contentBase: path.join(__dirname, 'dist'),
        publicPath: '/',
        compress: true,
        disableHostCheck: true,
        historyApiFallback: true,
        **https: true,
        port: 443**
    },

3。在src中的config.js中设置请求的基础地址即可

猜你喜欢

转载自blog.csdn.net/ufan94/article/details/81043940