diff --git a/packages/nc-gui-v2/assets/style-v2.scss b/packages/nc-gui-v2/assets/style-v2.scss index 924885aea2..c86dad1642 100644 --- a/packages/nc-gui-v2/assets/style-v2.scss +++ b/packages/nc-gui-v2/assets/style-v2.scss @@ -53,14 +53,6 @@ h1, h2, h3, h4, h5, h6, p, label, button, textarea, select { @apply dark:(!text-white); } -.v-field__field { - @apply bg-white dark:(!bg-gray-900 text-white); - - input { - @apply bg-white dark:(!bg-gray-700) !appearance-none my-1 border-1 border-solid border-primary/50 rounded; - } -} - .nc-icon { @apply color-transition; } diff --git a/packages/nc-gui-v2/pages/signin.vue b/packages/nc-gui-v2/pages/signin.vue index 9f69bca447..b6be5c9f49 100644 --- a/packages/nc-gui-v2/pages/signin.vue +++ b/packages/nc-gui-v2/pages/signin.vue @@ -16,19 +16,8 @@ definePageMeta({ title: 'title.headLogin', }) -useHead({ - meta: [ - { - hid: t('msg.info.loginMsg'), - name: t('msg.info.loginMsg'), - content: t('msg.info.loginMsg'), - }, - ], -}) - let error = $ref(null) - -const valid = ref() +const valid = $ref(false) const form = reactive({ email: '', @@ -38,17 +27,27 @@ const form = reactive({ const formRules = { email: [ // E-mail is required - (v: string) => !!v || t('msg.error.signUpRules.emailReqd'), + { required: true, message: t('msg.error.signUpRules.emailReqd') }, // E-mail must be valid format - (v: string) => isEmail(v) || t('msg.error.signUpRules.emailInvalid'), + { + validator: (_: unknown, v: string) => { + return new Promise((resolve, reject) => { + if (isEmail(v)) return resolve(true) + reject(new Error(t('msg.error.signUpRules.emailInvalid'))) + }) + }, + message: t('msg.error.signUpRules.emailInvalid'), + }, ], password: [ // Password is required - (v: string) => !!v || t('msg.error.signUpRules.passwdRequired'), + { required: true, message: t('msg.error.signUpRules.passwdRequired') }, ], } const signIn = async () => { + if (!valid) return + error = null try { const { token } = await $api.auth.signin(form) @@ -70,10 +69,13 @@ const resetError = () => { + +