Browse Source

密码6位限制

master
wenlele 9 months ago
parent
commit
66b0ebd405
  1. 2
      api/app/lib/controllers/auth/index.js
  2. 2
      web/client/src/sections/projectManagement/components/projectModel.js
  3. 2
      web/client/src/sections/projectManagement/components/replacement.js

2
api/app/lib/controllers/auth/index.js

@ -180,7 +180,7 @@ async function screenlogin (ctx, next) {
} }
let passwords = Hex.stringify(MD5(password)); let passwords = Hex.stringify(MD5(password));
if (username = !userRes.account || passwords != userRes.password) { if (username != userRes.account || passwords != userRes.password) {
message = '账号或密码错误' message = '账号或密码错误'
throw '' throw ''
} }

2
web/client/src/sections/projectManagement/components/projectModel.js

@ -95,7 +95,7 @@ const ProjectModel = ({ dispatch, actions, user, modelData, close, success, proj
{!modelData?.id && {!modelData?.id &&
<> <>
<Form.Item label='发布密码' name='password' initialValue={modelData?.password} <Form.Item label='发布密码' name='password' initialValue={modelData?.password}
rules={[{ required: true, }, { pattern: /^[a-zA-Z0-9]+$/, message: "请输入发布密码,至少6位数字或字母" }]} rules={[{ required: true, min: 6 }, { pattern: /^[a-zA-Z0-9]+$/, message: "请输入发布密码,至少6位数字或字母" }]}
// rules={[{ required: true, message: '请输入发布密码' },]} // rules={[{ required: true, message: '请输入发布密码' },]}
> >
<Input.Password autocomplete='new-password' onPaste={e => { <Input.Password autocomplete='new-password' onPaste={e => {

2
web/client/src/sections/projectManagement/components/replacement.js

@ -34,7 +34,7 @@ const Replacement = ({ dispatch, actions, user, close, onOk, }) => {
> >
<Form.Item label='发布密码' name='password' <Form.Item label='发布密码' name='password'
rules={[{ required: true, }, { pattern: /^[a-zA-Z0-9]+$/, message: "请输入发布密码,至少6位数字或字母" }]} rules={[{ required: true, min: 6 }, { pattern: /^[a-zA-Z0-9]+$/, message: "请输入发布密码,至少6位数字或字母" }]}
> >
<Input.Password autocomplete='new-password' onPaste={e => { <Input.Password autocomplete='new-password' onPaste={e => {
e.preventDefault(); e.preventDefault();

Loading…
Cancel
Save