芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/public/user/customs/js/settings.min.js
"use strict";if($(".main-containt").find("#identitiyVerify").length&&$("#identitiyVerifyForm").on("submit",(function(){$(".spinner").removeClass("d-none"),$("#identitiyVerifySubmitBtn").attr("disabled",!0),$("#identitiyVerifySubmitBtnText").text(submitButtonText)})),$(".main-containt").find("#addressVerify").length&&$("#addressVerifyForm").on("submit",(function(){$(".spinner").removeClass("d-none"),$("#addressVerifySubmitBtn").attr("disabled",!0),$("#addressVerifySubmitBtnText").text(submitButtonText)})),$(".main-containt").find("#twofaVerification").length){function disableSubmitButton(text){$("#2fa_submit").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#2fa_submit_text").text(text)}function enableSubmitButton(text){$("#2fa_submit").prop("disabled",!1),$(".spinner").addClass("d-none"),$("#2fa_submit_text").text(text)}function handleSuccess(response){const{twoFaVerificationTypeForResponse:twoFaVerificationTypeForResponse,twoFa_type:twoFa_type}=response;$("#twoFaVerificationType").val(twoFaVerificationTypeForResponse),"google_authenticator"===twoFaVerificationTypeForResponse?($("#section_2fa_form").addClass("d-none"),$("#section_2fa_verify").addClass("d-none"),$("#section_google2fa").removeClass("d-none"),$("#qrsecret").html(response.secret).addClass("d-none"),$("#qr_image").attr("src",response.QR_Image)):"disabled"===twoFaVerificationTypeForResponse?($("#section_2fa_form").removeClass("d-none"),$("#section_2fa_verify").addClass("d-none"),$("#twoFaVerificationType").val(response.twoFaVerificationTypeForResponse),showSwal(successText,successMessageText,"success")):($("#section_2fa_form").addClass("d-none"),$("#section_2fa_verify").removeClass("d-none"),$("#type").html(twoFa_type))}function handleError(response){let message;"email"===response.two_step_verification_type?message="2-FA is already set by email!":"phone"===response.two_step_verification_type?message="2-FA is already set by phone!":"google_authenticator"===response.two_step_verification_type&&(message="2-FA is already set by Google Authenticator!"),showSwal(errorText,message,"error")}function showSwal(title,text,type){swal({title:title,text:text,type:type})}$(document).on("ready",(function(){$("#two_step_verification_type").change((function(){"phone"==$(this).val()?$.post({url:twofaVerifyPhoneUrl,data:{_token:token},beforeSend:function(){$("#2fa_submit").prop("disabled",!1)}}).done((function(response){response.status?($("#2fa-error").text(""),$("#2fa_submit").prop("disabled",!1)):($("#2fa-error").text(response.message),$("#2fa_submit").prop("disabled",!0))})):($("#2fa-error").text(""),$("#2fa_submit").prop("disabled",!1))}))})),$("#2fa_update").on("submit",(function(event){event.preventDefault();const is_demo=$("#is_demo").val();if("true"===is_demo)showSwal(errorText,demoCheckText,"error");else{var two_step_verification_type=$("#two_step_verification_type").val();if("google_authenticator"===two_step_verification_type)var url=twofaVerifyGoogleUrl;else if("disabled"===two_step_verification_type)var url=twofaVerifyDisabledUrl;else var url=twofaVerifyCreateUrl;$.post({url:url,dataType:"json",data:{_token:token,two_step_verification_type:two_step_verification_type},beforeSend:function(){disableSubmitButton(submitBtnText)}}).done((function(response){response.status?handleSuccess(response):handleError(response)})).always((function(){enableSubmitButton("Submit")}))}})),$("#2fa_verify_form").on("submit",(function(event){event.preventDefault();const twoFaVerificationType=$("#twoFaVerificationType").val(),twoStepVerificationCode=$("#two_step_verification_code").val(),rememberMe=$("#remember_me").prop("checked");(new Fingerprint2).get((function(result,components){$.post({url:twofaVerifySettingsUrl,data:{_token:token,two_step_verification_code:twoStepVerificationCode,twoFaVerificationType:twoFaVerificationType,remember_me:rememberMe,browser_fingerprint:result},beforeSend:function(){$("#verify_code").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#verify_code_text").text(submitBtnText)}}).fail((function(xhr,status,error){const data=xhr.responseJSON;data.status&&404!=data.status||showSwal(errorText,data.message,"error")})).done((function(data){data.status?($("#section_2fa_form").removeClass("d-none"),$("#section_2fa_verify").addClass("d-none"),showSwal(successText,data.message,"success"),$("#two_step_verification_code").val("")):showSwal(errorText,data.message,"error"),$("#verify_code").prop("disabled",!1),$(".spinner").addClass("d-none"),$("#verify_code_text").text("Verify")}))}))})),$(document).on("click",".completeVerification",(function(){const google2fa_secret=$("#qrsecret").html(),$section2faForm=$("#section_2fa_form"),$section2faVerify=$("#section_2fa_verify"),$sectionGoogle2fa=$("#section_google2fa"),$section2faOtp=$("#section_2fa_otp");$.post({url:twofaVerifyCompleteGoogleUrl,data:{_token:token,google2fa_secret:google2fa_secret},dataType:"json",beforeSend:function(){$("#completeVerificationBtn").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#completeVerification_text").text(submitBtnText)}}).done((function(response){response.status&&($section2faForm.addClass("d-none"),$section2faVerify.addClass("d-none"),$sectionGoogle2fa.addClass("d-none"),$section2faOtp.removeClass("d-none")),$("#completeVerificationBtn").prop("disabled",!1),$(".spinner").addClass("d-none"),$("#completeVerification_text").text("Submit")})).fail((function(jqXHR,textStatus,errorThrown){console.log("Error:",errorThrown)}))})),$("#otp_form").on("submit",(function(event){event.preventDefault();var one_time_password=$("#one_time_password").val(),two_step_verification_type=$("#two_step_verification_type").val(),remember_otp=$("#remember_otp").is(":checked");(new Fingerprint2).get((function(result,components){$.post({url:twofaVerifyGoogleOtpUrl,dataType:"json",data:{_token:token,one_time_password:one_time_password,two_step_verification_type:two_step_verification_type,remember_otp:remember_otp,browser_fingerprint:result},beforeSend:function(){$("#verify_otp").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#verify_otp_text").text(submitBtnText)}}).done((function(data){data.status?($("#section_2fa_form").removeClass("d-none"),$("#section_2fa_verify").addClass("d-none"),$("#section_google2fa").addClass("d-none"),$("#section_2fa_otp").addClass("d-none"),showSwal(successText,data.message,"success"),$("#one_time_password").val("")):showSwal(errorText,oneTimeMessageText,"error"),$("#verify_otp").attr("disabled",!1),$(".spinner").addClass("d-none"),$("#verify_otp_text").text("Proceed To Verification")}))}))}))}if($(".main-containt").find("#2faVerification").length&&$("#2faVerificationForm").on("submit",(function(event){event.preventDefault();var two_step_verification_code=$("#two_step_verification_code").val(),remember_me=$("#remember_me").prop("checked");(new Fingerprint2).get((function(result,components){$.post({url:twofaVerifyUrl,dataType:"json",data:{_token:token,two_step_verification_code:two_step_verification_code,remember_me:remember_me,browser_fingerprint:result},beforeSend:function(){$("#2faVerifyCode").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#2faVerifyCode_text").text(submitBtnText)}}).done((function(data){data.status&&404!=data.status?($("#message").text(""),window.location.href=dashboardUrl):($("#message").html(data.message),$("#2faVerifyCode").prop("disabled",!1),$(".spinner").addClass("d-none"),$("#2faVerifyCode_text").text(btnText))}))}))})),$(".main-containt").find("#google2faVerifySection").length){function showSwal(title,text,type){swal({title:title,text:text,type:type})}$(document).on("click",".completeVerification",(function(e){e.preventDefault(),$.post({url:twofaVerifyGoogleAuthenticatorUrl,dataType:"json",data:{_token:token,google2fa_secret:google2fa_secret},beforeSend:function(){$("#completeVerificationBtn").prop("disabled",!0),$(".spinner").removeClass("d-none"),$("#completeVerification_text").text(submitBtnText)}}).done((function(response){response.status&&($("#google2faVerify").addClass("d-none"),$("#section_2fa_otp").removeClass("d-none")),$("#completeVerificationBtn").prop("disabled",!1),$(".spinner").addClass("d-none"),$("#completeVerification_text").text("Submit")}))})),$("#otp_form").submit((function(event){event.preventDefault();var one_time_password=$("#one_time_password").val(),two_step_verification_type=$("#two_step_verification_type").val(),remember_otp=$("#remember_me").prop("checked");(new Fingerprint2).get((function(result,components){$.post({url:twofaVerifyGoogleOtpUrl,dataType:"json",data:{_token:token,one_time_password:one_time_password,two_step_verification_type:two_step_verification_type,remember_otp:remember_otp,browser_fingerprint:result},error:function(msg){200!=msg.status&&showSwal(errorText,JSON.parse(msg.responseText).message,"error")},beforeSend:function(){$("#verify_otp").prop("disabled",!0),$(".spinner").removeClass("d-none")}}).done((function(data){data.status?window.location.href=dashboardUrl:showSwal(errorText,invalidCodeText,"error")}))}))}))}