From 66b0ebd40595b46fd5d6e600227006c8a32db8a9 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 24 Jan 2024 14:17:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AF=86=E7=A0=816=E4=BD=8D=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/auth/index.js | 2 +- .../src/sections/projectManagement/components/projectModel.js | 2 +- .../src/sections/projectManagement/components/replacement.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/app/lib/controllers/auth/index.js b/api/app/lib/controllers/auth/index.js index 3ffdc25..bce6f38 100644 --- a/api/app/lib/controllers/auth/index.js +++ b/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 '' } diff --git a/web/client/src/sections/projectManagement/components/projectModel.js b/web/client/src/sections/projectManagement/components/projectModel.js index df63e48..8388382 100644 --- a/web/client/src/sections/projectManagement/components/projectModel.js +++ b/web/client/src/sections/projectManagement/components/projectModel.js @@ -95,7 +95,7 @@ const ProjectModel = ({ dispatch, actions, user, modelData, close, success, proj {!modelData?.id && <> { diff --git a/web/client/src/sections/projectManagement/components/replacement.js b/web/client/src/sections/projectManagement/components/replacement.js index 682550a..85760d7 100644 --- a/web/client/src/sections/projectManagement/components/replacement.js +++ b/web/client/src/sections/projectManagement/components/replacement.js @@ -34,7 +34,7 @@ const Replacement = ({ dispatch, actions, user, close, onOk, }) => { > { e.preventDefault(); From 8df04e62a9096508bbbcd6485e6897be47658167 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 24 Jan 2024 14:31:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?pcode=E5=88=A4=E9=87=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/projectManagement/projectPublish.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/projectManagement/projectPublish.js b/api/app/lib/controllers/projectManagement/projectPublish.js index 91d57f4..b7efeec 100644 --- a/api/app/lib/controllers/projectManagement/projectPublish.js +++ b/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 } })