|
@@ -6,7 +6,8 @@
|
|
|
<Input
|
|
|
class="fix-auto-fill"
|
|
|
size="large"
|
|
|
- autoComplete="off"
|
|
|
+ autocomplete="off"
|
|
|
+ :readonly="preventAutoFill"
|
|
|
v-model:value="formData.userName"
|
|
|
placeholder="请输入手机号"
|
|
|
/>
|
|
@@ -22,9 +23,10 @@
|
|
|
<FormItem name="code" class="enter-x">
|
|
|
<CountdownInput
|
|
|
size="large"
|
|
|
- autoComplete="off"
|
|
|
+ autocomplete="off"
|
|
|
class="fix-auto-fill"
|
|
|
:count="60"
|
|
|
+ :readonly="preventAutoFill"
|
|
|
:sendCodeApi="
|
|
|
() => {
|
|
|
return reg.test(formData.userName)
|
|
@@ -41,7 +43,8 @@
|
|
|
<FormItem name="userPassword" class="enter-x">
|
|
|
<StrengthMeter
|
|
|
size="large"
|
|
|
- autoComplete="off"
|
|
|
+ autocomplete="off"
|
|
|
+ :readonly="preventAutoFill"
|
|
|
v-model:value="formData.userPassword"
|
|
|
placeholder="请输入账号密码"
|
|
|
/>
|
|
@@ -78,7 +81,7 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { reactive, ref, unref, computed } from 'vue';
|
|
|
+ import { reactive, ref, unref, computed, watch } from 'vue';
|
|
|
import LoginFormTitle from './LoginFormTitle.vue';
|
|
|
// Checkbox
|
|
|
import { Form, Input, Button } from 'ant-design-vue';
|
|
@@ -96,7 +99,7 @@
|
|
|
|
|
|
const formRef = ref();
|
|
|
const loading = ref(false);
|
|
|
-
|
|
|
+ const preventAutoFill = ref(true);
|
|
|
const formData = reactive({
|
|
|
userName: '',
|
|
|
userPassword: '',
|
|
@@ -118,6 +121,22 @@
|
|
|
|
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.REGISTER);
|
|
|
|
|
|
+ watch(
|
|
|
+ () => getShow,
|
|
|
+ (data) => {
|
|
|
+ console.log('getShow', data.value);
|
|
|
+ if (data.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ preventAutoFill.value = !data.value;
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
async function handleRegister() {
|
|
|
console.log('getFormRules', getFormRules);
|
|
|
const data = await validForm();
|