You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
6.8 KiB
Smarty

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{include file='user/layout_header.tpl' vu_title='账户设置' vu_active='edit'}
<section class="vu-drawer-page vu-account-page" aria-labelledby="vuAccountTitle">
<header class="vu-drawer-page-title">
<div class="vu-drawer-title-main">
<span class="vu-drawer-title-icon"><i class="mdi mdi-shield-account-outline" aria-hidden="true"></i></span>
<div><h1 id="vuAccountTitle">账户设置</h1><p>{$user->user_name|escape:'html'} · 登录安全</p></div>
</div>
<span class="vu-drawer-state {if $ga_enabled}is-active{else}is-muted{/if}"><i class="mdi {if $ga_enabled}mdi-check-circle-outline{else}mdi-circle-outline{/if}"></i>{if $ga_enabled}已保护{else}未设置{/if}</span>
</header>
<div class="vu-compact-stack">
<details class="vu-compact-panel" open>
<summary>
<span class="vu-summary-icon"><i class="mdi mdi-cellphone-key" aria-hidden="true"></i></span>
<span class="vu-summary-copy"><strong>双重认证</strong><small>{if $ga_enabled}验证器已绑定,可切换登录验证方式{else}绑定验证器保护账户登录{/if}</small></span>
<span class="vu-summary-status {if $ga_enabled}is-active{else}is-muted{/if}">{if $ga_enabled}已开启{else}未绑定{/if}</span>
<i class="mdi mdi-chevron-down vu-summary-chevron" aria-hidden="true"></i>
</summary>
<div class="vu-compact-panel-body">
{if $ga_enabled}
<div class="vu-inline-status"><i class="mdi mdi-shield-check-outline"></i><span>谷歌验证器已绑定</span><small>可用 6 位动态码登录或完成敏感操作</small></div>
<form class="vu-compact-form" id="vuSecurityMethodForm" data-csrf-token="{$account_csrf_token|default:''|escape:'html'}" autocomplete="off">
<label class="vu-compact-field" for="login_verify_method"><span>登录验证方式</span><select id="login_verify_method" class="vu-input"><option value="email" {if $login_verify_method != 'ga'}selected{/if}>邮箱验证码</option><option value="ga" {if $login_verify_method == 'ga'}selected{/if}>谷歌验证器动态码</option></select></label>
<button class="vu-btn vu-btn-small" id="verify-method-update" type="submit"><i class="mdi mdi-check"></i><span>保存方式</span></button>
</form>
<form class="vu-compact-form vu-compact-danger" id="vuGaDisableForm" data-csrf-token="{$account_csrf_token|default:''|escape:'html'}" autocomplete="off">
<label class="vu-compact-field" for="ga_disable_code"><span>解绑验证器</span><input id="ga_disable_code" class="vu-input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="输入 6 位动态码"></label>
<button class="vu-btn vu-btn-ghost vu-btn-small" id="ga-disable" type="submit"><i class="mdi mdi-link-variant-off"></i><span>解绑</span></button>
</form>
{else}
<div class="vu-totp-setup-compact">
<div class="vu-ga-qr" data-qr-text="{$ga_otpauth_uri|escape:'html'}" aria-label="谷歌验证器二维码"></div>
<div class="vu-totp-setup-copy">
<p>使用验证器 App 扫描二维码,或手动输入密钥。</p>
<div class="vu-code-row"><code>{$ga_setup_secret|escape:'html'}</code><button class="vu-icon-btn" type="button" data-copy="{$ga_setup_secret|escape:'html'}" aria-label="复制密钥"><i class="mdi mdi-content-copy"></i></button></div>
<form class="vu-compact-form" id="vuGaEnableForm" data-csrf-token="{$account_csrf_token|default:''|escape:'html'}" autocomplete="off">
<input type="hidden" id="ga_secret" value="{$ga_setup_secret|escape:'html'}">
<label class="vu-compact-field" for="ga_code"><span>动态验证码</span><input id="ga_code" class="vu-input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="输入 6 位验证码"></label>
<button class="vu-btn vu-btn-small" id="ga-enable" type="submit"><i class="mdi mdi-shield-key-outline"></i><span>完成绑定</span></button>
</form>
</div>
</div>
{/if}
</div>
</details>
<details class="vu-compact-panel">
<summary>
<span class="vu-summary-icon"><i class="mdi mdi-lock-outline" aria-hidden="true"></i></span>
<span class="vu-summary-copy"><strong>修改密码</strong><small>需要当前密码和邮箱验证码或动态码</small></span>
<i class="mdi mdi-chevron-down vu-summary-chevron" aria-hidden="true"></i>
</summary>
<div class="vu-compact-panel-body">
<form class="vu-compact-form" id="vuPasswordForm" data-csrf-token="{$account_csrf_token|default:''|escape:'html'}" autocomplete="off">
<label class="vu-compact-field" for="oldpwd"><span>当前密码</span><input id="oldpwd" class="vu-input" type="password" autocomplete="current-password" placeholder="输入当前密码"></label>
<div class="vu-compact-grid"><label class="vu-compact-field" for="pwd"><span>新密码</span><input id="pwd" class="vu-input" type="password" autocomplete="new-password" placeholder="12–72 字节"></label><label class="vu-compact-field" for="repwd"><span>确认密码</span><input id="repwd" class="vu-input" type="password" autocomplete="new-password" placeholder="再次输入"></label></div>
<div class="vu-factor-line"><div class="vu-factor-line-title"><i class="mdi mdi-email-check-outline"></i><span>邮箱验证码</span></div><div class="vu-password-code-row"><input id="pwd-emailcode" class="vu-input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="6 位验证码"><button class="vu-btn vu-btn-soft vu-btn-small" id="pwd-send-email" type="button">发送</button></div></div>
{if $ga_enabled}<label class="vu-compact-field" for="pwd-gacode"><span>谷歌动态码(可替代邮箱验证码)</span><input id="pwd-gacode" class="vu-input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="6 位动态码"></label>{/if}
<p class="vu-compact-hint">密码需包含大小写字母、数字和符号。</p>
<button class="vu-btn vu-btn-small" id="pwd-update" type="submit"><i class="mdi mdi-lock-reset"></i><span>更新密码</span></button>
</form>
</div>
</details>
</div>
</section>
{include file='user/layout_footer.tpl'}
{include file='user/layout_toast.tpl'}
{include file='user/layout_scripts.tpl'}
</body>
</html>