From 71a0e75ecb56ae643fe1e86188d45f93f48388c9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 28 八月 2020 14:07:41 +0800
Subject: [PATCH] 2020-08-28

---
 src/views/login/index.jsx |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx
index 8b029a1..9cfe440 100644
--- a/src/views/login/index.jsx
+++ b/src/views/login/index.jsx
@@ -17,6 +17,12 @@
 const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform'))
 const iszhCN = localStorage.getItem('lang') !== 'en-US'
 
+const _href = window.location.href.split('#')[0]
+if (localStorage.getItem(_href + 'paramsmain')) {
+  sessionStorage.setItem('history', localStorage.getItem(_href + 'paramsmain'))
+  localStorage.removeItem(_href + 'paramsmain')
+}
+
 class Login extends Component {
   state = {
     selectedlang: iszhCN ? 'zh-CN' : 'en-US',
@@ -91,9 +97,16 @@
         localStorage.removeItem(_url)
       }
 
-      if (this.props.location.state && this.props.location.state.from.pathname) {
+      // if (this.props.location.state && this.props.location.state.from.pathname) {
+      //   // 鏌ョ湅鏄惁涓哄叾浠栭〉闈㈣烦杞紝璺緞瀛樺湪鏃讹紝璺冲洖鍘熼〉闈�
+      //   this.props.history.replace(this.props.location.state.from.pathname)
+      // }
+
+      let _history = sessionStorage.getItem('history')
+      if (_history) {
+        sessionStorage.removeItem('history')
         // 鏌ョ湅鏄惁涓哄叾浠栭〉闈㈣烦杞紝璺緞瀛樺湪鏃讹紝璺冲洖鍘熼〉闈�
-        this.props.history.replace(this.props.location.state.from.pathname)
+        this.props.history.replace(_history)
       } else {
         this.props.history.replace('/main')
       }
@@ -131,9 +144,11 @@
 
       localStorage.setItem('lang', param.lang || 'zh-CN')
 
-      if (this.props.location.state && this.props.location.state.from.pathname) {
+      let _history = sessionStorage.getItem('history')
+      if (_history) {
+        sessionStorage.removeItem('history')
         // 鏌ョ湅鏄惁涓哄叾浠栭〉闈㈣烦杞紝璺緞瀛樺湪鏃讹紝璺冲洖鍘熼〉闈�
-        this.props.history.replace(this.props.location.state.from.pathname)
+        this.props.history.replace(_history)
       } else {
         this.props.history.replace('/main')
       }
@@ -296,6 +311,11 @@
             })
 
             window.GLOB.mainlogo = systemMsg.mainlogo
+            window.GLOB.style = systemMsg.style
+        
+            if (window.GLOB.style && options.styles[window.GLOB.style]) {
+              document.getElementById('root').className = options.styles[window.GLOB.style]
+            }
 
             if (res.titlelogo && window.GLOB.favicon !== res.titlelogo) {
               let link = document.querySelector("link[rel*='icon']") || document.createElement('link')

--
Gitblit v1.8.0