zoukankan      html  css  js  c++  java
  • uniapp历史模式history配置

    //我们使用hash模式时,打包线上,容易出现页面空白的情况,所以如下配置

     "h5" : {
            "devServer" : {
    	"publicPath":"./"
                "https" : false,
                "port" : 3000,
                "disableHostCheck" : true,
                "proxy" : {
                    "/api" : {
                        "target" : "https://m.shop.com",
                        "ws" : true,
                        "changOrigin" : true,
                        "pathRewrite" : {
                            "^/api" : ""
                        }
                    }
                }
            },
    }
    

      //但我们使用历史模式(history)模式的时候,不能用hash模式的配置

        "h5" : {
            "devServer" : {
    			// "publicPath":"./"   //注意隐藏这行
                "https" : false,
                "port" : 3000,
                "disableHostCheck" : true,
                "proxy" : {
                    "/api" : {
                        "target" : "m.shop.com",
                        // "target":"http://localhost:8080/hht_mall/",
                        "ws" : true,
                        "changOrigin" : true,
                        "pathRewrite" : {
                            "^/api" : ""
                        }
                    }
                }
            },
            "router" : {
                "base" : "mall/website/",    //填写你的线上地址(如http://m.shop.com/mall/webiste/,线上根目录是http://m.shop.com,取得是根目录后的mall/website, 注意本地开发时需要隐藏这行
                "mode" : "history"
            },
    }
    

      

  • 相关阅读:
    网络爬虫概述
    Redis常见问题汇总
    分布式锁和Redis事务
    Redis主从复制
    数据持久化
    位图操作bitmap
    数据类型:Hash散列数据类型
    进程池
    事件Event实现消费者模型
    事件Event
  • 原文地址:https://www.cnblogs.com/uimeigui/p/12597378.html
Copyright © 2011-2022 走看看