From 7849d7799c9ede8447a4d57c26e032e08c1eff74 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 08 Apr 2021 20:14:50 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop

---
 zq-erp/src/main/resources/static/js/systools/MBase.js |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/zq-erp/src/main/resources/static/js/systools/MBase.js b/zq-erp/src/main/resources/static/js/systools/MBase.js
index d754c18..648d3ef 100644
--- a/zq-erp/src/main/resources/static/js/systools/MBase.js
+++ b/zq-erp/src/main/resources/static/js/systools/MBase.js
@@ -5,9 +5,16 @@
  */
 function getRootPath() {
 	var curWwwPath = window.document.location.href;
-	console.log(curWwwPath);
+	let url="";
 	var pathName = window.document.location.pathname;
-	var url=curWwwPath.substring(0, curWwwPath.indexOf(pathName));
+	if(pathName&&pathName!="/"){
+		url= curWwwPath.substring(0, curWwwPath.indexOf(pathName));
+	}else{
+		url= curWwwPath;
+	}
+	console.log(url);
+	return url;
+
 //	if(url.indexOf('localhost')>0){
 //		return url++- pathName.substring(0, pathName.substr(1).indexOf('/') + 1); 
 //		console.log("1"+url);
@@ -16,7 +23,7 @@
 //		return  url+ pathName.substring(0, pathName.substr(1).indexOf('/') + 1); 
 //		console.log("2"+url);
 //	}
-	return url; 
+
 }
 /** 全局路径,代表当前网站的根URL */
 var basePath = getRootPath();

--
Gitblit v1.9.1