add UserAgreement.vue
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="exec">
|
||||
<t-button theme="primary" class="button" type="submit" :loading="isSubmitting" :disabled="isSubmitting">登录</t-button>
|
||||
<t-button theme="primary" class="button" type="submit" :loading="isSubmitting" :disabled="isSubmitting || !props.agreementAccepted">登录</t-button>
|
||||
</div>
|
||||
</t-form>
|
||||
</template>
|
||||
@@ -51,6 +51,12 @@ defineOptions({
|
||||
name: "SmsLogin"
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
agreementAccepted?: boolean;
|
||||
}>(), {
|
||||
agreementAccepted: false
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
@@ -136,6 +142,10 @@ async function sendSms(): Promise<void> {
|
||||
}
|
||||
|
||||
function validateForm(): boolean {
|
||||
if (!props.agreementAccepted) {
|
||||
Message.warning("请先阅读并同意用户协议");
|
||||
return false;
|
||||
}
|
||||
if (!/^1\d{10}$/.test(formModel.mobilePhone)) {
|
||||
Message.warning("请输入正确的 11 位手机号");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user