zhaobing 9 months ago
parent
commit
256cc69f72
  1. 2
      api/app/lib/controllers/auth/index.js
  2. 10
      api/app/lib/controllers/projectManagement/projectPublish.js
  3. 2
      web/client/src/sections/projectManagement/components/projectModel.js
  4. 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));
if (username = !userRes.account || passwords != userRes.password) {
if (username != userRes.account || passwords != userRes.password) {
message = '账号或密码错误'
throw ''
}

10
api/app/lib/controllers/projectManagement/projectPublish.js

@ -57,7 +57,7 @@ async function postProjectPublish (ctx, next) {
try {
const models = ctx.fs.dc.models
const data = ctx.request.body
const { id, password, projectName, replacement } = data
const { id, password, projectName, replacement, isCode, code } = data
let findOne = await models.ProjectUser.findOne({ where: { projectName } })
if ((!id && findOne) || (findOne && findOne.id != id)) {
@ -65,6 +65,14 @@ async function postProjectPublish (ctx, next) {
throw ''
}
if (isCode) {
let codeOne = await models.ProjectUser.findOne({ where: { code } })
if (codeOne) {
message = 'pcode重复'
throw ''
}
}
if (replacement) {
let pass = Hex.stringify(MD5(password));
await models.ProjectUser.update({ password: pass, }, { where: { id } })

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

@ -95,7 +95,7 @@ const ProjectModel = ({ dispatch, actions, user, modelData, close, success, proj
{!modelData?.id &&
<>
<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: '请输入发布密码' },]}
>
<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'
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 => {
e.preventDefault();

Loading…
Cancel
Save