From 5cfe6db94c1449810a44660b299dba8e7e98e5c5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 10 六月 2021 14:43:39 +0800
Subject: [PATCH] 2021-06-10

---
 src/components/header/loginform.jsx |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/components/header/loginform.jsx b/src/components/header/loginform.jsx
index e887b12..3ed68e7 100644
--- a/src/components/header/loginform.jsx
+++ b/src/components/header/loginform.jsx
@@ -11,7 +11,7 @@
   }
 
   state = {
-    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
   }
 
   handleConfirm = () => {
@@ -32,9 +32,7 @@
     if (e.target.value) {
       if (!this.props.form.getFieldValue(key)) {
         const input = document.getElementById(key)
-        if (input) {
-          input.focus()
-        }
+        input && input.focus()
         return
       }
       this.props.handleSubmit()
@@ -45,9 +43,7 @@
 
   componentDidMount () {
     const input = document.getElementById('username')
-    if (input) {
-      input.focus()
-    }
+    input && input.focus()
   }
 
   render() {

--
Gitblit v1.8.0