mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
检查密码默认值
This commit is contained in:
parent
c42299766c
commit
6315425a7b
|
@ -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: '更新成功' };
|
||||
|
|
|
@ -153,7 +153,13 @@ const Initialization = () => {
|
|||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true }]}
|
||||
rules={[
|
||||
{ required: true },
|
||||
{
|
||||
pattern: /^(?!admin$).*$/,
|
||||
message: '密码不能为admin',
|
||||
},
|
||||
]}
|
||||
hasFeedback
|
||||
style={{ maxWidth: 350 }}
|
||||
>
|
||||
|
@ -190,7 +196,7 @@ const Initialization = () => {
|
|||
{
|
||||
title: '完成安装',
|
||||
content: (
|
||||
<div className={styles.top} style={{ marginTop: 100 }}>
|
||||
<div className={styles.top} style={{ marginTop: 80 }}>
|
||||
<div className={styles.header}>
|
||||
<span className={styles.title}>恭喜安装完成!</span>
|
||||
<Link href="https://github.com/whyour/qinglong" target="_blank">
|
||||
|
|
|
@ -175,7 +175,13 @@ const SecuritySettings = ({ user, userChange }: any) => {
|
|||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true }]}
|
||||
rules={[
|
||||
{ required: true },
|
||||
{
|
||||
pattern: /^(?!admin$).*$/,
|
||||
message: '密码不能为admin',
|
||||
},
|
||||
]}
|
||||
hasFeedback
|
||||
style={{ maxWidth: 300 }}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue
Block a user