fix: 修改登录页弹框判断 (#5323)

pull/5324/head
ssongliu 2024-06-06 16:29:37 +08:00 committed by GitHub
parent ac384628c9
commit f670095c08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -127,7 +127,7 @@
</template>
</el-checkbox>
<span
v-if="!loginForm.agreeLicense && !globalStore.isMobile()"
v-if="!loginForm.agreeLicense && !_isMobile()"
class="input-error"
style="line-height: 14px"
>
@ -189,6 +189,10 @@ const isDemo = ref(false);
const agreeVisible = ref(false);
type FormInstance = InstanceType<typeof ElForm>;
const _isMobile = () => {
const rect = document.body.getBoundingClientRect();
return rect.width - 1 < 600;
};
const loginButtonFocused = ref();
const loginFormRef = ref<FormInstance>();
@ -253,7 +257,7 @@ const login = (formEl: FormInstance | undefined) => {
formEl.validate(async (valid) => {
if (!valid) return;
if (!loginForm.agreeLicense) {
if (globalStore.isMobile()) {
if (_isMobile()) {
agreeVisible.value = true;
}
return;