feat: add invitation code.

This commit is contained in:
AI&I
2023-04-17 04:07:04 +08:00
parent b9ed2fd785
commit 04fa7394f6
3 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
{ {
"invitation code":"邀请码",
"Please enter your code":"请填写邀请码",
"signIn":"登录", "signIn":"登录",
"signUp":"注册", "signUp":"注册",
"username":"用户名", "username":"用户名",

View File

@@ -36,7 +36,6 @@
:append-inner-icon="passwordInputType === 'password' ? 'visibility' : 'visibility_off'" :append-inner-icon="passwordInputType === 'password' ? 'visibility' : 'visibility_off'"
@click:append-inner="passwordInputType = passwordInputType === 'password' ? 'text' : 'password'" @click:append-inner="passwordInputType = passwordInputType === 'password' ? 'text' : 'password'"
></v-text-field> ></v-text-field>
</v-form> </v-form>
<div v-if="errorMsg" class="text-red">{{ errorMsg }}</div> <div v-if="errorMsg" class="text-red">{{ errorMsg }}</div>

View File

@@ -9,6 +9,7 @@ const formData = ref({
email: '', email: '',
password1: '', password1: '',
password2: '', password2: '',
code:'',
}) })
const fieldErrors = ref({ const fieldErrors = ref({
@@ -16,6 +17,7 @@ const fieldErrors = ref({
email: '', email: '',
password1: '', password1: '',
password2: '', password2: '',
code:'',
}) })
const formRules = ref({ const formRules = ref({
@@ -35,7 +37,10 @@ const formRules = ref({
v => !!v || $i18n.t('Please confirm your password'), v => !!v || $i18n.t('Please confirm your password'),
v => v.length >= 8 || $i18n.t('Password must be at least 8 characters'), v => v.length >= 8 || $i18n.t('Password must be at least 8 characters'),
v => v === formData.value.password1 || $i18n.t('Confirm password must match password') v => v === formData.value.password1 || $i18n.t('Confirm password must match password')
] ],
code: [
v => !!v || $i18n.t('Please enter your code'),
],
}) })
const submitting = ref(false) const submitting = ref(false)
@@ -145,6 +150,15 @@ const handleFieldUpdate = (field) => {
clearable clearable
></v-text-field> ></v-text-field>
<v-text-field
v-model="formData.code"
:rules="formRules.code"
:label="$t('invitation code')"
variant="underlined"
@keyup.enter="submit"
clearable
></v-text-field>
</v-form> </v-form>
<div v-if="errorMsg" class="text-red">{{ errorMsg }}</div> <div v-if="errorMsg" class="text-red">{{ errorMsg }}</div>