From 9f4435b237b65cdc59793424c03c52881561b3c1 Mon Sep 17 00:00:00 2001 From: whyour Date: Fri, 16 Jun 2023 02:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/system.ts | 3 +- back/loaders/express.ts | 3 +- src/pages/initialization/index.tsx | 94 +++++++++++++++--------------- src/pages/login/index.tsx | 4 ++ src/pages/setting/index.tsx | 17 ++++-- 5 files changed, 65 insertions(+), 56 deletions(-) diff --git a/back/api/system.ts b/back/api/system.ts index 2bea5493..a324a3e1 100644 --- a/back/api/system.ts +++ b/back/api/system.ts @@ -47,8 +47,7 @@ export default (app: Router) => { if ( Object.keys(authInfo).length === 2 && authInfo.username === 'admin' && - authInfo.password === 'admin' && - envCount === 0 + authInfo.password === 'admin' ) { isInitialized = false; } diff --git a/back/loaders/express.ts b/back/loaders/express.ts index 0bf5bbb6..4c1ca5a1 100644 --- a/back/loaders/express.ts +++ b/back/loaders/express.ts @@ -109,8 +109,7 @@ export default ({ app }: { app: Application }) => { if ( Object.keys(authInfo).length === 2 && authInfo.username === 'admin' && - authInfo.password === 'admin' && - envCount === 0 + authInfo.password === 'admin' ) { isInitialized = false; } diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index c45824a4..715c40f9 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -100,53 +100,6 @@ const Initialization = () => { ), }, - { - title: '通知设置', - content: ( -
- - - - {fields.map((x) => ( - - - - ))} - - -
- ), - }, { title: '账户设置', content: ( @@ -202,6 +155,53 @@ const Initialization = () => { ), }, + { + title: '通知设置', + content: ( +
+ + + + {fields.map((x) => ( + + + + ))} + + +
+ ), + }, { title: '完成安装', content: ( diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 4c350621..95357f2c 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -105,6 +105,10 @@ const Login = () => { password: values.password, }); setTwoFactor(true); + } else if (code === 100) { + setTimeout(() => { + location.reload(); + }, 1000); } }; diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index 40440d10..1a8d275a 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -33,6 +33,7 @@ import { SharedContext } from '@/layouts'; import './index.less'; const { Text } = Typography; +const isDemoEnv = window.__ENV__DeployEnv === 'demo'; const Setting = () => { const { @@ -275,11 +276,17 @@ const Setting = () => { tabPosition="top" onChange={tabChange} items={[ - { - key: 'security', - label: '安全设置', - children: , - }, + ...(!isDemoEnv + ? [ + { + key: 'security', + label: '安全设置', + children: ( + + ), + }, + ] + : []), { key: 'app', label: '应用设置',