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