用户增加OTP认证设置

This commit is contained in:
刘祥超
2022-07-24 16:14:38 +08:00
parent 847d08a9bb
commit f3ac8a5cc5
9 changed files with 222 additions and 7 deletions

View File

@@ -60,6 +60,13 @@
<input type="text" name="email" maxlength="100"/>
</td>
</tr>
<tr>
<td>OTP认证</td>
<td>
<checkbox name="otpOn">启用OTP</checkbox>
<p class="comment">启用OTP认证后在用户登录的时候需要同时填写OTP动态密码。</p>
</td>
</tr>
<tr>
<td>备注</td>
<td>

View File

@@ -67,6 +67,13 @@
<input type="text" name="email" maxlength="100" v-model="user.email"/>
</td>
</tr>
<tr>
<td>OTP认证</td>
<td>
<checkbox name="otpOn" v-model="user.otpLoginIsOn">启用OTP</checkbox>
<p class="comment">启用OTP认证后在用户登录的时候需要同时填写OTP动态密码。</p>
</td>
</tr>
<tr>
<td>备注</td>
<td>

View File

@@ -72,4 +72,29 @@
<span v-else>{{user.registeredIP}}<span class="grey small">{{user.registeredRegion}}</span></span>
</td>
</tr>
</table>
<h3>OTP认证</h3>
<table class="ui table definition selectable">
<tr>
<td class="title">状态</td>
<td>
<span v-if="otp != null && otp.isOn" class="green">已启用</span>
<span v-else class="disabled">未启用</span>
</td>
</tr>
<tr v-if="otp != null && otp.isOn">
<td colspan="2"><more-options-indicator>更多信息</more-options-indicator></td>
</tr>
<tr v-if="otp != null && otp.isOn && moreOptionsVisible">
<td>认证二维码</td>
<td>
<img :src="'/users/otpQrcode?userId=' + user.id"/>
<p class="comment">可以通过二维码快速添加OTP认证信息到App中。</p>
</td>
</tr>
<tr v-if="otp != null && otp.isOn && moreOptionsVisible">
<td>密钥</td>
<td>{{otp.params.secret}}</td>
</tr>
</table>