注册添加学号

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 departmentid = jsonObject.getString("departmentid");
String realname = jsonObject.getString("realname"); String realname = jsonObject.getString("realname");
String checkKey = jsonObject.getString("checkKey"); String checkKey = jsonObject.getString("checkKey");
String workon = jsonObject.getString("workno");
if(captcha==null){ if(captcha==null){
result.error500("验证码无效"); result.error500("验证码无效");
@ -1187,6 +1188,14 @@ public class SysUserController {
result.setSuccess(false); result.setSuccess(false);
return result; 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)){ if(oConvertUtils.isEmpty(realname)){
realname = username; realname = username;
@ -1198,6 +1207,7 @@ public class SysUserController {
String passwordEncode = PasswordUtil.encrypt(username, password, salt); String passwordEncode = PasswordUtil.encrypt(username, password, salt);
user.setSalt(salt); user.setSalt(salt);
user.setUsername(username); user.setUsername(username);
user.setWorkNo(workon);
user.setRealname(realname); user.setRealname(realname);
user.setPassword(passwordEncode); user.setPassword(passwordEncode);
//user.setEmail(email); //user.setEmail(email);

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

@ -27,6 +27,12 @@
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.name')" v-model:value="formData.realname" /> <a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.name')" v-model:value="formData.realname" />
</div> </div>
</a-form-item> </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> <a-form-item>
<div class="aui-input-line"> <div class="aui-input-line">
<!-- <Icon class="aui-icon" icon="ant-design:mobile-outlined" /> --> <!-- <Icon class="aui-icon" icon="ant-design:mobile-outlined" /> -->
@ -137,6 +143,7 @@
const formRef = ref(); const formRef = ref();
const formData = reactive<any>({ const formData = reactive<any>({
username: '', username: '',
workno: '',
mobile: '', mobile: '',
smscode: '', smscode: '',
password: '', password: '',
@ -228,6 +235,10 @@ const randCodeData = reactive<any>({
createMessage.warn(t('sys.login.passwordPlaceholder')); createMessage.warn(t('sys.login.passwordPlaceholder'));
return; return;
} }
if (!formData.workno) {
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
if (!formData.confirmPassword) { if (!formData.confirmPassword) {
createMessage.warn(t('sys.login.confirmPassword')); createMessage.warn(t('sys.login.confirmPassword'));
return; return;
@ -250,6 +261,7 @@ const randCodeData = reactive<any>({
try { try {
const resultInfo = await registerStu( const resultInfo = await registerStu(
toRaw({ toRaw({
workno: formData.workno,
username: formData.username, username: formData.username,
departmentid: formData.department, departmentid: formData.department,
realname: formData.realname, realname: formData.realname,
@ -286,7 +298,7 @@ const randCodeData = reactive<any>({
* 初始化表单 * 初始化表单
*/ */
function initForm() { 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)) { if (!unref(timer)) {
showInterval.value = true; showInterval.value = true;
clearInterval(unref(timer)); clearInterval(unref(timer));

Loading…
Cancel
Save