- - - - - - - - - + + +
+
+
+ + + +
+
用户账号
+
+
+ +
+
- +
+
+
+ + + +
+
用户密码
+
+
+ +
+
- +
+
+
+ + + +
+
确认密码
+
+
+ +
+
+
+ +
+
+
+ + + +
+
姓名
+
+
+ +
+
+
+ + +
+
+
+ + + +
+
班级
+
+
+ +
+
+
+ + +
+
+
+ + + +
+
学号
+
+
+ +
+
- +
+
+
+ + + +
+
手机号
+
+
+ +
+
+
+ +
+
+
+ + + +
+
验证码
+
+
+
+ +
+ +
+
+
+
+
+ + 注册 - + 返回到登录页 @@ -78,77 +156,88 @@
-->
- - + +
-
+
- +
用户名
- +
- - + +
+
+
+ + + +
+
学号
+
+
+ +
+
- - + +
+
+
+ + + +
+
密码
+
+
+ +
+
- -
- -
- + +
+
+
+ + + +
+
验证码
+
+
+
+ +
+ +
+
+ + - 登录 - 去注册 + 登录 + 去注册 @@ -162,10 +251,10 @@ // import { ref } from "vue" // import { onMounted, reactive, ref, toRefs, watch } from "vue"; import settingStore from "@/store/modules/setting"; -import { User, Lock, Avatar, Stamp } from "@element-plus/icons-vue"; +import { User, Lock, Avatar, Stamp,Grid,Iphone } from "@element-plus/icons-vue"; import { ref } from "vue"; import userStore from "@/store/modules/user"; -import { getCode } from "@/api"; +import { getCode, sturegister,getFaculties } from '@/api/user' import { useRouter } from "vue-router"; const router = useRouter() const setting = settingStore(); @@ -176,12 +265,42 @@ const isRegister = ref(false); const formRef = ref(); const formModel = ref({ username: "", - studentNumb: "", - name: "", password: "", repassword: "", + name: "", + department: '', + studentNumb: "", + mobile: '', captcha: "", }); + +const FacultiesList = ref([]) +const getFacultiesList = async (data: any) => { + const res: any = await getFaculties(data) + console.log(res, 'res11') + FacultiesList.value = res.result +} +// 配置部门级联选择器 +const props = { + lazy: true, + checkStrictly: true, + emitPath: false, + async lazyLoad(node: any, resolve: any) { + await getFacultiesList({ + primaryType: 'key', + pid: node.value, + }) + const nodes = FacultiesList.value.map((item: any) => ({ + value: item.id, + label: item.title, + })) + resolve(nodes) + }, +} + + + + // 添加校验规则 const rules = { username: [ @@ -234,7 +353,27 @@ const rules = { }; const register = async () => { await formRef.value.validate(); - console.log("开始注册i请求"); + console.log("开始注册请求"); + let data = { + department: formModel.value.department, + studentNumb: formModel.value.studentNumb, + mobile: formModel.value.mobile, + captcha: formModel.value.captcha, + checkKey: 1629428467008, + password: formModel.value.password, + username: formModel.value.username, + realname: formModel.value.name, + workno: formModel.value.studentNumb, + }; + const res: any = await sturegister(data) + if (res.code === 200) { + // ElMessage.success(`注册成功`) + // $emits('backLogin') + } else { + // ElMessage.warning(res.message) + getcodeinfo() + } + console.log(res) }; const codeUrl = ref(""); const getcodeinfo = async () => { @@ -299,6 +438,7 @@ const login = async () => { margin: 0; background: url("../assets/images/login.png") no-repeat; background-position: center; + background-size: 50% auto; } .captcha { width: 100%; @@ -336,18 +476,16 @@ const login = async () => { background-color: #0e2e5e; font-size: 18px; } - -// .custom-form .el-form-item__label { -// color: #409eff; -// /* 标签颜色 */ -// font-size: 14px; -// font-weight: bold; +// .el-form-item__label { +// color: #0e2e5e; // } -// .bold-icon svg { -// stroke-width: 9; -// /* 加粗效果 */ +// .el-form-item__error { +// left: 80px; // } -.el-form-item__label { - color: #0e2e5e; +.el-input { + width: 300px; +} +:deep(.el-form-item__error){ + left: 110px; }