diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index d51c179..92d157a 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -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"); //登录验证码接口排除 diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java index f4d90c5..5170cd5 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java @@ -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 { return Result.OK("驳回成功!请到编辑页面确定问题数据并填写驳回原因"); } + @AutoLog(value = "专家注册") + @ApiOperation(value="专家注册", notes="专家注册") + @PostMapping (value = "userRegisterexp") + public Result 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("注册成功"); + } } diff --git a/jeecgboot-vue3/src/api/sys/user.ts b/jeecgboot-vue3/src/api/sys/user.ts index e28bcc3..a57f216 100644 --- a/jeecgboot-vue3/src/api/sys/user.ts +++ b/jeecgboot-vue3/src/api/sys/user.ts @@ -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: 获取短信验证码 */ diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue index a281f60..24b64d0 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue @@ -51,12 +51,6 @@ - - - - - -
@@ -121,7 +115,7 @@