注册添加学号

main
王家东 4 months ago
parent d128f70162
commit 46ab1d1a08
  1. 10
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  2. 1
      jeecgboot-vue3-master/src/locales/lang/zh-CN/sys.ts
  3. 14
      jeecgboot-vue3-master/src/views/system/loginmini/MiniRegister.vue

@ -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<SysUser> queryWrapper = new QueryWrapper<>();
queryWrapper.in("work_no", workon);
List<SysUser> 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);

@ -60,6 +60,7 @@ export default {
placeholder: '请输入锁屏密码或者用户密码',
},
login: {
workno: '工号/学号',
backSignIn: '返回',
signInFormTitle: '登录',
mobileSignInFormTitle: '手机登录',

@ -27,6 +27,12 @@
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.name')" v-model:value="formData.realname" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mobile-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.workno')" v-model:value="formData.workno" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<!-- <Icon class="aui-icon" icon="ant-design:mobile-outlined" /> -->
@ -137,6 +143,7 @@
const formRef = ref();
const formData = reactive<any>({
username: '',
workno: '',
mobile: '',
smscode: '',
password: '',
@ -228,6 +235,10 @@ const randCodeData = reactive<any>({
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<any>({
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<any>({
* 初始化表单
*/
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));

Loading…
Cancel
Save