|
@@ -122,8 +122,8 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
<ng-template #form>
|
|
<ng-template #form>
|
|
|
<header class="form-head">
|
|
<header class="form-head">
|
|
|
<p class="form-kicker">进入工作空间</p>
|
|
<p class="form-kicker">进入工作空间</p>
|
|
|
- <h2>{{ method() === 'mobile' ? '欢迎回来' : method() === 'password' ? '账号密码登录' : '从已登录设备登录' }}</h2>
|
|
|
|
|
- <p>{{ method() === 'mobile' ? '用手机号验证码继续你的工作' : method() === 'password' ? '使用已有账号和密码继续' : '粘贴从已登录设备复制的登录凭证' }}</p>
|
|
|
|
|
|
|
+ <h2>{{ method() === 'mobile' ? '欢迎回来' : method() === 'password' ? '账号密码登录' : 'Token 登录' }}</h2>
|
|
|
|
|
+ <p>{{ method() === 'mobile' ? '用手机号验证码继续你的工作' : method() === 'password' ? '使用已有账号和密码继续' : '粘贴以 r: 开头的登录 Token' }}</p>
|
|
|
</header>
|
|
</header>
|
|
|
|
|
|
|
|
<div class="mode-tabs">
|
|
<div class="mode-tabs">
|
|
@@ -152,7 +152,7 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
[attr.aria-pressed]="method() === 'token'"
|
|
[attr.aria-pressed]="method() === 'token'"
|
|
|
(click)="switchMethod('token')"
|
|
(click)="switchMethod('token')"
|
|
|
>
|
|
>
|
|
|
- 快捷登录
|
|
|
|
|
|
|
+ Token 登录
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -163,48 +163,53 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
-->
|
|
-->
|
|
|
<label class="field">
|
|
<label class="field">
|
|
|
<span class="field-label">账号</span>
|
|
<span class="field-label">账号</span>
|
|
|
|
|
+ <div class="input-shell">
|
|
|
<ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="username"
|
|
<ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="username"
|
|
|
placeholder="请输入账号"
|
|
placeholder="请输入账号"
|
|
|
[value]="username()"
|
|
[value]="username()"
|
|
|
[invalid]="!!error() && !usernameValid()"
|
|
[invalid]="!!error() && !usernameValid()"
|
|
|
(valueChange)="onUsername($event)"
|
|
(valueChange)="onUsername($event)"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ </div>
|
|
|
</label>
|
|
</label>
|
|
|
<label class="field">
|
|
<label class="field">
|
|
|
<span class="field-label">密码</span>
|
|
<span class="field-label">密码</span>
|
|
|
- <div class="credential-row">
|
|
|
|
|
- <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="password" [type]="showPassword() ? 'text' : 'password'" placeholder="请输入密码"
|
|
|
|
|
- [value]="password()" (valueChange)="onPassword($event)" />
|
|
|
|
|
- <button type="button" class="credential-toggle" [disabled]="flow.working()" [attr.aria-label]="showPassword() ? '隐藏密码' : '显示密码'" [attr.aria-pressed]="showPassword()" (click)="showPassword.set(!showPassword())">
|
|
|
|
|
- <i [class]="showPassword() ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'" aria-hidden="true"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <!-- 2026-12-04 用户裁决:密码框后面不要眼睛按钮,直接输入 -->
|
|
|
|
|
+ <div class="input-shell">
|
|
|
|
|
+ <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="password" [type]="showPassword() ? 'text' : 'password'" placeholder="请输入密码"
|
|
|
|
|
+ [value]="password()" (valueChange)="onPassword($event)" />
|
|
|
|
|
+ </div>
|
|
|
</label>
|
|
</label>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@if (method() === 'mobile') {
|
|
@if (method() === 'mobile') {
|
|
|
<label class="field">
|
|
<label class="field">
|
|
|
<span class="field-label">手机号</span>
|
|
<span class="field-label">手机号</span>
|
|
|
|
|
+ <div class="input-shell">
|
|
|
<ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="phone"
|
|
<ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="phone"
|
|
|
placeholder="请输入手机号"
|
|
placeholder="请输入手机号"
|
|
|
[value]="mobile()"
|
|
[value]="mobile()"
|
|
|
[invalid]="!!error() && !mobileValid()"
|
|
[invalid]="!!error() && !mobileValid()"
|
|
|
(valueChange)="onMobile($event)"
|
|
(valueChange)="onMobile($event)"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ </div>
|
|
|
</label>
|
|
</label>
|
|
|
|
|
|
|
|
<label class="field">
|
|
<label class="field">
|
|
|
<span class="field-label">验证码</span>
|
|
<span class="field-label">验证码</span>
|
|
|
<div class="code-row">
|
|
<div class="code-row">
|
|
|
- <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="code"
|
|
|
|
|
|
|
+ <div class="input-shell">
|
|
|
|
|
+ <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="code"
|
|
|
placeholder="6 位验证码"
|
|
placeholder="6 位验证码"
|
|
|
[value]="code()"
|
|
[value]="code()"
|
|
|
[invalid]="!!error() && !codeValid()"
|
|
[invalid]="!!error() && !codeValid()"
|
|
|
(valueChange)="onCode($event)"
|
|
(valueChange)="onCode($event)"
|
|
|
/>
|
|
/>
|
|
|
- <ui-button variant="outline" [disabled]="!canSendCode()" (click)="sendCode()">
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 获取验证码(2026-12-04):与输入框同高 56px、同圆角,描边主色 -->
|
|
|
|
|
+ <button type="button" class="code-send" [disabled]="!canSendCode()" (click)="sendCode()">
|
|
|
{{ countdown() > 0 ? countdown() + 's 后重试' : sendingCode() ? '发送中…' : '获取验证码' }}
|
|
{{ countdown() > 0 ? countdown() + 's 后重试' : sendingCode() ? '发送中…' : '获取验证码' }}
|
|
|
- </ui-button>
|
|
|
|
|
|
|
+ </button>
|
|
|
</div>
|
|
</div>
|
|
|
<small class="field-hint">手机号仅用于登录验证</small>
|
|
<small class="field-hint">手机号仅用于登录验证</small>
|
|
|
</label>
|
|
</label>
|
|
@@ -218,14 +223,12 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
报错却指向好几行之后(本次踩坑:报 "Unexpected ;" 在 534 行)。
|
|
报错却指向好几行之后(本次踩坑:报 "Unexpected ;" 在 534 行)。
|
|
|
-->
|
|
-->
|
|
|
<label class="field">
|
|
<label class="field">
|
|
|
- <span class="field-label">登录凭证</span>
|
|
|
|
|
- <div class="credential-row">
|
|
|
|
|
- <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="token" [type]="flow.showToken() ? 'text' : 'password'" placeholder="粘贴登录凭证"
|
|
|
|
|
- [value]="token()" (valueChange)="onToken($event)" />
|
|
|
|
|
- <button type="button" class="credential-toggle" [disabled]="flow.working()" [attr.aria-label]="flow.showToken() ? '隐藏登录凭证' : '显示登录凭证'" [attr.aria-pressed]="flow.showToken()" (click)="flow.showToken.set(!flow.showToken())">
|
|
|
|
|
- <i [class]="flow.showToken() ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'" aria-hidden="true"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <span class="field-label">Token</span>
|
|
|
|
|
+ <!-- 2026-12-04 用户裁决:Token 输入框也去掉眼睛按钮,直接粘贴 -->
|
|
|
|
|
+ <div class="input-shell">
|
|
|
|
|
+ <ui-input [disabled]="flow.working()" (keydown.enter)="onKeyboardSubmit($event)" appLoginField="token" [type]="flow.showToken() ? 'text' : 'password'" placeholder="粘贴 Token,以 r: 开头"
|
|
|
|
|
+ [value]="token()" (valueChange)="onToken($event)" />
|
|
|
|
|
+ </div>
|
|
|
</label>
|
|
</label>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -242,7 +245,7 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
{{ busy() ? '登录中…' : flow.authenticated() ? '进入工作空间' : '登录' }}
|
|
{{ busy() ? '登录中…' : flow.authenticated() ? '进入工作空间' : '登录' }}
|
|
|
</ui-button>
|
|
</ui-button>
|
|
|
|
|
|
|
|
- <button type="button" class="login-help" [disabled]="flow.working()" (click)="flow.openPanel('help')">登录遇到问题?</button>
|
|
|
|
|
|
|
+ <!-- 2026-12-04 用户裁决:去掉「登录遇到问题?」,保持界面干净 -->
|
|
|
@if (method() === 'token') {
|
|
@if (method() === 'token') {
|
|
|
<p class="hint"><i class="fa-solid fa-circle-info" aria-hidden="true"></i>登录凭证可在已登录设备的账号设置中复制,请勿分享给他人</p>
|
|
<p class="hint"><i class="fa-solid fa-circle-info" aria-hidden="true"></i>登录凭证可在已登录设备的账号设置中复制,请勿分享给他人</p>
|
|
|
}
|
|
}
|
|
@@ -497,11 +500,14 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
}
|
|
}
|
|
|
.card {
|
|
.card {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- /* 卡片本体最宽 400px(2026-11-12):再宽输入框会显得空旷 */
|
|
|
|
|
- max-width: 400px;
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 2026-12-04 PC 优化:400px 在宽屏上显得局促(用户反馈「难看」)。
|
|
|
|
|
+ * 放宽到 420px 并保留 --sp-6 内边距,字段之间统一用 --sp-5 的节奏。
|
|
|
|
|
+ */
|
|
|
|
|
+ max-width: 420px;
|
|
|
display: grid;
|
|
display: grid;
|
|
|
gap: var(--sp-5);
|
|
gap: var(--sp-5);
|
|
|
- padding: var(--sp-6);
|
|
|
|
|
|
|
+ padding: var(--sp-6) var(--sp-6) var(--sp-5);
|
|
|
border: 1px solid var(--edge);
|
|
border: 1px solid var(--edge);
|
|
|
border-radius: var(--r-lg);
|
|
border-radius: var(--r-lg);
|
|
|
background: var(--surface);
|
|
background: var(--surface);
|
|
@@ -639,6 +645,27 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
border-radius: var(--r-md);
|
|
border-radius: var(--r-md);
|
|
|
background: var(--surface-2);
|
|
background: var(--surface-2);
|
|
|
}
|
|
}
|
|
|
|
|
+ .mode-tab {
|
|
|
|
|
+ min-height: 36px;
|
|
|
|
|
+ border: 1px solid transparent;
|
|
|
|
|
+ border-radius: calc(var(--r-md) - 2px);
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ color: var(--ink-2);
|
|
|
|
|
+ font-size: var(--fs-13);
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
|
|
|
|
|
+ }
|
|
|
|
|
+ .mode-tab:hover:not(.active) { color: var(--ink); }
|
|
|
|
|
+ .mode-tab.active {
|
|
|
|
|
+ background: var(--surface);
|
|
|
|
|
+ border-color: var(--edge);
|
|
|
|
|
+ color: var(--ink);
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ box-shadow: var(--shadow-soft);
|
|
|
|
|
+ }
|
|
|
|
|
+ @media (prefers-reduced-motion: reduce) {
|
|
|
|
|
+ .mode-tab { transition: none; }
|
|
|
|
|
+ }
|
|
|
.mode-tab {
|
|
.mode-tab {
|
|
|
min-height: var(--touch-min);
|
|
min-height: var(--touch-min);
|
|
|
border: 0;
|
|
border: 0;
|
|
@@ -666,12 +693,80 @@ type LoginMethod = 'password' | 'mobile' | 'token';
|
|
|
outline-offset: -2px;
|
|
outline-offset: -2px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 输入框统一外壳(2026-12-04 参照用户提供的设计稿):
|
|
|
|
|
+ * 填充灰底、无边框、大圆角、高 56px —— 比「白底细边框」更有体量感。
|
|
|
|
|
+ * 通过外层容器实现,不改底座 ui-input(底座禁改)。
|
|
|
|
|
+ */
|
|
|
|
|
+ .input-shell {
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ background: var(--surface-2);
|
|
|
|
|
+ transition: box-shadow 0.16s ease, background 0.16s ease;
|
|
|
|
|
+ }
|
|
|
|
|
+ .input-shell:focus-within {
|
|
|
|
|
+ background: var(--surface);
|
|
|
|
|
+ box-shadow: 0 0 0 1.5px var(--primary);
|
|
|
|
|
+ }
|
|
|
|
|
+ /* 清掉底座输入框自身的边框,只保留外壳的灰底圆角 */
|
|
|
|
|
+ .input-shell ::ng-deep input {
|
|
|
|
|
+ height: 56px !important;
|
|
|
|
|
+ padding-inline: 16px !important;
|
|
|
|
|
+ border: 0 !important;
|
|
|
|
|
+ border-radius: 12px !important;
|
|
|
|
|
+ background: transparent !important;
|
|
|
|
|
+ box-shadow: none !important;
|
|
|
|
|
+ font-size: var(--fs-15) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .input-shell ::ng-deep input:focus,
|
|
|
|
|
+ .input-shell ::ng-deep input:focus-visible {
|
|
|
|
|
+ /* 浏览器默认 focus 黑框太硬(2026-12-04):统一交给外壳的主色环表达焦点 */
|
|
|
|
|
+ outline: none !important;
|
|
|
|
|
+ box-shadow: none !important;
|
|
|
|
|
+ border: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .input-shell ::ng-deep input::placeholder { color: var(--faint, var(--muted)); }
|
|
|
|
|
+ @media (prefers-reduced-motion: reduce) {
|
|
|
|
|
+ .input-shell { transition: none; }
|
|
|
|
|
+ }
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 获取验证码(2026-12-04 用户裁决:不要边框)。
|
|
|
|
|
+ * 做成**纯文字按钮**压在验证码输入框右侧,点击区 44px 保证触控;
|
|
|
|
|
+ * 这样它与输入框是一个整体,不会像描边按钮那样「两个框并排」显得碎。
|
|
|
|
|
+ */
|
|
|
|
|
+ .code-row {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ grid-template-columns: minmax(0, 1fr);
|
|
|
|
|
+ }
|
|
|
|
|
+ .code-send {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ right: 6px;
|
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
|
+ min-height: 44px;
|
|
|
|
|
+ padding: 0 12px;
|
|
|
|
|
+ border: 0;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ color: var(--primary);
|
|
|
|
|
+ font-size: var(--fs-13);
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: color 0.16s ease, opacity 0.16s ease;
|
|
|
|
|
+ }
|
|
|
|
|
+ .code-send:hover:not(:disabled) { text-decoration: underline; }
|
|
|
|
|
+ .code-send:disabled { color: var(--muted); opacity: 0.7; cursor: default; }
|
|
|
|
|
+ /* 给右侧文字按钮留出位置,避免输入内容被它盖住 */
|
|
|
|
|
+ .code-row .input-shell ::ng-deep input { padding-right: 132px !important; }
|
|
|
.field {
|
|
.field {
|
|
|
display: grid;
|
|
display: grid;
|
|
|
gap: var(--sp-2);
|
|
gap: var(--sp-2);
|
|
|
|
|
+ min-width: 0;
|
|
|
}
|
|
}
|
|
|
.field-label {
|
|
.field-label {
|
|
|
font-size: var(--fs-13);
|
|
font-size: var(--fs-13);
|
|
|
|
|
+ font-weight: 500;
|
|
|
color: var(--ink-2);
|
|
color: var(--ink-2);
|
|
|
}
|
|
}
|
|
|
.code-row {
|
|
.code-row {
|