浏览代码

使用history路由

zhangjie 2 年之前
父节点
当前提交
b2ad11dd5e
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 0 3
      src/constants/app.js
  2. 2 0
      src/router.js

+ 0 - 3
src/constants/app.js

@@ -15,9 +15,6 @@ if (!domain) {
     domain = parseHrefParam(window.location.href, "code");
     domain = parseHrefParam(window.location.href, "code");
     if (domain) {
     if (domain) {
       window.sessionStorage.setItem("ipDomainCode", domain);
       window.sessionStorage.setItem("ipDomainCode", domain);
-    } else {
-      // 本地化部署只有一个默认学校
-      domain = "default-school";
     }
     }
   } else {
   } else {
     domain = hostname.split(".")[0];
     domain = hostname.split(".")[0];

+ 2 - 0
src/router.js

@@ -27,6 +27,8 @@ Router.prototype.push = function push(location, onResolve, onReject) {
 Vue.use(Router);
 Vue.use(Router);
 
 
 let router = new Router({
 let router = new Router({
+  mode: "history",
+  // 后端配置: try_files $uri $uri/ /index.html;
   routes: [
   routes: [
     {
     {
       path: "/",
       path: "/",