申报人注册功能添加

master
zhc077 2 months ago
parent 76eea2db8a
commit 847e775b5d
  1. 5
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 1175
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  3. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
  4. 53
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java
  5. 2
      jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  6. 8
      jeecgboot-vue3/src/api/sys/user.ts
  7. 6
      jeecgboot-vue3/src/components/Form/src/jeecg/components/modal/DeptSelectModal.vue
  8. 7
      jeecgboot-vue3/src/locales/lang/zh-CN/sys.ts
  9. 39
      jeecgboot-vue3/src/views/system/loginmini/MiniLogin.vue
  10. 178
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue
  11. 360
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue
  12. 353
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue

@ -173,9 +173,8 @@ public class ShiroConfig {
// 企业微信证书排除
filterChainDefinitionMap.put("/WW_verify*", "anon");
filterChainDefinitionMap.put("/sys/sysDepart/queryDepartStuTreeSync", "anon"); //申报人部门注册接口排除
filterChainDefinitionMap.put("/sys/sysDepart/queryTreeStuList", "anon"); //申报人部门注册接口排除
filterChainDefinitionMap.put("/sys/user/userRegister4Shenbaoren", "anon");//申报人用户注册
filterChainDefinitionMap.put("/sys/user/userRegister4Faren", "anon"); //法人注册接口
filterChainDefinitionMap.put("/sys/user/userRegister4Shenbaoren", "anon");//申报人注册
filterChainDefinitionMap.put("/sys/sysDepart/queryDepartTreeSync", "anon");//申报人用户注册

@ -173,6 +173,9 @@ public class SysUser implements Serializable {
@Excel(name="(1普通成员 2上级)",width = 15)
private Integer userIdentity;
@Excel(name="(身份证号)")
private String idNo;
/**
* 负责部门
*/

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.netty.util.internal.StringUtil;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.config.TenantContext;
@ -43,7 +44,7 @@ import java.util.stream.Collectors;
* <p>
* 部门表 服务实现类
* <p>
*
*
* @Author Steve
* @Since 2019-01-22
*/
@ -79,14 +80,14 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
query.or().likeRight(SysDepart::getOrgCode,codeArr[i]);
}
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
//------------------------------------------------------------------------------------------------
//是否开启系统管理模块的 SASS 控制
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
query.eq(SysDepart::getTenantId, oConvertUtils.getInt(TenantContext.getTenant(), 0));
}
//------------------------------------------------------------------------------------------------
query.orderByAsc(SysDepart::getDepartOrder);
//将父节点ParentId设为null
List<SysDepart> listDepts = this.list(query);
@ -113,7 +114,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
query.eq(SysDepart::getTenantId, oConvertUtils.getInt(TenantContext.getTenant(), 0));
}
}
//------------------------------------------------------------------------------------------------
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
query.orderByAsc(SysDepart::getDepartOrder);
@ -187,7 +188,9 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
//update-end---author:wangshuai ---date:20230216 for:[QQYUN-4163]给部门表加个是否有子节点------------
//String s = UUID.randomUUID().toString().replace("-", "");
sysDepart.setId(IdWorker.getIdStr(sysDepart));
if(StringUtils.isBlank(sysDepart.getId())){
sysDepart.setId(IdWorker.getIdStr(sysDepart));
}
// 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
// 获取父级ID
String parentId = sysDepart.getParentId();
@ -221,14 +224,14 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
}
/**
* saveDepartData 的调用方法,生成部门编码和部门类型作废逻辑
* @deprecated
* @param parentId
* @return
*/
private String[] generateOrgCode(String parentId) {
private String[] generateOrgCode(String parentId) {
//update-begin--Author:Steve Date:20190201 for:组织机构添加数据代码调整
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
LambdaQueryWrapper<SysDepart> query1 = new LambdaQueryWrapper<SysDepart>();
@ -286,16 +289,16 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
strArray[1] = orgType;
return strArray;
//update-end--Author:Steve Date:20190201 for:组织机构添加数据代码调整
}
}
/**
* removeDepartDataById 对应 delete方法 根据ID删除相关部门数据
*
*
*/
/*
* @Override
*
*
* @Transactional public boolean removeDepartDataById(String id) {
* System.out.println("要删除的ID 为=============================>>>>>"+id); boolean
* flag = this.removeById(id); return flag; }
@ -321,7 +324,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteBatchWithChildren(List<String> ids) {
@ -462,13 +465,13 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
return ok;
}
/**
* delete 方法调用
* @param id
* @param idList
*/
private void checkChildrenExists(String id, List<String> idList) {
private void checkChildrenExists(String id, List<String> idList) {
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
query.eq(SysDepart::getParentId,id);
List<SysDepart> departList = this.list(query);
@ -489,7 +492,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
public List<SysDepart> queryDepartsByUsername(String username) {
return baseMapper.queryDepartsByUsername(username);
}
@Override
public List<String> queryDepartsByUserId(String userId) {
List<String> list = baseMapper.queryDepartsByUserId(userId);
@ -508,7 +511,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
if(oConvertUtils.isNotEmpty(departIds)){
query.in(SysDepart::getId, Arrays.asList(departIds.split(",")));
}
//------------------------------------------------------------------------------------------------
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
@ -724,7 +727,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
}
}
//update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增方法添加部门负责人、删除负责部门负责人、查询部门对应的负责人
/**
* 通过用户id设置负责部门
@ -760,7 +763,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
}
}
/**
* 修改用户负责部门
* @param sysDepart SysDepart对象
@ -787,7 +790,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
//找到原来负责部门的用户id与新的负责部门用户id,进行新增
String addUserIds = Arrays.stream(directorIds.split(",")).filter(item -> !oldDirectorIds.contains(item)).collect(Collectors.joining(","));
if(oConvertUtils.isNotEmpty(addUserIds)){
this.addDepartByUserIds(sysDepart,addUserIds);
this.addDepartByUserIds(sysDepart,addUserIds);
}
}
}
@ -803,7 +806,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
query.like(SysUser::getDepartIds,departId);
//删除全部的情况下用户id不存在
if(oConvertUtils.isNotEmpty(userId)){
query.eq(SysUser::getId,userId);
query.eq(SysUser::getId,userId);
}
List<SysUser> userList = sysUserMapper.selectList(query);
for (SysUser sysUser:userList) {
@ -838,14 +841,14 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
String userIds = map.get(departId) + "," + user.getId();
map.put(departId,userIds);
}else{
map.put(departId,user.getId());
map.put(departId,user.getId());
}
}
}
//循环部门集合找到部门id对应的负责用户
for (SysDepart sysDepart:departList) {
if(map.containsKey(sysDepart.getId())){
sysDepart.setDirectorUserIds(map.get(sysDepart.getId()).toString());
sysDepart.setDirectorUserIds(map.get(sysDepart.getId()).toString());
}
}
}
@ -1008,7 +1011,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
public void importExcel(List<ExportDepartVo> listSysDeparts, List<String> errorMessageList) {
int num = 0;
int tenantId = oConvertUtils.getInt(TenantContext.getTenant(), 0);
//部门路径排序
Collections.sort(listSysDeparts, new Comparator<ExportDepartVo>() {
@Override
@ -1073,7 +1076,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}else{
name = departNameUrl;
}
if(!name.equals(departName)){
//部门名称已存在
errorMessageList.add("第 " + lineNumber + " 行:记录部门路径:”"+departNameUrl+"“"+"和部门名称:“"+departName+"“不一致,请检查!");
@ -1146,7 +1149,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
sysDepart.setDepartName(departName);
return true;
}
}
}

@ -293,7 +293,7 @@ cas:
logging:
level:
org.flywaydb: debug
org.jeecg.modules.system.mapper: info
org.jeecg.modules.system.mapper: debug
#swagger
knife4j:
#开启增强配置

@ -29,6 +29,8 @@ enum Api {
registerApi = '/sys/user/register',
//
userRegister4Shenbaoren = '/sys/user/userRegister4Shenbaoren',
//
userRegister4Faren = '/sys/user/userRegister4Faren',
//
checkOnlyUser = '/sys/user/checkOnlyUser',
//SSO
@ -117,10 +119,14 @@ export function getCodeInfo(currdatetime) {
return defHttp.get({ url: url });
}
export function registerStu(params) {
export function registerShenbaoren(params) {
return defHttp.post({url: Api.userRegister4Shenbaoren, params}, {isReturnNativeResponse: true});
}
export function registerFaren(params) {
return defHttp.post({url: Api.userRegister4Faren, params}, {isReturnNativeResponse: true});
}
/**
* @description: 获取短信验证码
*/

@ -53,7 +53,7 @@
//
modalTitle: {
type: String,
default: '部门选择',
default: '单位选择',
},
// update-begin--author:liaozhiyang---date:20231220---forQQYUN-7678
maxHeight: {
@ -69,7 +69,7 @@
const [register, { closeModal }] = useModalInner();
const attrs = useAttrs();
const treeRef = ref<Nullable<TreeActionType>>(null);
//update-begin-author:taoyan date:2022-10-28 for:
let propValue = props.value === ''?[]:props.value;
//update-begin-author:liusq date:2023-05-26 for: [issues/538]JSelectDept dynamicDisabled
@ -77,7 +77,7 @@
const getBindValue = omit(temp, 'multiple');
//update-end-author:liusq date:2023-05-26 for: [issues/538]JSelectDept dynamicDisabled
//update-end-author:taoyan date:2022-10-28 for:
const queryUrl = getQueryUrl();
const [{ visibleChange, checkedKeys, getCheckStrictly, getSelectTreeData, onCheck, onLoadData, treeData, checkALL, expandAll, onSelect }] =
useTreeBiz(treeRef, queryUrl, getBindValue, props, emit);

@ -75,7 +75,7 @@ export default {
loginButton: '登录',
registerButton: '注册',
registerButton4danwei: '单位注册',
registerButton4faren: '法人注册',
registerButton4shenbaoren: '申报人注册',
rememberMe: '记住我',
forgetPassword: '忘记密码?',
@ -94,7 +94,10 @@ export default {
mobileCorrectPlaceholder: '请输入正确的手机号码',
policyPlaceholder: '勾选后才能注册',
diffPwd: '两次输入密码不一致',
selectdep: '请选择所属部门/单位',
selectorgPlaceholder: '请选择所属单位',
realNamePlaceholder: '请输入姓名',
workNoPlaceholder: '请输入工号',
userName: '账号',
password: '密码',

@ -91,15 +91,15 @@
<a-button :loading="loginLoading" class="aui-link-login" type="primary" @click="loginHandleClick">
{{ t('sys.login.loginButton') }}</a-button>
</div>
<div class="aui-flex">
<!-- <div class="aui-flex">
<a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a>
</div>
</div>-->
<div class="aui-flex">
<!--
<a class="aui-linek-code aui-flex-box" @click="registerHandleClick">{{ t('sys.login.registerButton') }}</a>
-->
<a class="aui-linek-code aui-flex-box" @click="registerHandleClick">{{ t('sys.login.registerButton4danwei') }}</a>
<a class="aui-linek-code aui-flex-box" @click="registerHandleClick">{{ t('sys.login.registerButton4shenbaoren') }}</a>
<a class="aui-linek-code aui-flex-box" @click="registerRef4farenHandleClick">{{ t('sys.login.registerButton4faren') }}</a>
<a class="aui-linek-code aui-flex-box" @click="registerRef4shenbaorenHandleClick">{{ t('sys.login.registerButton4shenbaoren') }}</a>
</div>
</div>
</div>
@ -143,6 +143,12 @@
<div v-show="type === 'register'" :class="`${prefixCls}-form`">
<MiniRegister ref="registerRef" @go-back="goBack" @success="handleSuccess" />
</div>
<div v-show="type === 'registerRef4shenbaoren'" :class="`${prefixCls}-form`">
<MiniRegister4shenbaoren ref="registerRef4shenbaoren" @go-back="goBack" @success="handleSuccess" />
</div>
<div v-show="type === 'registerRef4faren'" :class="`${prefixCls}-form`">
<MiniRegister4faren ref="registerRef4faren" @go-back="goBack" @success="handleSuccess" />
</div>
<div v-show="type === 'codeLogin'" :class="`${prefixCls}-form`">
<MiniCodelogin ref="codeRef" @go-back="goBack" @success="handleSuccess" />
</div>
@ -176,6 +182,8 @@
import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
import { useModal } from "@/components/Modal";
import { ExceptionEnum } from "@/enums/exceptionEnum";
import MiniRegister4shenbaoren from "@/views/system/loginmini/MiniRegister4shenbaoren.vue";
import MiniRegister4faren from "@/views/system/loginmini/MiniRegister4faren.vue";
const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js',
@ -221,6 +229,8 @@
const forgotRef = ref();
//
const registerRef = ref();
const registerRef4shenbaoren = ref();
const registerRef4faren = ref();
const loginLoading = ref<boolean>(false);
const { getIsMobile } = useAppInject();
const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
@ -419,6 +429,27 @@
}, 300);
}
/**
* 注册
*/
function registerRef4shenbaorenHandleClick() {
type.value = 'registerRef4shenbaoren';
setTimeout(() => {
registerRef4shenbaoren.value.initForm();
}, 300);
}
/**
* 注册
*/
function registerRef4farenHandleClick() {
type.value = 'registerRef4faren';
setTimeout(() => {
registerRef4faren.value.initForm();
}, 300);
}
/**
* 注册
*/

@ -23,93 +23,48 @@
</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.realName')" 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">-->
<!-- &lt;!&ndash; <Icon class="aui-icon" icon="ant-design:mobile-outlined" /> &ndash;&gt;-->
<!-- &lt;!&ndash; <a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.department')" />&ndash;&gt;-->
<!-- <JStuSelectDept v-model:value="formData.department" :multi="false" />-->
<!-- </div>-->
<!-- </a-form-item>-->
<a-form-item>
<div class="aui-input-line">
<JSelectDept v-model:value="formData.department" :multi="false" type="array" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mobile-outlined" />
<Icon class="aui-icon" icon="ant-design:mobile-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.mobile')" v-model:value="formData.mobile" />
</div>
</a-form-item>
<!-- <a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mail-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.smsCode')" v-model:value="formData.smscode" />
<div v-if="showInterval" class="aui-code-line" @click="getLoginCode">{{t('component.countdown.normalText')}}</div>
<div v-else class="aui-code-line">{{t('component.countdown.sendText',[unref(timeRuning)])}}</div>
</div>
</a-form-item> -->
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="pwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.password')"
v-model:value="formData.password"
/>
<Icon class="aui-icon" icon="ant-design:lock-outlined"/>
<a-input class="fix-auto-fill" :type="pwdIndex==='close'?'password':'text'" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="pwdIndex === 'open'" @click="pwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="pwdIndex === 'close'" @click="pwdClick('open')" />
<img :src="eyeKImg" alt="开启" v-if="pwdIndex==='open'" @click="pwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="pwdIndex==='close'" @click="pwdClick('open')" />
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="confirmPwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.confirmPassword')"
v-model:value="formData.confirmPassword"
/>
<Icon class="aui-icon" icon="ant-design:lock-outlined"/>
<a-input class="fix-auto-fill" :type="confirmPwdIndex==='close'?'password':'text'" :placeholder="t('sys.login.confirmPassword')" v-model:value="formData.confirmPassword" />
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="confirmPwdIndex === 'open'" @click="confirmPwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="confirmPwdIndex === 'close'" @click="confirmPwdClick('open')" />
<img :src="eyeKImg" alt="开启" v-if="confirmPwdIndex==='open'" @click="confirmPwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="confirmPwdIndex==='close'" @click="confirmPwdClick('open')" />
</div>
</div>
</a-form-item>
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.smscode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
<a-form-item name="policy">
<div class="aui-flex">
<div class="aui-flex-box">
<div class="aui-choice">
<a-checkbox v-model:checked="formData.policy" />
<span style="color: #1b90ff;margin-left: 4px">{{ t('sys.login.policy') }}</span>
</div>
</div>
</div>
</div>
<!-- <a-form-item name="policy">
<div class="aui-flex">
<div class="aui-flex-box">
<div class="aui-choice">
<a-checkbox v-model:checked="formData.policy" />
<span style="color: #1b90ff;margin-left: 4px">{{ t('sys.login.policy') }}</span>
</div>
</div>
</div>
</a-form-item>-->
</a-form-item>
</div>
</div>
<div class="aui-formButton">
@ -126,22 +81,23 @@
</div>
</div>
</div>
<!-- 图片验证码弹窗 -->
<CaptchaModal @register="captchaRegisterModal" @ok="getLoginCode" />
</template>
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerStu, getCodeInfo } from '/@/api/sys/user';
import { ref, reactive, unref, toRaw } from 'vue';
import { getCaptcha, register } 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';
import jeecgAdTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import eyeKImg from '/@/assets/loginmini/icon/icon-eye-k.png';
import eyeGImg from '/@/assets/loginmini/icon/icon-eye-g.png';
import JStuSelectDept from '/@/components/Form/src/jeecg/components/JStuSelectDept.vue';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import codeImg from '/@/assets/images/checkcode.png';
import { useI18n } from "/@/hooks/web/useI18n";
import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
import { useModal } from "@/components/Modal";
import { ExceptionEnum } from "@/enums/exceptionEnum";
const { t } = useI18n();
const { notification, createErrorModal, createMessage } = useMessage();
@ -149,17 +105,12 @@
const formRef = ref();
const formData = reactive<any>({
username: '',
workno: '',
mobile: '',
smscode: '',
password: '',
confirmPassword: '',
// policy: false,
realname: '',
department: '',
policy: false,
});
//
//
const showInterval = ref<boolean>(true);
//60s
@ -170,6 +121,7 @@
const pwdIndex = ref<string>('close');
//
const confirmPwdIndex = ref<string>('close');
const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
/**
* 返回
@ -178,21 +130,7 @@
emit('go-back');
initForm();
}
//
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
}
/**
* 获取手机验证码
*/
@ -201,7 +139,13 @@
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
const result = await getCaptcha({ mobile: formData.mobile, smsmode: SmsEnum.REGISTER });
//update-begin---author:wangshuai---date:2024-04-18---for:QQYUN-9005IP15---
const result = await getCaptcha({ mobile: formData.mobile, smsmode: SmsEnum.REGISTER }).catch((res) =>{
if(res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE){
openCaptchaModal(true, {});
}
});
//update-end---author:wangshuai---date:2024-04-18---for:QQYUN-9005IP15---
if (result) {
const TIME_COUNT = 60;
if (!unref(timer)) {
@ -225,26 +169,18 @@
createMessage.warn(t('sys.login.accountPlaceholder'));
return;
}
if (!formData.realname) {
createMessage.warn(t('sys.login.realName'));
return;
}
if (!formData.department) {
createMessage.warn(t('sys.login.selectdep'));
return;
}
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
if (!formData.smscode) {
createMessage.warn(t('sys.login.smsPlaceholder'));
return;
}
if (!formData.password) {
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;
@ -253,14 +189,10 @@
createMessage.warn(t('sys.login.diffPwd'));
return;
}
if (!formData.smscode) {
createMessage.warn(t('sys.login.smsPlaceholder'));
if(!formData.policy){
createMessage.warn(t('sys.login.policyPlaceholder'));
return;
}
// if (!formData.policy) {
// createMessage.warn(t('sys.login.policyPlaceholder'));
// return;
// }
registerAccount();
}
@ -269,16 +201,12 @@
*/
async function registerAccount() {
try {
const resultInfo = await registerStu(
const resultInfo = await register(
toRaw({
workno: formData.workno,
username: formData.username,
departmentid: formData.department,
realname: formData.realname,
password: formData.password,
phone: formData.mobile,
smscode: formData.smscode,
checkKey: randCodeData.checkKey,
})
);
if (resultInfo && resultInfo.data.success) {
@ -308,8 +236,8 @@
* 初始化表单
*/
function initForm() {
Object.assign(formData, { workno: '', username: '', mobile: '', realname: '', department: '', smscode: '', password: '', confirmPassword: ''/*, policy: false*/ });
if (!unref(timer)) {
Object.assign(formData,{username:'',mobile: '', smscode: '', password: '', confirmPassword: '', policy: false})
if(!unref(timer)){
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
@ -332,19 +260,15 @@
function confirmPwdClick(value) {
confirmPwdIndex.value = value;
}
onMounted(() => {
//
handleChangeCheckCode();
});
defineExpose({
initForm,
});
</script>
defineExpose({
initForm
})
</script>
<style lang="less" scoped>
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
.aui-input-line .aui-icon {
.aui-input-line .aui-icon{
position: absolute;
z-index: 2;
top: 10px;

@ -0,0 +1,360 @@
<template>
<div class="aui-content">
<div class="aui-container">
<div class="aui-form">
<div class="aui-image">
<div class="aui-image-text">
<img :src="jeecgAdTextImg" alt="" />
</div>
</div>
<div class="aui-formBox">
<div class="aui-formWell">
<a-form ref="formRef" :model="formData">
<div class="aui-flex aui-form-nav aui-clear-left" style="padding-bottom: 21px">
<div class="aui-flex-box activeNav on">{{t('sys.login.registerButton4faren')}}</div>
</div>
<div class="aui-form-box">
<div class="aui-account aui-account-line">
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('请输入单位名称')" v-model:value="formData.orgName" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('请输入统一社会信用代码')" v-model:value="formData.certificateCode" />
</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('请输法人姓名')" v-model:value="formData.realname" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('请输法人身份证号')" v-model:value="formData.idNo" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<JSelectDept :placeholder="t('sys.login.selectorgPlaceholder')" v-model:value="formData.department" :multiple="false" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.accountPlaceholder')" v-model:value="formData.username" />
</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.mobilePlaceholder')" v-model:value="formData.mobile" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="pwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.passwordPlaceholder')"
v-model:value="formData.password"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="pwdIndex === 'open'" @click="pwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="pwdIndex === 'close'" @click="pwdClick('open')" />
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="confirmPwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.confirmPassword')"
v-model:value="formData.confirmPassword"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="confirmPwdIndex === 'open'" @click="confirmPwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="confirmPwdIndex === 'close'" @click="confirmPwdClick('open')" />
</div>
</div>
</a-form-item>
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.smsPlaceholder')" v-model:value="formData.smscode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
</div>
</div>
</div>
</div>
<div class="aui-formButton">
<div class="aui-flex">
<a class="aui-link-login aui-flex-box" @click="registerHandleClick"> {{ t('sys.login.registerButton') }}</a>
</div>
<div class="aui-flex">
<a class="aui-linek-code aui-flex-box" @click="goBackHandleClick">{{ t('sys.login.backSignIn') }}</a>
</div>
</div>
</a-form>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerFaren, 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';
import jeecgAdTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import eyeKImg from '/@/assets/loginmini/icon/icon-eye-k.png';
import eyeGImg from '/@/assets/loginmini/icon/icon-eye-g.png';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import codeImg from '/@/assets/images/checkcode.png';
const { t } = useI18n();
const { notification, createErrorModal, createMessage } = useMessage();
const emit = defineEmits(['go-back', 'success', 'register']);
const formRef = ref();
const formData = reactive<any>({
username: '',
// workno: '',
mobile: '',
smscode: '',
password: '',
confirmPassword: '',
// policy: false,
realname: '',
department: '',
});
//
//
const showInterval = ref<boolean>(true);
//60s
const timeRuning = ref<number>(60);
//
const timer = ref<any>(null);
//
const pwdIndex = ref<string>('close');
//
const confirmPwdIndex = ref<string>('close');
/**
* 返回
*/
function goBackHandleClick() {
emit('go-back');
initForm();
}
//
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
}
/**
* 获取手机验证码
*/
async function getLoginCode() {
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
const result = await getCaptcha({ mobile: formData.mobile, smsmode: SmsEnum.REGISTER });
if (result) {
const TIME_COUNT = 60;
if (!unref(timer)) {
timeRuning.value = TIME_COUNT;
showInterval.value = false;
timer.value = setInterval(() => {
if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
timeRuning.value = timeRuning.value - 1;
} else {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
}, 1000);
}
}
}
function registerHandleClick() {
if (!formData.orgName) {
createMessage.warn(t('请输入单位名称'));
return;
}
if (!formData.certificateCode) {
createMessage.warn(t('请输入统一社会信用代码'));
return;
}
if (!formData.realname) {
createMessage.warn(t('sys.login.realNamePlaceholder'));
return;
}
if (!formData.idNo) {
createMessage.warn(t('请输法人身份证号'));
return;
}
if (!formData.department) {
createMessage.warn(t('sys.login.selectorgPlaceholder'));
return;
}
if (!formData.username) {
createMessage.warn(t('sys.login.accountPlaceholder'));
return;
}
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
if (!formData.password) {
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;
}
if (formData.password !== formData.confirmPassword) {
createMessage.warn(t('sys.login.diffPwd'));
return;
}
if (!formData.smscode) {
createMessage.warn(t('sys.login.smsPlaceholder'));
return;
}
// if (!formData.policy) {
// createMessage.warn(t('sys.login.policyPlaceholder'));
// return;
// }
registerAccount();
}
/**
* 注册账号
*/
async function registerAccount() {
try {
const resultInfo = await registerFaren(
toRaw({
// workno: formData.workno,
username: formData.username,
departmentid: formData.department,
realname: formData.realname,
password: formData.password,
phone: formData.mobile,
smscode: formData.smscode,
checkKey: randCodeData.checkKey,
idNo: formData.idNo,
certificateCode: formData.certificateCode,
orgName: formData.orgName,
})
);
if (resultInfo && resultInfo.data.success) {
notification.success({
description: resultInfo.data.message || t('sys.api.registerMsg'),
duration: 3,
});
emit('success', { username: formData.username, password: formData.password });
initForm();
} else {
notification.warning({
message: t('sys.api.errorTip'),
description: resultInfo.data.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
} catch (error) {
notification.error({
message: t('sys.api.errorTip'),
description: error.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
}
/**
* 初始化表单
*/
function initForm() {
Object.assign(formData, { workno: '', username: '', mobile: '', realname: '', department: '', smscode: '', password: '',
confirmPassword: '',
idNo: '',
certificateCode: '',
orgName: '',
});
if (!unref(timer)) {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
formRef.value.resetFields();
}
/**
* 密码打开或关闭
* @param value
*/
function pwdClick(value) {
pwdIndex.value = value;
}
/**
* 确认密码打开或关闭
* @param value
*/
function confirmPwdClick(value) {
confirmPwdIndex.value = value;
}
onMounted(() => {
//
handleChangeCheckCode();
});
defineExpose({
initForm,
});
</script>
<style lang="less" scoped>
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
.aui-input-line .aui-icon {
position: absolute;
z-index: 2;
top: 10px;
left: 10px;
font-size: 20px !important;
}
</style>

@ -0,0 +1,353 @@
<template>
<div class="aui-content">
<div class="aui-container">
<div class="aui-form">
<div class="aui-image">
<div class="aui-image-text">
<img :src="jeecgAdTextImg" alt="" />
</div>
</div>
<div class="aui-formBox">
<div class="aui-formWell">
<a-form ref="formRef" :model="formData">
<div class="aui-flex aui-form-nav aui-clear-left" style="padding-bottom: 21px">
<div class="aui-flex-box activeNav on">{{t('sys.login.registerButton4shenbaoren')}}</div>
</div>
<div class="aui-form-box">
<div class="aui-account aui-account-line">
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.accountPlaceholder')" v-model:value="formData.username" />
</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.realNamePlaceholder')" 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.workNoPlaceholder')" v-model:value="formData.workno" />
</div>
</a-form-item>
<!-- <a-form-item>-->
<!-- <div class="aui-input-line">-->
<!-- &lt;!&ndash; <Icon class="aui-icon" icon="ant-design:mobile-outlined" /> &ndash;&gt;-->
<!-- &lt;!&ndash; <a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.department')" />&ndash;&gt;-->
<!-- <JStuSelectDept v-model:value="formData.department" :multi="false" />-->
<!-- </div>-->
<!-- </a-form-item>-->
<a-form-item>
<div class="aui-input-line">
<JSelectDept :placeholder="t('sys.login.selectorgPlaceholder')" v-model:value="formData.department" :multiple="false" />
</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.mobilePlaceholder')" v-model:value="formData.mobile" />
</div>
</a-form-item>
<!-- <a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mail-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.smsCode')" v-model:value="formData.smscode" />
<div v-if="showInterval" class="aui-code-line" @click="getLoginCode">{{t('component.countdown.normalText')}}</div>
<div v-else class="aui-code-line">{{t('component.countdown.sendText',[unref(timeRuning)])}}</div>
</div>
</a-form-item> -->
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="pwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.passwordPlaceholder')"
v-model:value="formData.password"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="pwdIndex === 'open'" @click="pwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="pwdIndex === 'close'" @click="pwdClick('open')" />
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="confirmPwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.confirmPassword')"
v-model:value="formData.confirmPassword"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="confirmPwdIndex === 'open'" @click="confirmPwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="confirmPwdIndex === 'close'" @click="confirmPwdClick('open')" />
</div>
</div>
</a-form-item>
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.smsPlaceholder')" v-model:value="formData.smscode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
</div>
</div>
<!-- <a-form-item name="policy">
<div class="aui-flex">
<div class="aui-flex-box">
<div class="aui-choice">
<a-checkbox v-model:checked="formData.policy" />
<span style="color: #1b90ff;margin-left: 4px">{{ t('sys.login.policy') }}</span>
</div>
</div>
</div>
</a-form-item>-->
</div>
</div>
<div class="aui-formButton">
<div class="aui-flex">
<a class="aui-link-login aui-flex-box" @click="registerHandleClick"> {{ t('sys.login.registerButton') }}</a>
</div>
<div class="aui-flex">
<a class="aui-linek-code aui-flex-box" @click="goBackHandleClick">{{ t('sys.login.backSignIn') }}</a>
</div>
</div>
</a-form>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerShenbaoren, 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';
import jeecgAdTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import eyeKImg from '/@/assets/loginmini/icon/icon-eye-k.png';
import eyeGImg from '/@/assets/loginmini/icon/icon-eye-g.png';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import codeImg from '/@/assets/images/checkcode.png';
const { t } = useI18n();
const { notification, createErrorModal, createMessage } = useMessage();
const emit = defineEmits(['go-back', 'success', 'register']);
const formRef = ref();
const formData = reactive<any>({
username: '',
workno: '',
mobile: '',
smscode: '',
password: '',
confirmPassword: '',
// policy: false,
realname: '',
department: '',
});
//
//
const showInterval = ref<boolean>(true);
//60s
const timeRuning = ref<number>(60);
//
const timer = ref<any>(null);
//
const pwdIndex = ref<string>('close');
//
const confirmPwdIndex = ref<string>('close');
/**
* 返回
*/
function goBackHandleClick() {
emit('go-back');
initForm();
}
//
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
}
/**
* 获取手机验证码
*/
async function getLoginCode() {
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
const result = await getCaptcha({ mobile: formData.mobile, smsmode: SmsEnum.REGISTER });
if (result) {
const TIME_COUNT = 60;
if (!unref(timer)) {
timeRuning.value = TIME_COUNT;
showInterval.value = false;
timer.value = setInterval(() => {
if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
timeRuning.value = timeRuning.value - 1;
} else {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
}, 1000);
}
}
}
function registerHandleClick() {
if (!formData.username) {
createMessage.warn(t('sys.login.accountPlaceholder'));
return;
}
if (!formData.realname) {
createMessage.warn(t('sys.login.realNamePlaceholder'));
return;
}
if (!formData.department) {
createMessage.warn(t('sys.login.selectorgPlaceholder'));
return;
}
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
if (!formData.password) {
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;
}
if (formData.password !== formData.confirmPassword) {
createMessage.warn(t('sys.login.diffPwd'));
return;
}
if (!formData.smscode) {
createMessage.warn(t('sys.login.smsPlaceholder'));
return;
}
// if (!formData.policy) {
// createMessage.warn(t('sys.login.policyPlaceholder'));
// return;
// }
registerAccount();
}
/**
* 注册账号
*/
async function registerAccount() {
try {
const resultInfo = await registerShenbaoren(
toRaw({
workno: formData.workno,
username: formData.username,
departmentid: formData.department,
realname: formData.realname,
password: formData.password,
phone: formData.mobile,
smscode: formData.smscode,
checkKey: randCodeData.checkKey,
})
);
if (resultInfo && resultInfo.data.success) {
notification.success({
description: resultInfo.data.message || t('sys.api.registerMsg'),
duration: 3,
});
emit('success', { username: formData.username, password: formData.password });
initForm();
} else {
notification.warning({
message: t('sys.api.errorTip'),
description: resultInfo.data.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
} catch (error) {
notification.error({
message: t('sys.api.errorTip'),
description: error.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
}
/**
* 初始化表单
*/
function initForm() {
Object.assign(formData, { workno: '', username: '', mobile: '', realname: '', department: '', smscode: '', password: '', confirmPassword: ''/*, policy: false*/ });
if (!unref(timer)) {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
formRef.value.resetFields();
}
/**
* 密码打开或关闭
* @param value
*/
function pwdClick(value) {
pwdIndex.value = value;
}
/**
* 确认密码打开或关闭
* @param value
*/
function confirmPwdClick(value) {
confirmPwdIndex.value = value;
}
onMounted(() => {
//
handleChangeCheckCode();
});
defineExpose({
initForm,
});
</script>
<style lang="less" scoped>
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
.aui-input-line .aui-icon {
position: absolute;
z-index: 2;
top: 10px;
left: 10px;
font-size: 20px !important;
}
</style>
Loading…
Cancel
Save