refactor: 登录框样式优化
This commit is contained in:
@@ -55,7 +55,6 @@
|
|||||||
class="flex-1"
|
class="flex-1"
|
||||||
:placeholder="$t('login.password')"
|
:placeholder="$t('login.password')"
|
||||||
:type="passwordVisible === false ? 'password' : 'input'"
|
:type="passwordVisible === false ? 'password' : 'input'"
|
||||||
size="large"
|
|
||||||
name="password"
|
name="password"
|
||||||
@keyup="checkCapslock"
|
@keyup="checkCapslock"
|
||||||
@keyup.enter="handleLogin"
|
@keyup.enter="handleLogin"
|
||||||
@@ -70,25 +69,27 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<!-- 验证码 -->
|
<!-- 验证码 -->
|
||||||
<el-form-item prop="captchaCode">
|
<el-form-item prop="captchaCode" class="captcha-container">
|
||||||
<span class="p-2">
|
<div class="input-and-icon">
|
||||||
<svg-icon icon-class="captcha" />
|
<span class="p-2">
|
||||||
</span>
|
<svg-icon icon-class="captcha" />
|
||||||
|
</span>
|
||||||
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginData.captchaCode"
|
v-model="loginData.captchaCode"
|
||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
:placeholder="$t('login.captchaCode')"
|
:placeholder="$t('login.captchaCode')"
|
||||||
class="w-[60%]"
|
class="flex-1"
|
||||||
@keyup.enter="handleLogin"
|
@keyup.enter="handleLogin"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="captcha">
|
<div class="captcha">
|
||||||
<el-image
|
<el-image
|
||||||
:src="captchaBase64"
|
:src="captchaBase64"
|
||||||
@click="getCaptcha"
|
@click="getCaptcha"
|
||||||
:style="{ height: captchaHeight }"
|
:style="{ height: captchaHeight }"
|
||||||
class="w-[120px] h-[48px] cursor-pointer"
|
class="captcha-image"
|
||||||
>
|
>
|
||||||
<template #error>
|
<template #error>
|
||||||
<div class="image-slot">
|
<div class="image-slot">
|
||||||
@@ -134,11 +135,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import IconEpSunny from "~icons/ep/sunny";
|
import IconEpSunny from "~icons/ep/sunny";
|
||||||
import IconEpMoon from "~icons/ep/moon";
|
import IconEpMoon from "~icons/ep/moon";
|
||||||
import { useSettingsStore } from "@/store/modules/settings";
|
import { useSettingsStore, useUserStore, useAppStore } from "@/store";
|
||||||
|
|
||||||
// 状态管理依赖
|
|
||||||
import { useUserStore } from "@/store/modules/user";
|
|
||||||
import { useAppStore } from "@/store/modules/app";
|
|
||||||
|
|
||||||
// API依赖
|
// API依赖
|
||||||
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
||||||
@@ -316,23 +313,41 @@ onMounted(() => {
|
|||||||
.login-form {
|
.login-form {
|
||||||
padding: 30px 10px;
|
padding: 30px 10px;
|
||||||
|
|
||||||
.captcha {
|
.captcha-container {
|
||||||
position: absolute;
|
display: flex;
|
||||||
top: 0;
|
align-items: center;
|
||||||
right: 0;
|
justify-content: space-between;
|
||||||
|
|
||||||
.image-slot {
|
.input-and-icon {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: right;
|
margin-right: 10px; /* 调整间距 */
|
||||||
width: 100%;
|
}
|
||||||
height: 100%;
|
|
||||||
font-size: 18px;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
background: var(--el-fill-color-light);
|
|
||||||
|
|
||||||
svg {
|
.captcha {
|
||||||
margin-right: 10px;
|
/* 移除绝对定位 */
|
||||||
|
flex-shrink: 0; /* 防止图片压缩 */
|
||||||
|
|
||||||
|
.captcha-image {
|
||||||
|
width: 120px; /* 固定图片宽度 */
|
||||||
|
height: 30px; /* 固定图片高度 */
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-slot {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: right;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 18px;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
background: var(--el-fill-color-light);
|
||||||
|
|
||||||
|
svg {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user