This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
{$layout}
<table class="ui table definition selectable">
<tr>
<td class="title">状态</td>
<td>
<span v-if="otp != null && otp.isOn" class="green">已启用OTP认证</span>
<span v-else class="disabled">未启用</span> &nbsp; &nbsp;
<a href="" @click.prevent="disable" v-if="otp != null && otp.isOn">[停用]</a>
<a href="" @click.prevent="enable" v-if="otp == null || !otp.isOn">[启用]</a>
<p class="comment">启用后,用户每次登录时需要输入动态密码。</p>
</td>
</tr>
<tr v-if="otp != null && otp.isOn">
<td>认证二维码</td>
<td>
<img :src="'/settings/mfa/otpQrcode'" alt=""/>
<p class="comment"><a :href="'/settings/mfa/otpQrcode?download=true'">[下载]</a> &nbsp; 可以通过二维码快速添加OTP认证信息到认证App中。</p>
</td>
</tr>
<tr v-if="otp != null && otp.isOn">
<td>密钥</td>
<td>{{otp.params.secret}}</td>
</tr>
</table>

View File

@@ -0,0 +1,19 @@
Tea.context(function () {
this.enable = function () {
teaweb.confirm("确定要启用多因子认证吗?", function () {
this.$post(".enable")
.success(function () {
teaweb.reload()
})
})
}
this.disable = function () {
teaweb.confirm("确定要停用多因子认证吗?", function () {
this.$post(".disable")
.success(function () {
teaweb.reload()
})
})
}
})