From 46ab1d1a08d203791b8b33a64f794c33bc00d091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Tue, 30 Jul 2024 14:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=B7=BB=E5=8A=A0=E5=AD=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SysUserController.java | 10 ++++++++++ .../src/locales/lang/zh-CN/sys.ts | 1 + .../src/views/system/loginmini/MiniRegister.vue | 14 +++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 1af4c42d..a0e964ec 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -1145,6 +1145,7 @@ public class SysUserController { String departmentid = jsonObject.getString("departmentid"); String realname = jsonObject.getString("realname"); String checkKey = jsonObject.getString("checkKey"); + String workon = jsonObject.getString("workno"); if(captcha==null){ result.error500("验证码无效"); @@ -1187,6 +1188,14 @@ public class SysUserController { result.setSuccess(false); return result; } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("work_no", workon); + List sysUser3 = sysUserService.list(queryWrapper); + if (sysUser3.size()>0) { + result.setMessage("该学号/工号已注册"); + result.setSuccess(false); + return result; + } if(oConvertUtils.isEmpty(realname)){ realname = username; @@ -1198,6 +1207,7 @@ public class SysUserController { String passwordEncode = PasswordUtil.encrypt(username, password, salt); user.setSalt(salt); user.setUsername(username); + user.setWorkNo(workon); user.setRealname(realname); user.setPassword(passwordEncode); //user.setEmail(email); diff --git a/jeecgboot-vue3-master/src/locales/lang/zh-CN/sys.ts b/jeecgboot-vue3-master/src/locales/lang/zh-CN/sys.ts index 6d020b7c..f37df5c2 100644 --- a/jeecgboot-vue3-master/src/locales/lang/zh-CN/sys.ts +++ b/jeecgboot-vue3-master/src/locales/lang/zh-CN/sys.ts @@ -60,6 +60,7 @@ export default { placeholder: '请输入锁屏密码或者用户密码', }, login: { + workno: '工号/学号', backSignIn: '返回', signInFormTitle: '登录', mobileSignInFormTitle: '手机登录', diff --git a/jeecgboot-vue3-master/src/views/system/loginmini/MiniRegister.vue b/jeecgboot-vue3-master/src/views/system/loginmini/MiniRegister.vue index ba2d25c0..6df31a98 100644 --- a/jeecgboot-vue3-master/src/views/system/loginmini/MiniRegister.vue +++ b/jeecgboot-vue3-master/src/views/system/loginmini/MiniRegister.vue @@ -27,6 +27,12 @@ + +
+ + +
+
@@ -137,6 +143,7 @@ const formRef = ref(); const formData = reactive({ username: '', + workno: '', mobile: '', smscode: '', password: '', @@ -228,6 +235,10 @@ const randCodeData = reactive({ createMessage.warn(t('sys.login.passwordPlaceholder')); return; } + if (!formData.workno) { + createMessage.warn(t('sys.login.passwordPlaceholder')); + return; + } if (!formData.confirmPassword) { createMessage.warn(t('sys.login.confirmPassword')); return; @@ -250,6 +261,7 @@ const randCodeData = reactive({ try { const resultInfo = await registerStu( toRaw({ + workno: formData.workno, username: formData.username, departmentid: formData.department, realname: formData.realname, @@ -286,7 +298,7 @@ const randCodeData = reactive({ * 初始化表单 */ function initForm() { - Object.assign(formData, { username: '', mobile: '', realname: '', department: '', smscode: '', password: '', confirmPassword: ''/*, policy: false*/ }); + Object.assign(formData, { workno: '', username: '', mobile: '', realname: '', department: '', smscode: '', password: '', confirmPassword: ''/*, policy: false*/ }); if (!unref(timer)) { showInterval.value = true; clearInterval(unref(timer));