oauth添加二次认证
This commit is contained in:
parent
d8b3f2b492
commit
682f1b06b9
|
|
@ -96,7 +96,8 @@
|
|||
</el-select>
|
||||
<el-row>
|
||||
<span>输入验证码</span>
|
||||
<el-input placeholder="请输入验证码" style="width: 100%; margin-top: 20px;" v-model="second_auth_code" v-if="second_auth_method == 'TOTP'">
|
||||
<el-input placeholder="请输入验证码" style="width: 100%; margin-top: 20px;" v-model="second_auth_code"
|
||||
v-if="second_auth_method == 'TOTP'">
|
||||
<template #prepend>
|
||||
<el-icon>
|
||||
<Lock />
|
||||
|
|
@ -105,15 +106,12 @@
|
|||
</el-input>
|
||||
<el-input v-model="code_login_form.code" placeholder="请输入验证码" v-if="second_auth_method == 'EMAIL'">
|
||||
<template #prepend>
|
||||
<el-icon><VerificationCode /></el-icon>
|
||||
<el-icon>
|
||||
<VerificationCode />
|
||||
</el-icon>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button
|
||||
type="text"
|
||||
:disabled="countdown > 0"
|
||||
@click="sendCode"
|
||||
class="code-btn"
|
||||
>
|
||||
<el-button type="text" :disabled="countdown > 0" @click="sendCode" class="code-btn">
|
||||
{{ countdown > 0 ? `${countdown}s后重发` : "发送验证码" }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
@ -349,9 +347,22 @@ const thirdLogin = async (type) => {
|
|||
return;
|
||||
}
|
||||
let statusResp = await getThirdPartyLoginStatus({ uuid: uuid, host_id: loginData.value.fingerprint });
|
||||
if (statusResp["code"] !== 0) {
|
||||
ElMessage.error("获取登录状态失败!请稍后再试");
|
||||
if (statusResp["code"] == 1102) {
|
||||
clearInterval(timer.value);
|
||||
ElMessage.error(statusResp["message"]);
|
||||
//需二次认证,支持方式
|
||||
second_auth_visible.value = true;
|
||||
second_auth_state_key.value = statusResp["data"]["state"];
|
||||
let types = statusResp["data"]["type"];
|
||||
second_auth_type_list.value = types.split(",");
|
||||
//删除''空值
|
||||
second_auth_type_list.value = second_auth_type_list.value.filter(item => item);
|
||||
second_auth_method.value = second_auth_type_list.value[0];
|
||||
//console.log("second_auth_type_list:", second_auth_type_list.value);
|
||||
return;
|
||||
|
||||
} else if (statusResp["code"] != 0) {
|
||||
ElMessage.error(statusResp["message"] || "该账号已被禁用,请联系管理员!");
|
||||
return;
|
||||
}
|
||||
if (statusResp["code"] === 9) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue