Browse Source

fix: Fix register validator error.(#123) (#128)

* feat: Add data validation FormRule to check that the data makes sense.(#90)

Signed-off-by: MC-kanon <1547025615@qq.com>

* fix: Fix register validator error.(#123)

Signed-off-by: MC-kanon <1547025615@qq.com>

---------

Signed-off-by: MC-kanon <1547025615@qq.com>
main
MC-kanon GitHub 3 years ago
parent
commit
49d62fe424
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 20 deletions
  1. +11
    -20
      web/src/views/login/components/RegisterForm.vue

+ 11
- 20
web/src/views/login/components/RegisterForm.vue View File

@@ -25,7 +25,7 @@ const formData = ref({
admin: ADMIN_INITIAL_DATA,
});
const rules: FormRule = {
community_email: [
email: [
{
required: true,
email: true,
@@ -34,32 +34,23 @@ const rules: FormRule = {
trigger: 'blur',
},
],
community_name: [
name: [
{
required: true,
message: 'Please enter the correct community_name',
message: 'Please enter the correct name',
type: 'warning',
trigger: 'blur',
},
],
admin_email: [
nickname: [
{
required: true,
email: true,
message: 'Please enter the correct e-mail',
type: 'warning',
trigger: 'blur',
},
],
admin_nickname: [
{
required: true,
message: 'Please enter the correct admin_nickname',
message: 'Please enter the correct nickname',
type: 'warning',
trigger: 'blur',
},
],
admin_password: [
password: [
{
required: true,
message: 'Please enter the correct password',
@@ -151,7 +142,7 @@ const onSubmit = (ctx: SubmitContext) => {
:rules="rules"
:requiredMark="false"
>
<t-form-item name="community_email" v-show="showCommunity">
<t-form-item name="community.email" v-show="showCommunity">
<t-input
v-model="formData.community.email"
size="large"
@@ -164,7 +155,7 @@ const onSubmit = (ctx: SubmitContext) => {
</t-input>
</t-form-item>

<t-form-item name="community_name" v-show="showCommunity">
<t-form-item name="community.name" v-show="showCommunity">
<t-input
v-model="formData.community.name"
size="large"
@@ -177,7 +168,7 @@ const onSubmit = (ctx: SubmitContext) => {
</t-input>
</t-form-item>

<t-form-item name="admin_email" v-show="!showCommunity">
<t-form-item name="admin.email" v-show="!showCommunity">
<t-input
v-model="formData.admin.email"
size="large"
@@ -190,7 +181,7 @@ const onSubmit = (ctx: SubmitContext) => {
</t-input>
</t-form-item>

<t-form-item name="admin_nickname" v-show="!showCommunity">
<t-form-item name="admin.nickname" v-show="!showCommunity">
<t-input
v-model="formData.admin.nickname"
size="large"
@@ -203,7 +194,7 @@ const onSubmit = (ctx: SubmitContext) => {
</t-input>
</t-form-item>

<t-form-item name="admin_password" v-show="!showCommunity">
<t-form-item name="admin.password" v-show="!showCommunity">
<t-input
v-model="formData.admin.password"
size="large"


Loading…
Cancel
Save