重新轉址 for Niagara4 js 移到 /js/init.js。

This commit is contained in:
陳啟峰 2022-11-16 15:16:18 +08:00
parent f359469e1f
commit 836035eee6
2 changed files with 12 additions and 12 deletions

View File

@ -2064,17 +2064,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
<script src="js/style.js"></script> <script src="js/style.js"></script>
<script src="js/site.js"></script> <script src="js/site.js"></script>
<script src="js/init.js"></script> <script src="js/init.js"></script>
<script> <script>
//重新轉址 for Niagara4
var temp_cuurent_Url_pathname = window.location.pathname.split("/").slice(0, 3);
var redirectionUrl = window.location.origin + "/" +
temp_cuurent_Url_pathname[temp_cuurent_Url_pathname.length - 1].replace(":%5E", "/") + "/" +
window.location.pathname.split("/").slice(3).join("/");
//判斷url是否包含"ord",如果有重新轉址
if (temp_cuurent_Url_pathname.findIndex(x => x == "ord") > -1) {
document.location.href = redirectionUrl.substr(0, redirectionUrl.length - 1);
}
var jwt = localStorage.getItem("JWT-Authorization"); var jwt = localStorage.getItem("JWT-Authorization");
var pageAct = {}; //記錄全頁面已選擇項目 var pageAct = {}; //記錄全頁面已選擇項目

View File

@ -6,4 +6,14 @@ var varApiUrl = "/api/"; //API路徑
var varPathImg = "/Upload/Images/"; var varPathImg = "/Upload/Images/";
var varPathFile = "/Upload/Files/"; var varPathFile = "/Upload/Files/";
var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" }; var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" };
var objSendData = { Data: null }; var objSendData = { Data: null };
//重新轉址 for Niagara4
var temp_cuurent_Url_pathname = window.location.pathname.split("/").slice(0, 3);
var redirectionUrl = window.location.origin + "/" +
temp_cuurent_Url_pathname[temp_cuurent_Url_pathname.length - 1].replace(":%5E", "/") + "/" +
window.location.pathname.split("/").slice(3).join("/");
//判斷url是否包含"ord",如果有重新轉址
if (temp_cuurent_Url_pathname.findIndex(x => x == "ord") > -1) {
document.location.href = redirectionUrl.substr(0, redirectionUrl.length - 1);
}