mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-29 23:30:43 +08:00
finish settings/contact page
This commit is contained in:
@@ -9,6 +9,8 @@ export enum PageEnum {
|
|||||||
PAGE_SETTINGS = '/settings',
|
PAGE_SETTINGS = '/settings',
|
||||||
// password settings path
|
// password settings path
|
||||||
PAGE_PASSWORD_SETTINGS = '/settings/password',
|
PAGE_PASSWORD_SETTINGS = '/settings/password',
|
||||||
|
// contact settings path
|
||||||
|
PAGE_CONTACT_SETTINGS = '/settings/contact',
|
||||||
// error page path
|
// error page path
|
||||||
ERROR_PAGE = '/exception',
|
ERROR_PAGE = '/exception',
|
||||||
// error log page path
|
// error log page path
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
name: '个人设置',
|
name: '个人设置',
|
||||||
password: '修改密码',
|
password: '修改密码',
|
||||||
|
contact: '修改联系方式',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,16 @@ const settings: AppRouteModule = {
|
|||||||
hideMenu: true,
|
hideMenu: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'contact',
|
||||||
|
name: 'ContactSettingsPage',
|
||||||
|
component: () => import('/@/views/page/settings/contact/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: t('routes.settings.contact'),
|
||||||
|
icon: 'ion:md-contact',
|
||||||
|
hideMenu: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
title: '联系方式',
|
title: '联系方式',
|
||||||
description: '已记录的联系方式: ' + contact,
|
description: '已记录的联系方式: ' + contact,
|
||||||
extra: '修改',
|
extra: '修改',
|
||||||
|
click: () => {
|
||||||
|
go(PageEnum.PAGE_CONTACT_SETTINGS)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { FormSchema } from '/@/components/Form'
|
||||||
|
|
||||||
|
export const formSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'contactOld',
|
||||||
|
label: '当前联系方式',
|
||||||
|
component: 'Input',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'contactNew',
|
||||||
|
label: '新联系方式',
|
||||||
|
component: 'Input',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<PageWrapper title="修改当前联系方式" content="修改成功后会自动退出当前登录!">
|
<PageWrapper title="修改当前联系方式" content="修改成功后会通知课程组长!">
|
||||||
<div class="py-8 bg-white flex flex-col justify-center items-center">
|
<div class="py-8 bg-white flex flex-col justify-center items-center">
|
||||||
<BasicForm @register="register" />
|
<BasicForm @register="register" />
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
import { PageWrapper } from '/@/components/Page'
|
import { PageWrapper } from '/@/components/Page'
|
||||||
import { BasicForm, useForm } from '/@/components/Form'
|
import { BasicForm, useForm } from '/@/components/Form'
|
||||||
|
|
||||||
import { formSchema } from './pwd.data'
|
import { formSchema } from './contact.data'
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ChangeContact',
|
name: 'ChangeContact',
|
||||||
components: { BasicForm, PageWrapper },
|
components: { BasicForm, PageWrapper },
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const values = await validate()
|
const values = await validate()
|
||||||
const { passwordOld, passwordNew } = values
|
const { contactOld, contactNew } = values
|
||||||
|
|
||||||
// TODO custom api
|
// TODO custom api
|
||||||
console.log(passwordOld, passwordNew)
|
console.log(contactOld, contactNew)
|
||||||
// const { router } = useRouter()
|
// const { router } = useRouter()
|
||||||
// router.push(pageEnum.BASE_LOGIN)
|
// router.push(pageEnum.BASE_LOGIN)
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
import { FormSchema } from '/@/components/Form'
|
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
field: 'passwordOld',
|
|
||||||
label: '当前密码',
|
|
||||||
component: 'InputPassword',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'passwordNew',
|
|
||||||
label: '新密码',
|
|
||||||
component: 'StrengthMeter',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '新密码',
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入新密码',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'confirmPassword',
|
|
||||||
label: '确认密码',
|
|
||||||
component: 'InputPassword',
|
|
||||||
|
|
||||||
dynamicRules: ({ values }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
validator: (_, value) => {
|
|
||||||
if (!value) {
|
|
||||||
return Promise.reject('密码不能为空')
|
|
||||||
}
|
|
||||||
if (value !== values.passwordNew) {
|
|
||||||
return Promise.reject('两次输入的密码不一致!')
|
|
||||||
}
|
|
||||||
return Promise.resolve()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user