From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/views/login/index.jsx |   79 +++++++++++++++++++--------------------
 1 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx
index 50ea083..1b581e6 100644
--- a/src/views/login/index.jsx
+++ b/src/views/login/index.jsx
@@ -89,13 +89,6 @@
    * @param {Object} param 鐢ㄦ埛鍚嶅瘑鐮佺瓑淇℃伅
    */
   async loginsubmit (param) {
-    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 涓氬姟绯荤粺蹇呴』璁剧疆鍗曠偣鍦板潃
-      Modal.warning({
-        title: '鏈缃崟鐐规湇鍔″櫒鍦板潃锛岃鑱旂郴绠$悊鍛橈紒'
-      })
-      return
-    }
-
     let city = sessionStorage.getItem('city') || ''
     let ipAddress = sessionStorage.getItem('ipAddress') || ''
 
@@ -187,13 +180,6 @@
   }
 
   async phoneloginsubmit (param) {
-    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 涓氬姟绯荤粺蹇呴』璁剧疆鍗曠偣鍦板潃
-      Modal.warning({
-        title: '鏈缃崟鐐规湇鍔″櫒鍦板潃锛岃鑱旂郴绠$悊鍛橈紒'
-      })
-      return
-    }
-
     let city = sessionStorage.getItem('city') || ''
     let ipAddress = sessionStorage.getItem('ipAddress') || ''
 
@@ -213,9 +199,7 @@
       sessionStorage.setItem('organization', res.organization || '')
       sessionStorage.setItem('localRole_id', res.role_id || '')
 
-      let _url = window.location.href.split('#')[0]
-
-      localStorage.setItem(_url + 'lang', param.lang || 'zh-CN')
+      localStorage.setItem(_href + 'lang', param.lang || 'zh-CN')
       sessionStorage.setItem('lang', param.lang || 'zh-CN')
 
       sessionStorage.removeItem('visitorUserID')
@@ -245,12 +229,6 @@
   }
 
   authLogin = (appid, openid, memberid, scanId) => {
-    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 涓氬姟绯荤粺蹇呴』璁剧疆鍗曠偣鍦板潃
-      Modal.warning({
-        title: '鏈缃崟鐐规湇鍔″櫒鍦板潃锛岃鑱旂郴绠$悊鍛橈紒'
-      })
-      return
-    }
     Api.getTouristMsg(appid, openid, memberid, scanId).then(res => {
       if (res.status) {
         sessionStorage.setItem('UserID', res.UserID)
@@ -321,7 +299,28 @@
     //   if (!res || !res.ip) return
     //   sessionStorage.setItem('ipAddress', res.ip)
     // })
-    const _addressUrl = window.location.href.split('#')[0] + 'queryAddress'
+    if (sessionStorage.getItem('loginError')) {
+      try {
+        let res = JSON.parse(sessionStorage.getItem('loginError'))
+        console.info(res.url)
+        console.info(res.request)
+        console.info(res.response)
+
+        let result = JSON.parse(res.response)
+
+        notification.warning({
+          top: 92,
+          message: result.message,
+          duration: 5
+        })
+      } catch (e) {}
+      
+      setTimeout(() => {
+        sessionStorage.removeItem('loginError')
+      }, 2000)
+    }
+
+    const _addressUrl = _href + 'queryAddress'
 
     if (localStorage.getItem(_addressUrl) !== 'true') {
       sessionStorage.setItem('city', '')
@@ -331,7 +330,7 @@
     }
 
     const timeStamp = new Date().getTime()
-    const _authUrl = window.location.href.split('#')[0] + 'AuthCode'
+    const _authUrl = _href + 'AuthCode'
 
     let authCode = localStorage.getItem(_authUrl)
     let _s = md5('mksoft' + moment().format('YYYYMMDD'))
@@ -370,12 +369,14 @@
             keys[char] = (offset + i) % 10
           }
   
-          let lictime = +key2.replace(/[A-Z]/ig, (s) => {
+          let lictime = key2.replace(/[A-Z]/ig, (s) => {
             return keys[s]
           })
-          let curtime = +moment().format('YYYYMMDD')
+          lictime = lictime.slice(0,4) + '/' + lictime.slice(4,6) + '/' + lictime.slice(6)
+          lictime = Math.floor(new Date(lictime).getTime() / 86400000)
+          let curtime = Math.floor(new Date().getTime() / 86400000)
           let licday = lictime - curtime
-          let _mindUrl = window.location.href.split('#')[0] + 'notMind'
+          let _mindUrl = _href + 'notMind'
 
           if (licday < 0 || isNaN(licday)) {
             Modal.warning({
@@ -527,15 +528,7 @@
             res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
             res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
 
-            if (/^https/.test(window.location.protocol)) { // https杞崲
-              res.Banner = res.Banner ? res.Banner.replace(/^http:/ig, 'https:') : ''
-              res.doclogo = res.doclogo ? res.doclogo.replace(/^http:/ig, 'https:') : ''
-              res.indexlogo = res.indexlogo ? res.indexlogo.replace(/^http:/ig, 'https:') : ''
-              res.loginlogo = res.loginlogo ? res.loginlogo.replace(/^http:/ig, 'https:') : ''
-              res.titlelogo = res.titlelogo ? res.titlelogo.replace(/^http:/ig, 'https:') : ''
-            }
-
-            let _url = window.location.href.split('#')[0] + 'system'
+            let _url = _href + 'system'
             let systemMsg = {
               favicon: res.titlelogo || '',
               platTitle: res.titleName || '',
@@ -559,7 +552,13 @@
               level = ''
             }
 
-            localStorage.setItem(window.location.href.split('#')[0] + 'pwdlevel', level)
+            localStorage.setItem(_href + 'pwdlevel', level)
+
+            if (res.srcid) {
+              localStorage.setItem(_href + 'srcId', res.srcid)
+            } else {
+              localStorage.removeItem(_href + 'srcId')
+            }
 
             sessionStorage.setItem('home_background', res.index_background_color || '')
             if (res.sys_datetime) {
@@ -576,7 +575,7 @@
               localStorage.removeItem(_url)
             }
 
-            let _loginurl = window.location.href.split('#')[0] + 'loginways'
+            let _loginurl = _href + 'loginways'
             let login_ways = []
             let login_types = []
             if (res.login_ways && res.login_ways.length > 0) {
@@ -670,7 +669,7 @@
       }
     })
     
-    let loginWays = localStorage.getItem(window.location.href.split('#')[0] + 'loginways')
+    let loginWays = localStorage.getItem(_href + 'loginways')
     if (loginWays) {
       try {
         loginWays = JSON.parse(window.decodeURIComponent(window.atob(loginWays)))

--
Gitblit v1.8.0