From 5ad4a34a655e80b5d9109c258e97318a8b04a7c4 Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 28 Sep 2022 15:52:30 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=96=B9=E5=BC=8F=20#544?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/login/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spug_web/src/pages/login/index.js b/spug_web/src/pages/login/index.js index f223aa1..eb3b020 100644 --- a/spug_web/src/pages/login/index.js +++ b/spug_web/src/pages/login/index.js @@ -20,7 +20,7 @@ export default function () { const [form] = Form.useForm(); const [counter, setCounter] = useState(0); const [loading, setLoading] = useState(false); - const [loginType, setLoginType] = useState('default'); + const [loginType, setLoginType] = useState(localStorage.getItem('login_type') || 'default'); const [codeVisible, setCodeVisible] = useState(false); const [codeLoading, setCodeLoading] = useState(false); @@ -76,6 +76,7 @@ export default function () { localStorage.setItem('nickname', data['nickname']); localStorage.setItem('is_supper', data['is_supper']); localStorage.setItem('permissions', JSON.stringify(data['permissions'])); + localStorage.setItem('login_type', loginType); updatePermissions(); if (history.location.state && history.location.state['from']) { history.push(history.location.state['from']) @@ -100,7 +101,7 @@ export default function () {
灵活、强大、易用的开源运维平台
- setLoginType(v)}> + setLoginType(v)}>