本地Vue代理HTTPS接口
生活随笔
收集整理的這篇文章主要介紹了
本地Vue代理HTTPS接口
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
- 第一步
- cnpm安裝
- 第二步
- webpack.config.js中修改配置,配置成https請求
- 在代碼中的修改位置總覽:
- 第三步
- 在config目錄下或者config.js中修改vue代理方式
第一步
cnpm安裝
cnpm install moment cnpm install nice-try第二步
webpack.config.js中修改配置,配置成https請求
devServer: {clientLogLevel: 'warning',https: true,hot: true },在代碼中的修改位置總覽:
module.exports = merge(baseWebpackConfig, {module: {rules: utils.styleLoaders({sourceMap: config.dev.cssSourceMap})},// cheap-module-eval-source-map is faster for developmentdevtool: '#cheap-module-eval-source-map',devServer: {clientLogLevel: 'warning',https: true,hot: true},第三步
在config目錄下或者config.js中修改vue代理方式
//使用代理proxyTable: {'/admin-web': {target: 'https://127.0.0.1:8443',changeOrigin: true,secure: false,pathRewrite: {'^/admin-web': '/admin-web'},headers: {Referer: 'https://127.0.0.1:8443'}}},總結
以上是生活随笔為你收集整理的本地Vue代理HTTPS接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 代码合并工具_资源合并与压缩
- 下一篇: bilibili 安卓B站缓存视频合并软