Browse Source

调整权限问题

fengxu 1 year ago
parent
commit
2641ca78be

BIN
JMshujudaping23-09-14.zip


BIN
JMshujudaping23-10-13.zip


+ 27 - 0
cokingCoal/js/humanResources.js

@@ -398,6 +398,33 @@ let app = new Vue({
 
         }
     },
+    beforeCreate() {
+        // 跳转地址
+        let AddUrl = window.location.href = location.protocol + "//" + location.host + "/ierp"
+
+        if(!window.location.search){
+            alert("链接已失效,请重新打开")
+            window.location.href = AddUrl
+        }
+        let arr = window.location.search.split("&")
+        let dataList = []
+        arr.forEach(item=>{
+            dataList.push(item.split("=")[1])
+        })
+        window.user = dataList[0]
+        let newDate = new Date().getTime()
+        let authorityType = window.sessionStorage.getItem("authorityType") || false
+        if(!authorityType){
+            if(newDate - dataList[1] > 30000){
+                alert("链接已失效,请重新打开")
+                window.location.href = AddUrl
+            }
+            window.sessionStorage.setItem("authorityType", true)
+        }
+    },
+    beforeDestroy(){
+        window.sessionStorage.removeItem("authorityType")
+    },
     created() {
 
         let date = new Date()

+ 25 - 0
cokingCoal/js/newIndex.js

@@ -507,7 +507,32 @@ let app = new Vue({
         }
     },
     beforeCreate() {
+        // 跳转地址
+        let AddUrl = window.location.href = location.protocol + "//" + location.host + "/ierp"
 
+
+        if(!window.location.search){
+            alert("链接已失效,请重新打开")
+            window.location.href = AddUrl
+        }
+        let arr = window.location.search.split("&")
+        let dataList = []
+        arr.forEach(item=>{
+            dataList.push(item.split("=")[1])
+        })
+        window.user = dataList[0]
+        let newDate = new Date().getTime()
+        let authorityType = window.sessionStorage.getItem("authorityType") || false
+        if(!authorityType){
+            if(newDate - dataList[1] > 30000){
+                alert("链接已失效,请重新打开")
+                window.location.href = AddUrl
+            }
+            window.sessionStorage.setItem("authorityType", true)
+        }
+    },
+    beforeDestroy(){
+        window.sessionStorage.removeItem("authorityType")
     },
     watch: {
         imageIndex() {

+ 9 - 7
cokingCoal/js/request.js

@@ -13,13 +13,13 @@ function isLocalEnv() {
 }
 
 
-window.apiType = "sit"  // dev 本地测试 ,  sit  线上测试  uat  客户测试环境 prod  正式环境
-if(window.location.search){
-  apiType = window.location.search.split("=")[1]
-}
+window.apiType = "prod"  // dev 本地测试 ,  sit  线上测试  uat  客户测试环境 prod  正式环境
+// if(window.location.search){
+//   apiType = window.location.search.split("=")[1]
+// }
 window.fetchUrl = ""
 // window.fetchUrl = "http://172.21.9.236:8081"
-
+window.user = "18035133443"
 
 if (window.apiType == "dev") {
   window.fetchUrl = "http://192.168.1.4:8080"
@@ -259,7 +259,8 @@ function getLocalEnvAccessToken() {
       }
     } else if (window.apiType == "sit") {
       data = {
-        user: "17649834944",
+        user: window.user,
+        // user: "17649834944",
         apptoken: localStorage.getItem("app_token"),
         tenantid: "dev",
         accountId: "1493393884158362624",
@@ -278,7 +279,7 @@ function getLocalEnvAccessToken() {
     }  else if(window.apiType == "prod") {
       data = {
         // appId: "jsc",
-        user: "18035133443",
+        user: window.user,
         usertype: "Mobile",
         apptoken: localStorage.getItem("app_token"),
         // appSecuret: '{Li$d73F13x"+ASb',
@@ -290,6 +291,7 @@ function getLocalEnvAccessToken() {
       return
     }
 
+
     fetch(fetchUrl + "/ierp/api/login.do", {
       method: "post",
       body: JSON.stringify(data),