固化登录用户名密码
CI / Backend tests (push) Canceled after 0s
CI / Frontend build (push) Canceled after 0s

This commit is contained in:
2026-09-21 22:54:21 +08:00
parent 2c9f3712df
commit 4761d52278
+23 -3
View File
@@ -12,6 +12,7 @@ const username = ref('admin')
const password = ref('666666')
const remember = ref(true)
const loading = ref(false)
const showPwd = ref(false)
async function login() {
if (!username.value.trim() || !password.value) {
@@ -46,7 +47,14 @@ async function login() {
</div>
<div class="field">
<span class="f-ico">🔑</span>
<input v-model="password" type="password" placeholder="密码" @keyup.enter="login" />
<input v-model="password" :type="showPwd ? 'text' : 'password'" placeholder="密码" @keyup.enter="login" />
<button
class="pwd-eye"
type="button"
:title="showPwd ? '隐藏密码' : '显示密码'"
:aria-label="showPwd ? '隐藏密码' : '显示密码'"
@click="showPwd = !showPwd"
>{{ showPwd ? '🙈' : '👁️' }}</button>
</div>
<div class="login-options">
@@ -60,7 +68,6 @@ async function login() {
<button class="login-btn" :disabled="loading" @click="login">
{{ loading ? '登录中…' : '🚀 登 录' }}
</button>
<div class="login-tip">默认账号 admin · 密码 666666(Docker 部署可通过环境变量修改)</div>
</div>
</div>
</template>
@@ -165,6 +172,20 @@ async function login() {
color: var(--ink);
}
.field input::placeholder { color: var(--ink-faint); }
.pwd-eye {
flex: none;
border: none;
background: transparent;
padding: 4px;
margin-right: -4px;
font-size: 16px;
line-height: 1;
cursor: pointer;
opacity: .55;
transition: .16s;
}
.pwd-eye:hover { opacity: 1; transform: scale(1.12); }
.pwd-eye:active { transform: scale(.92); }
.login-options {
display: flex;
@@ -195,5 +216,4 @@ async function login() {
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -8px rgba(255, 140, 0, .7); }
.login-btn:active { transform: scale(.97); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-tip { margin-top: 16px; font-size: 11px; color: var(--ink-faint); }
</style>