From 6315425a7bbbde4c4d98101507000b894a8c74f4 Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 19 Oct 2021 21:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=AF=86=E7=A0=81=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/user.ts | 3 +++ src/pages/initialization/index.tsx | 10 ++++++++-- src/pages/setting/security.tsx | 8 +++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/back/services/user.ts b/back/services/user.ts index 9f3a7448..2b608f60 100644 --- a/back/services/user.ts +++ b/back/services/user.ts @@ -228,6 +228,9 @@ export default class UserService { username: string; password: string; }) { + if (password === 'admin') { + return { code: 400, message: '密码不能设置为admin' }; + } const authInfo = this.getAuthInfo(); this.updateAuthInfo(authInfo, { username, password }); return { code: 200, message: '更新成功' }; diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index 9e060dfd..fce2e8e9 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -153,7 +153,13 @@ const Initialization = () => { @@ -190,7 +196,7 @@ const Initialization = () => { { title: '完成安装', content: ( -
+
恭喜安装完成! diff --git a/src/pages/setting/security.tsx b/src/pages/setting/security.tsx index 84445142..a89c4d9e 100644 --- a/src/pages/setting/security.tsx +++ b/src/pages/setting/security.tsx @@ -175,7 +175,13 @@ const SecuritySettings = ({ user, userChange }: any) => {