专家注册

master
王家东 4 weeks ago
parent ad55d5a6a7
commit 993b4c930a
  1. 1
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 58
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java
  3. 6
      jeecgboot-vue3/src/api/sys/user.ts
  4. 41
      jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue

@ -84,6 +84,7 @@ public class ShiroConfig {
}
// 配置不会被拦截的链接 顺序判断
filterChainDefinitionMap.put("/expert/expert/userRegisterexp", "anon"); //专家注册
filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除
filterChainDefinitionMap.put("/sys/checkCaptcha", "anon"); //登录验证码接口排除

@ -8,6 +8,7 @@ import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
@ -623,4 +624,61 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
return Result.OK("驳回成功!请到编辑页面确定问题数据并填写驳回原因");
}
@AutoLog(value = "专家注册")
@ApiOperation(value="专家注册", notes="专家注册")
@PostMapping (value = "userRegisterexp")
public Result<Object> userRegisterexp(@RequestBody JSONObject jsonObject) {
String emails = jsonObject.getString("emails");
String username = jsonObject.getString("username");
String ssdep = jsonObject.getString("ssdep");
String realname = jsonObject.getString("realname");
String psd = jsonObject.getString("psd");
String sepsd = jsonObject.getString("sepsd");
String phone = jsonObject.getString("phone");
String workon = jsonObject.getString("workon");
if (!psd.equals(sepsd)){
return Result.OK().error500("两次输入的密码不同");
}
//判断是用户名是否存在
String isusername = expertService.isusername(username);
if(isusername.equals("1")){
Result.OK().error500("当前的用户名已经存在");
}
//判断工号是否存在
String isworkon =expertService.isworkon(workon);
if (isworkon.equals("1")){
Result.OK().error500("当前的工号已经存在");
}
//判断电话号码是否存在
String isphone = expertService.isphone(phone);
if (isphone.equals("1")){
Result.OK().error500("当前的电话号码已经存在");
}
//判断电子邮件是否存在
String isemils = expertService.isemils(emails);
if (isemils.equals("1")){
Result.OK().error500("当前的电子邮件已经存在");
}
//开始添加到用户表
SysUser user = new SysUser();
user.setRealname(realname);
user.setUsername(username);
user.setWorkNo(workon);
user.setEmail(emails);
user.setPhone(phone);
user.setCreateTime(new Date());//设置创建时间
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(username, psd, salt);
user.setPassword(passwordEncode);
user.setStatus(1);
user.setDelFlag(CommonConstant.DEL_FLAG_0);
sysUserService.saveUser(user, "1843478958968647681", ssdep, "");
Expert expert = new Expert();
expert.setSeusername(username);
expertService.save(expert);
return Result.OK("注册成功");
}
}

@ -31,6 +31,8 @@ enum Api {
userRegister4Shenbaoren = '/sys/user/userRegister4Shenbaoren',
//
userRegister4Faren = '/sys/user/userRegister4Faren',
//
userRegisterexp = '/expert/expert/userRegisterexp',
//
checkOnlyUser = '/sys/user/checkOnlyUser',
//SSO
@ -127,6 +129,10 @@ export function registerFaren(params) {
return defHttp.post({url: Api.userRegister4Faren, params}, {isReturnNativeResponse: true});
}
export function registerexp(params) {
return defHttp.post({url: Api.userRegisterexp, params}, {isReturnNativeResponse: true});
}
/**
* @description: 获取短信验证码
*/

@ -51,12 +51,6 @@
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
@ -121,7 +115,7 @@
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerFaren, getCodeInfo } from '/@/api/sys/user';
import { getCaptcha, registerFaren, registerexp,getCodeInfo } from '/@/api/sys/user';
import { SmsEnum } from '/@/views/sys/login/useLogin';
import { useMessage } from '/@/hooks/web/useMessage';
import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
@ -232,14 +226,8 @@
createMessage.warn(t('请输入工号'));
return;
}
if (!formData.sex) {
createMessage.warn(t('请输入性别'));
return;
}
if (!formData.ssdep) {
createMessage.warn(t('sys.login.selectorgPlaceholder'));
return;
}
if (!formData.phone) {
createMessage.warn(t('请输入电话'));
return;
@ -248,10 +236,6 @@
createMessage.warn(t('请输入邮箱'));
return;
}
if (!formData.password) {
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
registerAccount();
}
@ -260,19 +244,16 @@
*/
async function registerAccount() {
try {
const resultInfo = await registerFaren(
const resultInfo = await registerexp(
toRaw({
// workno: formData.workno,
username: formData.username,
departmentid: formData.department,
username: formData.seusername,
ssdep: formData.ssdep,
realname: formData.realname,
password: formData.password,
phone: formData.mobile,
smscode: formData.smscode,
checkKey: randCodeData.checkKey,
idNo: formData.idNo,
certificateCode: formData.certificateCode,
orgName: formData.orgName,
psd: formData.psd,
sepsd: formData.sepsd,
phone: formData.phone,
emails: formData.emails,
workon: formData.emails,
})
);
if (resultInfo && resultInfo.data.success) {

Loading…
Cancel
Save