diff --git a/Front/vue-unilife/src/components/LogPage.vue b/Front/vue-unilife/src/components/LogPage.vue index 72eed6b..16f4cac 100644 --- a/Front/vue-unilife/src/components/LogPage.vue +++ b/Front/vue-unilife/src/components/LogPage.vue @@ -53,7 +53,7 @@ const RegisterForm = useForm({ validationSchema : yup.object({ register_email: yup.string().email("请输入邮箱").required("请输入正确的邮箱"), register_password: yup.string().min(6,"密码至少6位").required("请输入密码"), - register_verifyPassword: yup.string().oneOf([yup.ref('password')],"两次密码不一致").required("请确认密码"), + register_verifyPassword: yup.string().oneOf([yup.ref('register_verifyPassword')],"两次密码不一致").required("请确认密码"), register_vericode: yup.string().required("请输入验证码") }), }) @@ -103,7 +103,9 @@ const checkErrors = () => { const onRegisterSubmit = () => { LoginEmailForm.resetForm(); LoginPasswordForm.resetForm(); - RegisterForm.handleSubmit(() => { + console.log('函数调用成功') + RegisterForm.handleSubmit((values) => { + console.log('表单调用成功',values) testcode().then((res) => { if(res.code === 200) { register().then((res) => { @@ -119,6 +121,9 @@ const onRegisterSubmit = () => { console.log('注册失败') } }) + }, + (errors)=>{ + console.log('注册表单调用失败',errors) })(); } @@ -186,8 +191,10 @@ const password = computed(()=>register_password.value ?? login_password.value) const vericode = computed(()=>register_vericode.value ?? login_vericode.value) //发送邮箱验证码 async function emailcode(){ - const res = await request.post('/users/code', { + const res = await request.get('/users/code', { + data:{ email: email.value + } }) console.log("success") @@ -196,8 +203,10 @@ async function emailcode(){ //验证邮箱验证码 async function testcode() { const res = await request.post('/users/login/code', { + data: { email: email.value, code: vericode.value + } }) return res.data; @@ -205,6 +214,7 @@ async function testcode() { async function register(){ const res = await request.post('/users/register', { + data:{ email: email.value, password: password.value, username:null, @@ -213,14 +223,17 @@ async function register(){ department:null, major:null, grade:null, + } }) return res.data; } async function login(){ const res = await request.post('/users/login', { + data:{ email: email.value, password: password.value + } }) return res.data; } diff --git a/Front/vue-unilife/src/components/Personal.vue b/Front/vue-unilife/src/components/Personal.vue index 741f662..3a914a0 100644 --- a/Front/vue-unilife/src/components/Personal.vue +++ b/Front/vue-unilife/src/components/Personal.vue @@ -7,8 +7,16 @@ export default defineComponent({ diff --git a/Front/vue-unilife/src/components/Personal/AcountManager.vue b/Front/vue-unilife/src/components/Personal/AcountManager.vue new file mode 100644 index 0000000..591878d --- /dev/null +++ b/Front/vue-unilife/src/components/Personal/AcountManager.vue @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/Front/vue-unilife/src/routers.ts b/Front/vue-unilife/src/routers.ts index 36332b3..c5606b6 100644 --- a/Front/vue-unilife/src/routers.ts +++ b/Front/vue-unilife/src/routers.ts @@ -2,6 +2,7 @@ import type { RouteRecord, RouteRecordRaw } from 'vue-router'; import { createWebHashHistory, createRouter,createWebHistory } from 'vue-router'; import LogPage from './components/LogPage.vue'; import Personal from './components/Personal.vue'; +import Manager from './components/Personal/AcountManager.vue'; const routes:Array = [ { @@ -12,7 +13,14 @@ const routes:Array = [ { path:'/personal', name: 'Personal', - component: Personal + component: Personal, + children: [ + { + path:'/manager', + name: 'Manager', + component:Manager, + } + ] } ];