@authing/guard-shim-react 4.5.8-alpha.3 → 4.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/guard.min.css +1 -1
- package/dist/guard.min.js +139 -152
- package/dist/typings/src/GuardSelect/index.d.ts +0 -1
- package/dist/typings/src/Login/hooks/useLoginMultiple.d.ts +1 -1
- package/dist/typings/src/TenantPortalSelect/interface.d.ts +0 -22
- package/dist/typings/src/Type/application.d.ts +0 -2
- package/dist/typings/src/_utils/config/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/typings/src/TenantPortalSelect/CreateButton/index.d.ts +0 -4
- package/dist/typings/src/TenantPortalSelect/InputEmailCode/index.d.ts +0 -8
- package/dist/typings/src/TenantPortalSelect/JoinButton/index.d.ts +0 -4
- package/dist/typings/src/TenantPortalSelect/businessRequest.d.ts +0 -6
- package/dist/typings/src/TenantPortalSelect/core/CreateTenant.d.ts +0 -4
- package/dist/typings/src/TenantPortalSelect/core/JoinTenant.d.ts +0 -4
package/dist/guard.min.js
CHANGED
|
@@ -7232,7 +7232,7 @@ var a={};
|
|
|
7232
7232
|
// ESM COMPAT FLAG
|
|
7233
7233
|
i.r(a),
|
|
7234
7234
|
// EXPORTS
|
|
7235
|
-
i.d(a,{AccessTokenDocument:()=>/* reexport */We,AddMemberDocument:()=>/* reexport */E,AddNodeDocument:()=>/* reexport */k,AddNodeV2Document:()=>/* reexport */S,AddPolicyAssignmentsDocument:()=>/* reexport */x,AddUserToGroupDocument:()=>/* reexport */P,AddWhitelistDocument:()=>/* reexport */_,AllowDocument:()=>/* reexport */T,ApiCode:()=>/* reexport */
|
|
7235
|
+
i.d(a,{AccessTokenDocument:()=>/* reexport */We,AddMemberDocument:()=>/* reexport */E,AddNodeDocument:()=>/* reexport */k,AddNodeV2Document:()=>/* reexport */S,AddPolicyAssignmentsDocument:()=>/* reexport */x,AddUserToGroupDocument:()=>/* reexport */P,AddWhitelistDocument:()=>/* reexport */_,AllowDocument:()=>/* reexport */T,ApiCode:()=>/* reexport */AJ,AppPasswordStrengthLimit:()=>/* reexport */_i,ApplicationType:()=>/* reexport */ki,ArchivedUsersDocument:()=>/* reexport */Ge,AssignRoleDocument:()=>/* reexport */O,AuthClientProvider:()=>/* reexport */BL,AuthenticationClient:()=>/* reexport */_c,AuthenticationTokenProvider:()=>/* reexport */Zs,AuthorizeResourceDocument:()=>/* reexport */N,AuthorizedResourcesDocument:()=>/* reexport */mt,AuthorizedTargetsDocument:()=>/* reexport */Ke,BindEmailDocument:()=>/* reexport */I,BindPhoneDocument:()=>/* reexport */A,ChangeMfaDocument:()=>/* reexport */R,ChangeModuleApiCodeMapping:()=>/* reexport */GJ,CheckLoginStatusDocument:()=>/* reexport */Ye,CheckPasswordStrengthDocument:()=>/* reexport */Je,ChildrenNodesDocument:()=>/* reexport */Qe,CodeAction:()=>/* reexport */IJ,ConfigEmailTemplateDocument:()=>/* reexport */M,CreateFunctionDocument:()=>/* reexport */D,CreateGroupDocument:()=>/* reexport */L,CreateOrgDocument:()=>/* reexport */F,CreatePolicyDocument:()=>/* reexport */j,CreateRoleDocument:()=>/* reexport */B,CreateUserDocument:()=>/* reexport */q,CreateUserWithCustomDataDocument:()=>/* reexport */U,CreateUserpoolDocument:()=>/* reexport */V,DeleteFunctionDocument:()=>/* reexport */$,DeleteGroupsDocument:()=>/* reexport */z,DeleteNodeDocument:()=>/* reexport */H,DeleteOrgDocument:()=>/* reexport */W,DeletePoliciesDocument:()=>/* reexport */G,DeletePolicyDocument:()=>/* reexport */K,DeleteRoleDocument:()=>/* reexport */Y,DeleteRolesDocument:()=>/* reexport */J,DeleteUserDocument:()=>/* reexport */Q,DeleteUserpoolDocument:()=>/* reexport */Z,DeleteUsersDocument:()=>/* reexport */X,DisableEmailTemplateDocument:()=>/* reexport */ee,DisbalePolicyAssignmentDocument:()=>/* reexport */te,EmailScene:()=>/* reexport */Nc,EmailTemplateType:()=>/* reexport */l,EmailTemplatesDocument:()=>/* reexport */Ze,EnableEmailTemplateDocument:()=>/* reexport */ne,EnablePolicyAssignmentDocument:()=>/* reexport */re,FindUserDocument:()=>/* reexport */Xe,FindUserWithCustomDataDocument:()=>/* reexport */et,FunctionDocument:()=>/* reexport */tt,FunctionsDocument:()=>/* reexport */nt,GetUserDepartmentsDocument:()=>/* reexport */rt,GetUserGroupsDocument:()=>/* reexport */ot,GetUserRolesDocument:()=>/* reexport */it,GroupDocument:()=>/* reexport */at,GroupWithUsersDocument:()=>/* reexport */st,GroupWithUsersWithCustomDataDocument:()=>/* reexport */ct,GroupsDocument:()=>/* reexport */lt,Guard:()=>/* reexport */zJ,GuardComponent:()=>/* reexport */$J,GuardEventsCamelToKebabMapping:()=>/* reexport */XL,GuardMode:()=>/* reexport */Ys,GuardModuleType:()=>/* reexport */ML,GuardPageSene:()=>/* reexport */Oc,InputMethod:()=>/* reexport */Tc,IsActionAllowedDocument:()=>/* reexport */ut,IsActionDeniedDocument:()=>/* reexport */dt,IsDomainAvaliableDocument:()=>/* reexport */ft,IsRootNodeDocument:()=>/* reexport */pt,IsUserExistsDocument:()=>/* reexport */ht,LanguageMap:()=>/* reexport */Rc,ListGroupAuthorizedResourcesDocument:()=>/* reexport */vt,ListNodeByCodeAuthorizedResourcesDocument:()=>/* reexport */gt,ListNodeByIdAuthorizedResourcesDocument:()=>/* reexport */yt,ListRoleAuthorizedResourcesDocument:()=>/* reexport */bt,ListUserAuthorizedResourcesDocument:()=>/* reexport */wt,LoginByEmailDocument:()=>/* reexport */oe,LoginByPhoneCodeDocument:()=>/* reexport */ie,LoginByPhonePasswordDocument:()=>/* reexport */ae,LoginBySubAccountDocument:()=>/* reexport */se,LoginByUsernameDocument:()=>/* reexport */ce,LoginMethods:()=>/* reexport */$s,ManagementClient:()=>/* reexport */Vs,ManagementTokenProvider:()=>/* reexport */Sa,MoveMembersDocument:()=>/* reexport */le,MoveNodeDocument:()=>/* reexport */ue,NodeByCodeDocument:()=>/* reexport */Ct,NodeByCodeWithMembersDocument:()=>/* reexport */Et,NodeByIdDocument:()=>/* reexport */kt,NodeByIdWithMembersDocument:()=>/* reexport */St,OIDCConnectionMode:()=>/* reexport */zs,Operator:()=>/* reexport */c,OrgDocument:()=>/* reexport */xt,OrgsDocument:()=>/* reexport */Pt,PasswordSecurityLevel:()=>/* reexport */Si,PoliciesDocument:()=>/* reexport */_t,PolicyAssignmentTargetType:()=>/* reexport */s,PolicyAssignmentsDocument:()=>/* reexport */Ot,PolicyDocument:()=>/* reexport */Tt,PolicyEffect:()=>/* reexport */p,PolicyWithAssignmentsDocument:()=>/* reexport */Nt,PreviewEmailDocument:()=>/* reexport */It,Protocol:()=>/* reexport */Ws,QiniuUptokenDocument:()=>/* reexport */At,QueryMfaDocument:()=>/* reexport */Rt,RefreshAccessTokenDocument:()=>/* reexport */de,RefreshTokenDocument:()=>/* reexport */fe,RefreshUserpoolSecretDocument:()=>/* reexport */pe,RegisterByEmailDocument:()=>/* reexport */he,RegisterByPhoneCodeDocument:()=>/* reexport */me,RegisterByUsernameDocument:()=>/* reexport */ve,RegisterMethods:()=>/* reexport */Gs,RegisterSortMethods:()=>/* reexport */Ks,RelayMethodEnum:()=>/* reexport */Ai,RemoveMemberDocument:()=>/* reexport */ge,RemovePolicyAssignmentsDocument:()=>/* reexport */ye,RemoveUdfDocument:()=>/* reexport */be,RemoveUdvDocument:()=>/* reexport */we,RemoveUserFromGroupDocument:()=>/* reexport */Ce,RemoveWhitelistDocument:()=>/* reexport */Ee,ResetPasswordByFirstLoginTokenDocument:()=>/* reexport */Se,ResetPasswordByForceResetTokenDocument:()=>/* reexport */xe,ResetPasswordDocument:()=>/* reexport */ke,ResourceType:()=>/* reexport */o,RevokeRoleDocument:()=>/* reexport */Pe,RoleDocument:()=>/* reexport */Mt,RoleWithUsersDocument:()=>/* reexport */Dt,RoleWithUsersWithCustomDataDocument:()=>/* reexport */Lt,RolesDocument:()=>/* reexport */Ft,RootNodeDocument:()=>/* reexport */jt,SceneType:()=>/* reexport */Ii,SearchNodesDocument:()=>/* reexport */Bt,SearchUserDocument:()=>/* reexport */qt,SearchUserWithCustomDataDocument:()=>/* reexport */Ut,SendEmailDocument:()=>/* reexport */_e,SendFirstLoginVerifyEmailDocument:()=>/* reexport */Te,SetMainDepartmentDocument:()=>/* reexport */Oe,SetUdfDocument:()=>/* reexport */Ne,SetUdfValueBatchDocument:()=>/* reexport */Ie,SetUdvBatchDocument:()=>/* reexport */Re,SetUdvDocument:()=>/* reexport */Ae,SocialConnectionProvider:()=>/* reexport */Hs,SortByEnum:()=>/* reexport */u,SupportedAdminActionEnum:()=>/* reexport */Ei,SupportedUserActionEnum:()=>/* reexport */Ci,TemplateCodeDocument:()=>/* reexport */Vt,UdfDataType:()=>/* reexport */f,UdfDocument:()=>/* reexport */$t,UdfTargetType:()=>/* reexport */h,UdfValueBatchDocument:()=>/* reexport */zt,UdvDocument:()=>/* reexport */Ht,UnbindEmailDocument:()=>/* reexport */Me,UnbindPhoneDocument:()=>/* reexport */De,UpdateEmailDocument:()=>/* reexport */Le,UpdateFunctionDocument:()=>/* reexport */Fe,UpdateGroupDocument:()=>/* reexport */je,UpdateNodeDocument:()=>/* reexport */Be,UpdatePasswordDocument:()=>/* reexport */qe,UpdatePhoneDocument:()=>/* reexport */Ue,UpdatePolicyDocument:()=>/* reexport */Ve,UpdateRoleDocument:()=>/* reexport */$e,UpdateUserDocument:()=>/* reexport */ze,UpdateUserpoolDocument:()=>/* reexport */He,UserBatchDocument:()=>/* reexport */Gt,UserBatchWithCustomDataDocument:()=>/* reexport */Kt,UserDocument:()=>/* reexport */Wt,UserStatus:()=>/* reexport */d,UserWithCustomDataDocument:()=>/* reexport */Yt,UserpoolDocument:()=>/* reexport */Jt,UserpoolTypesDocument:()=>/* reexport */Qt,UserpoolsDocument:()=>/* reexport */Zt,UsersDocument:()=>/* reexport */Xt,UsersWithCustomDataDocument:()=>/* reexport */en,WhitelistDocument:()=>/* reexport */tn,WhitelistType:()=>/* reexport */m,getDefaultG2Config:()=>/* reexport */Ac,getDefaultGuardLocalConfig:()=>/* reexport */lF,getPageConfig:()=>/* reexport */rZ,getPublicConfig:()=>/* reexport */eZ,guardEventsFilter:()=>/* reexport */JL,guardEventsHijacking:()=>/* reexport */ZL,setPageConfig:()=>/* reexport */oZ,setPublicConfig:()=>/* reexport */tZ,useFetchConsoleConfig:()=>/* reexport */lZ,useGlobalAuthClient:()=>/* reexport */qL,useGuardView:()=>/* reexport */fB,useMergeDefaultConfig:()=>/* reexport */sZ});
|
|
7236
7236
|
// NAMESPACE OBJECT: ./src/_utils/locales/en-us/index.ts
|
|
7237
7237
|
var e={};i.r(e),i.d(e,{common:()=>Wu,login:()=>Gu,user:()=>Ku});
|
|
7238
7238
|
// NAMESPACE OBJECT: ./src/_utils/locales/zh-cn/index.ts
|
|
@@ -12635,7 +12635,7 @@ caches:["localStorage"],excludeCacheFor:["cimode"]}),
|
|
|
12635
12635
|
// backwards compatibility
|
|
12636
12636
|
this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Ru),this.addDetector(Mu),this.addDetector(Fu),this.addDetector(qu),this.addDetector(Uu),this.addDetector(Vu),this.addDetector($u),this.addDetector(zu)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null;// new i18next v19.5.0
|
|
12637
12637
|
}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();Hu.type="languageDetector";// CONCATENATED MODULE: ./src/_utils/locales/en-us/common.json
|
|
12638
|
-
const Wu=JSON.parse('{"alreadyHasAcc":"already have an account,","bind":"Bind","yes":"Yes","no":"No","usernameFormatError":"Enter a valid user name","customNameFormatError":"Enter a valid account number","checkUserName":"The username already exists","checkCustomName":"The account already exists","pleaseSelectDate":"Please select date","bindEmail":"Bind Email","bindPhone":"Bind your phone number","confirm":"Confirm","unlock":"unlock","email":"Email","emailFormatError":"Enter a valid Email address ","emailLabel":"Email","female":"Female","guidance":{},"hasLooseSaftyCode":"Lost the security code?","inputFourVerifyCode":"{{length}}-digit code","login":"Log In","man":"Male","noAccYet":"No account yet,","perfectUserInfo":"Personal Information","phoneFormateError":"Please verify your phone number first","phoneLabel":"Phone","phoneNumber":"Phone number","register":"Sign Up","registerImmediate":"Sign Up","retryAfterTime":"{{time}} seconds","sendVerifyCode":"Send Code","sure":"Confirm","uploadFail":"{{name}} failed to upload","useRecoverCode":"Use recovery code","username":"Username","problem":{"title":"Tell us your problem","noVerify":"Unable to receive the verification code","noLogin":"Unable to log in","noRegister":"Unable to register","noAccount":"Lost Account","noResetPass":"Unable to reset password","locked":"Account is locked","other":"Other","noVerifyTip":{"tip":"If you cannot receive the mobile phone verification code, I suggest you do the following:","type1":"1. Check if your mobile phone is turned off or offline.","type2":"2. Check if your phone number has been entered correctly.","type3":"3. Check if your SMS with the verification code is blocked."},"noLoginTip":{"type1":"1. Check if your username and password have been entered correctly.","type2":"2. Check if your mobile phone is turned off or offline."},"noRegisterTip":{"tip":"If you cannot register, please do the following steps to solve this issue:","type1":"1. Check if your account has been registered.","type2":"2. Check if your phone number has been entered correctly.","type3":"3. Check if your SMS with the verification code is blocked."},"noAccountTip":{"tip":"If your account is lost, please do the following steps to solve this issue:","type1":"1. Check if your username and password have been entered correctly.","type2":"2. Check if your mobile phone is turned off or offline."},"noResetPassTip":{"tip":"If your password cannot be reset, please do the following steps to solve this issue:","type1":"1. Check if your mobile phone is turned off or offline.","type2":"2. Check if your password has been entered correctly."},"otherTip":{},"successTip":"Submitted successfully","successTipMsg":"Your information has been submitted to the application administrator. Your feedback will be processed as soon as possible. Please wait patiently.","form":{"phone":"Contact","question":"Problem","questionDescript":"Problem description","questionClip":"Problem screenshot","submit":"Submit"},"noLoginTips":"If you cannot log in, we suggest you do the following:","lockedTips":"If your account is locked, please contact the administrator to unlock it and try to log in again"},"backLoginPage":"Back","LoginSuccess":"Login Success","welcomeDoc":"Welcome to {{name}}. Providing your personal information will allow us to give you the best online\\nexperience.","copied":"Copied","bindEmailDoc":"please enter the mailbox to bind","copy":"Copy","SMS":"SMS Verification","EmailVerification":"Email Verification","OTPVerification":"OTP Verification","faceVerification":"Face Verification","registrationSuccess":"Registration Success","repeatPasswordDoc":"The Two Passwords Entered are Inconsistent","copyFailed":"Copy Failed","downloadTotpAppAndroid":"Android download","downloadTotpAppDocs":"Please use your mobile phone to scan the code to download the verifier","downloadTotpAppIOS":"IOS download","bindTotp":"Bind OTP","checkEmail":"The email already exists","checkPhone":"The phone number already exists","loginFailCheck":"Reminder: Your password is wrong, you can try {{number}} times","otpText1":"Please go to the OTP binding page to bind","faceText1":"Bind facial recognition","faceText2":"Please turn on the camera to recognize the face for binding","faceText3":"Start","faceText4":"Try again","checkPasswordHasSpace":"No spaces","backToVerify":"Back","backToMFA":"Return to MFA binding","bindSuccess":"Complete binding","clickTodownload":"click to download","goToLogin":"Back","mfaText1":"Scan the code to add MFA, check it on your mobile phone and enter the 6-digit security code.","noQuestions":"no problem,","noValidator":"No validator please","pleaseRecordKey":"Please record the key","timeoutLDAP":"Request timed out, LDAP configuration error","totpText1":"Please keep the recovery code properly","totpText2":"If your MFA is lost, you will need a recovery code","usePhoneOpen":"Please open Google Authenticator or Microsoft Authenticator on your phone","passwordAgain":"Confirm password","isMissing":"{{name}} is missing","password":"Password","captchaCode":"Digit code","account":"Account","phone":"Phone number","pToLogin":"seconds later back","resetSuccess":"Reset successfully","resetSuccessMessage":"The password is reset successfully, you can continue to log in with the new password","welcome":"Welcome","initPasswordText":"To ensure account security, please set your new password.","unsafePasswordChangeText":"Your password does not meet the current password strength requirements. Please set a new password.","updatePsswordSuccess":"Change the password successfully, please log in again","fullCaptchaCode":"Please fill in the complete","feedback":"Need help ?","loginProtocolTips":"Please check the login protocol","registerProtocolTips":"Please check the registration agreement","accountLock":"The account is locked, please click the question mark below to give feedback","corsErrorMessage":"The current domain name is not in the list of allowed domain names","corsErrorMessage2":"If you have any questions, you can <a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">refer to the document</a>","totpGenerateCode":"Generate a new recovery code for you, please record this key safely","verifyCodeLogin":"Verify Code","phoneVerifyCode":"Phone Code","emailVerifyCode":"Email Code","phoneCodeTab":"Phone Code","emailCodeTab":"Email Code","phoneOrEmail":"Phone Or Email","skip":"Skip","back":"Back","publicAccount":"Public account","identityBindingAskTitle":"Choose how to connect","identityBindingAskDesc":"If you are bound to an existing account, you can directly log in to the existing account by this method next time.","identityBindingCreate":"Create a new account","identityBindingBinding":"Bind to an existing account","identityBindingTitle":"Bind existing account","identityBindingDesc":"After binding, you can log in to this account directly by this method next time","identityBindingSkipAskTitle":"Account Binding","identityBindingSkipAskDesc":"Enter an exisiting account to bind, or enter a new account to sign up.","internationPhoneMessage":"Please enter a valid mobile phone number","areaCodePhone":"Area code Mobile number","timeoutAD":"Request timed out, AD misconfigured","timeout":"Request timed out, please try again later","userNameIsExists":"This username already exists!","fetchError":"Network connection failed, please try again later","i18nCheckErrorMessage":"Please enter a valid mobile phone number or correct email address","verifyCodeRegister":"Verify Code","PasswordRegister":"Password","EmailRegister":"Email","registerTab":"{{text}}","noFindEmail":"Can\'t find the email account","noFindPhone":"Can\'t find the phone account","noFindUsername":"Can\'t find the username account","jobNumber":"Account first letter must be capital","passwordUnsafeTip":"Password strength has been updated, please refresh the page and try again","loginWithWechatmpQrcodeTipsTitle":"Long press the QR code to login","del":"Delete","qrcode":"QR Code","registerCompletePasswordDesc":"To ensure account security, please set your password.","mfaCertification":"Multi-factor authentication","emailMfaCheck":"Please enter email verification code","SmsMfaCheck":"Please enter SMS verification code","faceCheck":"Please keep the camera turned on and unobstructed","resetAccount":{"title":"Set the user name","message":"The current user name is not unique, please reset the user name before you can successfully log on."},"noTenant":"There are currently no tenants who have joined","joinTenant":"Join Tenant","tenantExample":"Please enter the tenant identification code, for example: Ljrs18wa","enter":"enter","createTenant":"Create Tenant","pleaseInput":"Enter","tenantName":"Tenant Name","tenantEmail":"Tenant\'s corporate email domain name","tenantDesc":"Tenant Description","visitor":"guesting","createTenantDesc":"To create a new tenant, please click here","codeError":"Identification code error, please re-enter","emailVerify":"Verify Enterprise Email","verify":"test and verify","inputBusinessEmail":"Please enter your company email address","inputCode":"Please enter the verification code","domainNotFound":"The current organization administrator has not set up a corporate email domain name. Please contact the administrator to set it up and join the organization."}'),Gu=JSON.parse('{"inputAccount":"Enter {{text}}","inputAdUsername":"Enter AD username","accPwdLoginVerify":"Account login verification","captchaCode":"Captcha","inputAdPwd":"Enter AD password","inputCaptchaCode":"Digit code","inputCorrectPhone":"Enter correct phone number or email address","inputEmail":"Enter Email","inputLdapPwd":"LDAP Password","inputLdapUsername":"LDAP Username","inputLoginPwd":"Enter Password","inputPhone":"Phone number","inputPhoneOrEmail":"Enter Phone number or Email","inputPwdAgain":"Enter password again","inputRecoverCode":"Enter recovery code","inputSixCode":"Enter 6-digit security code","loginBy":"Sign in with {{name}}","mfaAfterReset":"If you do not have a recovery code, please contact the administrator","noEmpty":"Please enter a {{label}}","rememberedSecret":"This key has been safely recorded","resetPwd":"Reset password","selfUnlock":"self unlock","selfUnlockText":"Your account has been locked, please enter the verification code and password to unlock it by yourself.","thridAccLogin":"Or sign in with","pwdLogin":"Password","bindPwdLogin":"Password","appScanLogin":"Mobile APP QR Code","scanLogin":"QR Code","ldapLogin":"LDAP","adLogin":"AD","authingOtpPushLogin":"Login by push","authingOtpPushCancelLogin":"Cancel login","loginText":"Login","otpLoginPendingText":"The request has been sent to the Authoring Token APP. Please confirm login at the client","getOtpLoginRequestAgain":"The login request is invalid. Please send request again","downloadOtpVerifier":"Download Authing OTP","loginToMobileClient":"Login Authing OTP","scanQrCode":"Scan QR code","setAuthingTokenVerify":"Set Authing OTP Verify","phoneScanCodeAndDownloadAuthingToken":"Please scan the code with your mobile phone or go to the app market to download the Authing OTP","noPrompt":"Don\'t prompt again","directLogin":"Direct login","openAuthingOtp":"Open the Authing OTP and click \\"Login / Register\\"","clickAndScanQrcode":"Click the scanning entry at the upper right corner of the \\"Login Application\\" page to scan the QR code below","downloadIOS":"IOS download","downloadAndroid":"Android download","howBindClient":"How to bind client applications","installAuthingToken":"Install the Authing Token App","downloadAuthingToken":"Please use your mobile phone to scan the code or go to the application market to download the Authoring token","openAppList":"Open app list","addApp":"Open the \\"Application List\\" and click \\"Add Application\\"","openLoginPage":"Open the login page","scanQrcode":"Click the \\"Scan QR code\\" button to scan the application QR code","scanFollowingQrcode":"Scan the following application QR code","relevanceApp":"Associate the application and log in to the account","receiveMessageFromAuthingToken":"After logging in to the application account, you can complete the login by receiving the Web application push in the Authing token","howUsePushLogin":"How to use push login","inputAccountInWeb":"Enter account information in the web login panel","clickLoginButton":"Click \\"Login\\"","receiveMessageInApp":"Receive login push on the bound mobile application","confirmLoginInApp":"Confirm \\"Login\\" to successfully log in to the web side.","howGetAppLoginUrl":"How to get the application login address","getCodeFromAdmin":"Get the associated application QR code from the administrator","getCodeFromAdminTips":"The administrator can get the application QR code in the application login control, and scan the QR code to log in to the corresponding application.","getCodeFromPersonalCenter":"Get application QR code from personal center","getCodeFromPersonalCenterTips":"Users can save the application login QR code in \\"Personal Center - Quick Authentication\\", and use the Authoring token to scan the code and select the application to log in","getLoginUrlFromConsole":"The administrator obtains the login address from the console","getLoginUrlFromConsoleTips":"Administrators can copy the authentication address in \\"Console - Application Details - Application Configuration - Authentication Configuration\\". Users can log in and bind after copying the authentication address.","nextStep":"Next Step","enterAccount":"Please enter the account","inputEmailCode":"Enter email verification code","otherVerifyWay":"Other verification methods","otherLoginWay":"OR","verifyCodeSended":"Verification code has been sent to","clickSent":"Click send","reSent":"Click to resend the verification code","bindPhoneInfo":"Please enter the phone number to bind","inputPhoneCode":"Please enter the phone verification code","forgetPwd":"Forgot Password","inputPwd":"Password","login":{"setPwdLimit2":"At least six digits, must contain two of English, numbers and symbols","setPwdLimit3":"At least six digits, including English, numbers and symbols"},"setPwdLimit1":"Set a password of at least 6 characters","setPwdLimitMsg1":"Passwords must be at least 6 characters long","setPwdLimitMsg2":"The password must be at least 6 characters long and must contain two of English, numbers and symbols","setPwdLimitMsg3":"The password must be at least 6 digits long and must contain English, numbers and symbols at the same time","wechatmpQrcode":"WechatMp QRcode\\t","inputUsername":"Username","moreWays":"More Login","inputCorrectPhoneOrEmail":"Enter a valid Email or Phone number","sendCodeTimeout":"Sending failed, please try later","mediaDevicesSupport":"The current device does not support face recognition","noLoginMethodsDesc":"No login method configured","inputNewPwd":"Please enter a new password","socialConnectionMessage":"Login with {{provider}} is not supported, please choose another way to log in, or try again in another browser","selectLoginAccount":"Select login account","useOtherAccount":"Use another account","wechatScanLogin":"WeChat QR Code","qrcodeRefer":"Refresh","qrcodeNetWorkError":"Retry","scanAgain":"Scan the code again","scanSuccess":"Scan Success","tenant":{"consoleManage":"Admin console","ssoPad":"Single sign-on application panel"},"AuthorizationCamera":"Please enable authorization first","checkPreferences":"Please check preferences","requireError":"Unable to satisfy request error","hardwareSupport":"Hardware not supported","verifyCodeTip":"Try another","loginWithPasskey":"Sign in with Passkey","resetPassword":{"pleaseInputPassword":"Please input a password","checkPasswordDiff":"Please enter a consistent password","nextStep":"Next","reset":"reset password","back":"Back","resetPasswordText1":"Please enter your registered mobile phone number/email to receive the verification code, and we will reset your password.","resetPasswordText2":"You are resetting Password for {{account}}。","input":"Input{{text}}","inputFourVerifyCode":"{{length}}-digit code","inputNewPwd":"Please enter a new password","confirmNewPwd":"Please confirm the new password","successTipMsg":"You can continue to log in with your new password","successTip":"Password reset succeeded","backLogin":"Seconds will automatically jump to the login page"},"wecomScanLogin":"Enterprise WeChat scan code to log in"}'),Ku=JSON.parse('{"inputCurrPwd":"Enter current password","inputNewPwd":"Enter a new Password","inputOldPwd":"Enter a old Password","mfaBind":"MFA Binding","modifyPwd":"Change Password","nextStep":"Next","numberSafteyCode":"Digital Security Code","error":"Error~","contactAdministrator":"Unknown error ~ please contact the administrator for processing","resetpasswordText1":"Enter your registered phone number/email, enter the verification code received, and we will reset your password.","modifyPwdText":"Your password has been used continuously for more than {{number}} months, which may be risky. Please reset your password.","modifyNoticePwdText":"Your password has been used continuously for more than {{number}} months, It will expire soon, in order not to affect your use, please set a new password","unlockTip":"If you encounter problems with unlocking, please click"}'),Yu=JSON.parse('{"guidance":{},"uploadFail":"{{name}} 上传失败","confirm":"确认","retryAfterTime":"{{time}} 秒","sendVerifyCode":"发送验证码","emailFormatError":"输入有效的邮箱","usernameFormatError":"输入有效的用户名","customNameFormatError":"输入有效的账号","phoneFormateError":"输入有效的手机号","username":"用户名","login":"登录","noAccYet":"还没有账号,","registerImmediate":"立即注册","sure":"确定","hasLooseSaftyCode":"安全码丢失?","useRecoverCode":"使用恢复代码","register":"注册","unlock":"解锁","alreadyHasAcc":"已有账号,","perfectUserInfo":"完善用户信息","man":"男","female":"女","emailLabel":"邮箱","phoneLabel":"手机号","pleaseSelectDate":"请选择日期","bindEmail":"绑定邮箱","email":"邮箱","inputFourVerifyCode":"请输入 {{length}} 位验证码","bindPhone":"绑定手机号","phoneNumber":"手机号","bind":"绑定","yes":"是","no":"否","problem":{"title":"问题反馈","noVerify":"无法收到验证码","noLogin":"无法登录","noRegister":"无法注册","noAccount":"帐号丢失","noResetPass":"无法重置密码","locked":"账号被锁定","other":"其他","noVerifyTip":{"tip":"如果无法收到手机验证码,建议你进行以下操作:","type1":"1. 检查你的手机是否停机/无网络","type2":"2. 检查你的手机号是否输入正确","type3":"3. 检查你的验证码短信是否被屏蔽"},"noLoginTip":{"type1":"1. 检查你的用户名与密码输入是否正确","type2":"2. 检查你的手机是否停机/无网络"},"noRegisterTip":{"tip":"如果无法注册,建议你进行以下操作:","type1":"1. 检查你的帐号是否已注册","type2":"2. 检查你的注册手机号是否输入正确","type3":"3. 检查你的验证码短信是否被屏蔽"},"noAccountTip":{"tip":"如果帐号丢失,建议你进行以下操作:","type1":"1. 检查你的用户名与密码输入是否正确","type2":"2. 检查你的手机是否停机/无网络"},"noResetPassTip":{"tip":"如果无法重置密码,建议你进行以下操作:","type1":"1. 检查你的手机是否停机/无网络","type2":"2. 检查你的设置的密码是否正确"},"otherTip":{},"successTip":"提交成功","successTipMsg":"你的信息已经提交给应用管理员,会尽快处理你的反馈,请你耐心等待。","form":{"phone":"联系方式","question":"相关问题","questionDescript":"问题描述","questionClip":"问题截图","submit":"提交"},"lockedTips":"如果你的账号被锁定,请联系管理员解锁后再尝试登录","noLoginTips":"如果无法登录,建议你进行以下操作:"},"backLoginPage":"返回登录","LoginSuccess":"登录成功","welcomeDoc":"欢迎加入 {{name}} ,为了更好的使用体验,请先完善你的个人信息","bindEmailDoc":"请输入邮箱进行绑定","copied":"已复制","copy":"复制","repeatPasswordDoc":"两次密码输入不一致","SMS":"短信验证码验证","EmailVerification":"电子邮箱验证","OTPVerification":"OTP 口令验证","faceVerification":"人脸识别验证","registrationSuccess":"注册成功","copyFailed":"复制失败","downloadTotpAppIOS":"IOS 下载","downloadTotpAppAndroid":"Android 下载","downloadTotpAppDocs":"请使用手机扫码下载验证器","bindTotp":"绑定 OTP","checkEmail":"该邮箱已存在","checkUserName":"该用户名已存在","checkCustomName":"该账号已存在","checkPhone":"该手机号已存在","loginFailCheck":"温馨提示:你的密码错误,还可以尝试 {{number}} 次","bindSuccess":"完成绑定","pleaseRecordKey":"请记录密钥","totpText1":"请妥善保存恢复代码","totpText2":"如果你的 MFA 丢失时,你将需要一个恢复代码","otpText1":"请前往 OTP 绑定页面进行绑定","faceText1":"绑定人脸识别","faceText2":"请打开摄像头识别人脸进行绑定","faceText3":"开始验证","faceText4":"重试一次","publicAccount":"公共账号","checkPasswordHasSpace":"不能包含空格","backToVerify":"返回验证页","usePhoneOpen":"请在手机打开 Google Authenticator 或 Microsoft Authenticator","noValidator":"没有验证器请","clickTodownload":"点击下载","mfaText1":"扫码添加 OTP,在手机查看并输入 6 位数字安全码。","backToMFA":"返回 MFA 绑定","timeoutLDAP":"请求超时,LDAP 配置错误","noQuestions":"没有问题,","goToLogin":"直接登录","passwordAgain":"请确认密码","isMissing":"{{name}}未填写","password":"密码","captchaCode":"验证码","account":"账号","phone":"手机号","pToLogin":"秒后返回登录","resetSuccess":"重置成功","resetSuccessMessage":"密码重置成功,你可以使用新密码继续登录","welcome":"欢迎访问","initPasswordText":"为了保障账号安全,请设置你的新密码。","unsafePasswordChangeText":"你的密码不符合当前密码强度要求,请设置新密码。","updatePsswordSuccess":"修改密码成功,请重新登录","fullCaptchaCode":"请填写完整的{{name}}","feedback":"问题反馈","loginProtocolTips":"请勾选登录协议","registerProtocolTips":"请勾选注册协议","accountLock":"账号被锁定,请点击下方问号进行反馈","corsErrorMessage":"当前域名不在允许访问的域名列表中。","corsErrorMessage2":"如果有疑问可以<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">参考文档</a>","totpGenerateCode":"为你生成一串新的恢复代码,请安全地记录这段密钥","verifyCodeLogin":"验证码登录","phoneCodeTab":"手机号登录","emailCodeTab":"邮箱登录","phoneVerifyCode":"短信验证码","emailVerifyCode":"邮箱验证码","phoneOrEmail":"手机号或邮箱","skip":"跳过","back":"返回","identityBindingAskTitle":"选择关联方式","identityBindingAskDesc":"如果绑定到已有账号,下次可以通过本次的方式直接登录已有账号","identityBindingCreate":"我想创建一个新账号","identityBindingBinding":"我想绑定到已有账号","identityBindingTitle":"绑定已有账号","identityBindingDesc":"绑定后,下次可以直接通过这次的方式登录到此账号","identityBindingSkipAskTitle":"账号绑定","identityBindingSkipAskDesc":"若存在已有账号,输入成功后将会完成绑定;若输入新账号则会完成创建和绑定","internationPhoneMessage":"请输入所在区号合法的手机号","areaCodePhone":"+区号 手机号","timeoutAD":"请求超时,AD 配置错误","timeout":"请求超时,请稍后重试","userNameIsExists":"该用户名已存在!","fetchError":"网络连接失败,请稍后再试","passwordUnsafeTip":"密码强度已更新,请刷新页面后重试","i18nCheckErrorMessage":"请输入所在区号合法的手机号或正确的邮箱","verifyCodeRegister":"验证码注册","PasswordRegister":"密码注册","EmailRegister":"邮箱注册","registerTab":"{{text}}注册","noFindEmail":"找不到该邮箱账号","noFindPhone":"找不到该手机账号","noFindUsername":"找不到该用户名账号","jobNumber":"工号首字母大写","loginWithWechatmpQrcodeTipsTitle":"长按二维码登录","del":"移除","qrcode":"二维码","registerCompletePasswordDesc":"为了保障账号安全,请设置你的密码。","mfaCertification":"多因素认证","emailMfaCheck":"请输入电子邮箱验证码","SmsMfaCheck":"请输入短信验证码","faceCheck":"请保持摄像头已打开并无遮挡","resetAccount":{"title":"设置用户名","message":"当前用户名不是唯一的,请重新设置用户名后才可以成功登录。"},"noTenant":"暂无已加入的租户","joinTenant":"加入租户","tenantExample":"请输入租户识别码,例如:Ljrs18wa","enter":"进入","createTenant":"创建租户","pleaseInput":"请输入","tenantName":"租户名称","tenantEmail":"租户企业邮箱域名","tenantDesc":"租户描述","visitor":"访客模式","createTenantDesc":"如需创建新租户,请点击此处","codeError":"识别码错误,请重新输入","emailVerify":"验证企业邮箱","verify":"验证","inputBusinessEmail":"请输入企业邮箱","inputCode":"请输入验证码","domainNotFound":"当前组织管理员未设置企业邮箱域名,请联系管理员设置后加入组织。"}'),Ju=JSON.parse('{"inputAccount":"请输入{{text}}","inputAdUsername":"请输入 AD 用户名","inputAdPwd":"请输入 AD 密码","inputLdapUsername":"请输入 LDAP 用户名","inputLdapPwd":"请输入 LDAP 密码","inputCaptchaCode":"请输入图形验证码","captchaCode":"图形验证码","accPwdLoginVerify":"账号登录验证","inputSixCode":"请输入绑定的 6 位数字安全码","inputLoginPwd":"请输入登录密码","inputPhone":"请输入手机号","inputEmail":"请输入邮箱","inputPwdAgain":"再输入一次密码","loginBy":"使用 {{name}} 登录","thridAccLogin":"第三方账号登录","inputRecoverCode":"请输入恢复代码","rememberedSecret":"已经安全地记录了这段密钥","mfaAfterReset":"如果你没有恢复代码,请联系管理员处理","noEmpty":"{{label}} 不能为空","inputCorrectPhone":"请输入正确的手机号或邮箱","inputPhoneOrEmail":"请输入手机号或邮箱","resetPwd":"重置密码","selfUnlock":"自助解锁","selfUnlockText":"你的账号已被锁定,请输入验证码及密码自助解锁。","pwdLogin":"密码登录","bindPwdLogin":"密码登录","appScanLogin":"移动端 APP 扫码登录","scanLogin":"扫码登录","scanAgain":"重新扫码","wechatScanLogin":"使用微信扫码登录","scanSuccess":"扫码成功","ldapLogin":"LDAP 登录","adLogin":"AD 登录","loginText":"登录","authingOtpPushLogin":"推送登录","authingOtpPushCancelLogin":"取消登录","otpLoginPendingText":"已发送请求到 Authing 令牌 APP,请在客户端确认登录","getOtpLoginRequestAgain":"登录请求已失效,请重新获取","downloadOtpVerifier":"下载验证器","loginToMobileClient":"登录移动端","scanQrCode":"扫描二维码","setAuthingTokenVerify":"设置 Authing 令牌 Verify","phoneScanCodeAndDownloadAuthingToken":"请用手机扫码或前往应用市场下载 Authing 令牌","noPrompt":"以后不再提示","directLogin":"直接登录","openAuthingOtp":"打开 Authing 令牌,点击“登录/注册”","clickAndScanQrcode":"点击“登录应用”页面右上角的扫码入口,扫描下方二维码","downloadIOS":"iOS下载","downloadAndroid":"安卓下载","howBindClient":"如何绑定客户端应用","installAuthingToken":"安装 Authing 令牌","downloadAuthingToken":"请使用手机扫码或前往应用市场下载 Authing 令牌","openAppList":"打开应用列表","addApp":"打开\\"应用列表\\",点击\\"添加应用\\"","openLoginPage":"打开登录页","scanQrcode":"点击\\"扫描二维码\\"按钮扫描应用二维码","scanFollowingQrcode":"扫描以下应用二维码","relevanceApp":"关联应用并登录账号","receiveMessageFromAuthingToken":"登录应用账号后即可在 Authing 令牌接收 Web 应用推送完成登录","howUsePushLogin":"如何使用推送登录","inputAccountInWeb":"在 Web 端登录面板输入账号信息","clickLoginButton":"点击\\"登录\\"","receiveMessageInApp":"在已绑定的移动端应用上接收登录推送","confirmLoginInApp":"确认“登录”,即可成功登录 Web 端。","howGetAppLoginUrl":"如何获取应用登录地址","getCodeFromAdmin":"从管理员处获取关联应用二维码","getCodeFromAdminTips":"管理员可在应用登录控制中得到应用二维码,扫描二维码即可登录对应应用。","getCodeFromPersonalCenter":"从个人中心获取应用二维码","getCodeFromPersonalCenterTips":"用户可在\\"个人中心 - 快速认证\\"保存应用登录二维码,使用 Authing 令牌扫码后选择应用即可登录。","getLoginUrlFromConsole":"管理员从控制台取得登录地址","getLoginUrlFromConsoleTips":"管理员可在「控制台 - 应用详情 - 应用配置 - 认证配置」复制认证地址,用户复制认证地址后即可登录和绑定。","nextStep":"下一步","enterAccount":"请输入账号","verifyCodeSended":"验证码已发送至","inputEmailCode":"请输入邮箱验证码","otherVerifyWay":"其他验证方式","otherLoginWay":"其他登录方式","clickSent":"点击发送验证码","reSent":"点击重发验证码","bindPhoneInfo":"请输入手机号进行绑定","inputPhoneCode":"请输入手机验证码","forgetPwd":"忘记密码","inputPwd":"请输入密码","setPwdLimit1":"设置至少 6 位字符密码","login":{"setPwdLimit2":"至少六位,需包含英文、数字与符号中的两种","setPwdLimit3":"至少六位,需包含英文、数字与符号"},"setPwdLimitMsg1":"密码长度至少为 6 位","setPwdLimitMsg2":"密码长度至少为 6 位,且要包含英文、数字与符号中的两种","setPwdLimitMsg3":"密码长度至少为 6 位,且要同时包含英文、数字与符号","wechatmpQrcode":"公众号关注登录","inputUsername":"请输入用户名","moreWays":"更多登录","inputCorrectPhoneOrEmail":"请输入有效的手机号或邮箱","sendCodeTimeout":"发送失败,请稍后尝试","mediaDevicesSupport":"当前设备暂不支持人脸识别","qrcodeNetWorkError":"网络异常 点击重试","qrcodeRefer":"刷新","noLoginMethodsDesc":"未配置登录方式","socialConnectionMessage":"不支持使用{{provider}}登录,请选择其他方式登录,或在其它浏览器中重试","inputNewPwd":"请输入新密码","selectLoginAccount":"选择登录账号","useOtherAccount":"使用其他账号","tenant":{"consoleManage":"管理员控制台","ssoPad":"单点登录应用面板"},"AuthorizationCamera":"请先开启授权","checkPreferences":"请检查偏好设置","requireError":"无法满足要求错误","hardwareSupport":"硬件不支持","verifyCodeTip":"看不清?换一张","loginWithPasskey":"使用 Passkey 登录","resetPassword":{"pleaseInputPassword":"请输入密码","checkPasswordDiff":"请输入一致的密码","nextStep":"下一步","reset":"重置密码","back":"返回","resetPasswordText1":"请输入你注册的手机号/邮箱用于接收验证码,我们将为你重置密码。","resetPasswordText2":"你正在重置 {{account}} 的密码。","input":"输入{{text}}","inputFourVerifyCode":"请输入 {{length}} 位验证码","inputNewPwd":"请输入新密码","confirmNewPwd":"请确认新密码","successTipMsg":"你可以使用新密码继续登录","successTip":"密码重置成功","backLogin":"秒后将自动跳转登录页"},"wecomScanLogin":"企业微信扫码登录"}'),Qu=JSON.parse('{"numberSafteyCode":"数字安全码","mfaBind":"MFA 绑定","nextStep":"下一步","inputCurrPwd":"请输入当前密码","inputNewPwd":"请输入新密码","inputOldPwd":"请输入原登录密码","modifyPwd":"修改密码","modifyPwdText":"你的密码连续使用超过 {{number}} 个月,可能存在风险。请重新设置密码。","modifyNoticePwdText":"你的密码连续使用超过 {{number}} 个月,即将过期,为了不影响你的使用,请设置新密码","error":"错误信息","contactAdministrator":"未知的错误~ 请你联系管理员进行处理","resetpasswordText1":"输入你的注册电话/邮箱,输入收到的验证码,我们将为你进行密码重置。","unlockTip":"若解锁遇到问题,请点"}'),Zu=JSON.parse('{"EmailVerification":"電子郵件驗證","LoginSuccess":"登入成功","OTPVerification":"OTP 口令驗證","PasswordRegister":"密碼註冊","EmailRegister":"電子郵件註冊","registerTab":"{{text}}註冊","SMS":"短信驗證碼驗證","account":"賬號","accountLock":"賬號被鎖定,請點擊下方問號進行反饋","alreadyHasAcc":"已有賬號,","areaCodePhone":"區號 手機號碼","back":"返回","backLoginPage":"返回登入","backToMFA":"返回 MFA 綁定","backToVerify":"返回驗證頁","bind":"綁定","bindEmail":"綁定電子郵件","bindEmailDoc":"請輸入電子郵件進行綁定","bindPhone":"綁定手機號碼","bindSuccess":"完成綁定","bindTotp":"綁定 OTP","captchaCode":"驗證碼","checkEmail":"該電子郵件已存在","checkPasswordHasSpace":"不能包含空格","checkPhone":"該手機號碼已存在","checkUserName":"該用戶名已存在","checkCustomName":"該帳號已存在","clickTodownload":"點擊下載","confirm":"確認","copied":"已復制","copy":"複製","copyFailed":"複製失敗","corsErrorMessage":"當前域名不在允許訪問的域名列表中。","corsErrorMessage2":"如果有疑問可以<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">參考文檔</a>","downloadTotpAppAndroid":"Android 下載","downloadTotpAppDocs":"請使用手機掃碼下載驗證器","downloadTotpAppIOS":"IOS 下載","email":"電子郵件","emailFormatError":"請輸入有效的電子郵件","emailLabel":"電子郵件","emailVerifyCode":"電子郵件驗證碼","faceText1":"綁定人臉識別","faceText2":"請打開攝像頭識別人臉進行綁定","faceText3":"開始驗證","faceText4":"重試一次","faceVerification":"人臉識別驗證","feedback":"幫助中心","female":"女","fetchError":"網路連接失敗,請稍後再試","fullCaptchaCode":"請填寫完整的{{name}}","goToLogin":"直接登入","hasLooseSaftyCode":"安全碼丟失?","i18nCheckErrorMessage":"請輸入所在區號合法的手機號或正確的郵箱","identityBindingAskDesc":"如果綁定到已有賬號,下次可以通過本次的方式直接登入已有賬號","identityBindingAskTitle":"選擇關聯方式","identityBindingBinding":"我想綁定到已有賬號","identityBindingCreate":"我想創建一個新賬號","identityBindingDesc":"綁定後,下次可以直接通過這次的方式登入到此賬號","identityBindingTitle":"綁定已有賬號","identityBindingSkipAskTitle":"帳號綁定","identityBindingSkipAskDesc":"若存在已有帳號,輸入成功後將會完成綁定; 若輸入新帳號則會完成創建和綁定","initPasswordText":"為了保障賬號安全,請設置您的新密碼。","inputFourVerifyCode":"請輸入 {{length}} 位數驗證碼","internationPhoneMessage":"請輸入所在區號合法的手機號碼","isMissing":"{{name}}未填寫","jobNumber":"工號首字母大寫","login":"登入","loginFailCheck":"溫馨提示:您的密碼錯誤,還可以嘗試 {{number}} 次","loginProtocolTips":"請勾選登入協議","man":"男","mfaText1":"掃碼添加 OTP,在手機查看並輸入 6 位數字安全碼。","no":"否","noAccYet":"還沒有賬號,","noFindEmail":"找不到該電子郵件","noFindPhone":"找不到該手機賬號","noFindUsername":"找不到該用戶名賬號","noQuestions":"沒有問題,","noValidator":"沒有驗證器請","otpText1":"請前往 OTP 綁定頁面進行綁定","pToLogin":"秒後返回","password":"密碼","passwordAgain":"請確認密碼","publicAccount":"公共帳戶","passwordUnsafeTip":"密碼強度已更新,請刷新頁面後重試","perfectUserInfo":"個人資訊","phone":"手機號碼","phoneFormateError":"輸入有效的手機號碼","phoneLabel":"手機號碼","phoneNumber":"手機號碼","phoneOrEmail":"手機號碼或電子郵件","phoneVerifyCode":"短信驗證碼","pleaseRecordKey":"請記錄密鑰","pleaseSelectDate":"請選擇日期","problem":{"form":{"phone":"聯絡方式","question":"相關問題","questionClip":"截圖","questionDescript":"問題描述","submit":"提交"},"locked":"帳號被鎖住","lockedTips":"如果您的帳號被鎖定,請聯繫管理員解鎖後再嘗試登入","noAccount":"帳號遺失","noAccountTip":{"tip":"如果帳號丟失,建議您進行以下操作:","type1":"1. 檢查您的帳號與密碼是否正確輸入","type2":"2. 檢查您的手機服務是否停用 / 沒有網路"},"noLogin":"無法登入","noLoginTip":{"type1":"1. 檢查您的帳號與密碼是否正確輸入","type2":"2. 檢查您的手機服務是否停用 / 沒有網路"},"noLoginTips":"如果無法登入,建議您進行以下操作:","noRegister":"無法註冊","noRegisterTip":{"tip":"如果無法註冊,建議您進行以下操作:","type1":"1. 檢查您的帳號是否已註冊","type2":"2. 檢查您的註冊手機號碼是否正確輸入","type3":"3. 檢查您的驗證碼簡訊是否被阻擋"},"noResetPass":"無法重設密碼","noResetPassTip":{"tip":"如果無法重設密碼,建議您進行以下操作:","type1":"1. 檢查您的手機服務是否停用 / 沒有網路","type2":"2. 檢查您設定的密碼是否正確"},"noVerify":"無法收到驗證碼","noVerifyTip":{"tip":"如果無法收到手機驗證碼,建議您進行以下操作:","type1":"1. 檢查您的手機服務是否停用 / 沒有網路","type2":"2. 檢查您的手機號碼是否輸入正確","type3":"3. 檢查您的驗證碼簡訊是否被阻擋"},"other":"其他","successTip":"提交成功","successTipMsg":"您的信息已經提交給應用管理員,會盡快處理您的反饋,請您耐心等待。","title":"問題回報"},"register":"註冊","registerImmediate":"立即註冊","registerProtocolTips":"請勾選註冊協議","registrationSuccess":"註冊成功","repeatPasswordDoc":"兩次密碼輸入不一致","resetSuccess":"重設密碼","resetSuccessMessage":"密碼重設成功,請使用新密碼登入","retryAfterTime":"{{time}} 秒","sendVerifyCode":"發送驗證碼","skip":"跳過","sure":"確定","timeout":"請求超時,請稍後重試","timeoutAD":"請求超時,AD 配置錯誤","timeoutLDAP":"請求超時,LDAP 配置錯誤","totpGenerateCode":"為您生成一串新的恢復代碼,請安全地記錄這段密鑰","totpText1":"請妥善保存恢復代碼","totpText2":"如果您的 MFA 丟失時,您將需要一個恢復代碼","unlock":"解鎖","unsafePasswordChangeText":"您的密碼不符合當前密碼強度要求,請設置新密碼。","updatePsswordSuccess":"修改密碼成功,請重新登入","uploadFail":"{{name}} 上傳失敗","usePhoneOpen":"請在手機打開 Google Authenticator 或 Microsoft Authenticator","useRecoverCode":"使用恢復代碼","userNameIsExists":"該用戶名已存在!","username":"用戶名","usernameFormatError":"輸入有效的用戶名","customNameFormatError":"輸入有效的帳號","verifyCodeLogin":"驗證碼登入","phoneCodeTab":"手機號登錄","emailCodeTab":"郵箱登錄","verifyCodeRegister":"驗證碼註冊","welcome":"歡迎訪問","welcomeDoc":"歡迎加入 {{name}} ,為了提供最佳的線上體驗,請填寫您的個人資訊","yes":"是","loginWithWechatmpQrcodeTipsTitle":"長按二維碼登入","del":"移除","qrcode":"二維碼","registerCompletePasswordDesc":"為了保障賬號安全,請設置您的密碼。","mfaCertification":"多因素認證","emailMfaCheck":"請輸入電子郵箱驗證碼","SmsMfaCheck":"請輸入短信驗證碼","faceCheck":"請保持攝像頭已打開並無遮擋","resetAccount":{"title":"設定用戶名","message":"當前用戶名不是唯一的,請重新設定用戶名後才可以成功登入。"},"noTenant":"暫無已加入的租戶","joinTenant":"加入租戶","tenantExample":"請輸入租戶識別碼,例如:Ljrs18wa","enter":"進入","createTenant":"創建租戶","pleaseInput":"請輸入","tenantName":"租戶名稱","tenantEmail":"租戶企業郵箱功能變數名稱","tenantDesc":"租戶描述","visitor":"訪客模式","createTenantDesc":"如需創建新租戶,請點擊此處","codeError":"識別碼錯誤,請重新輸入","emailVerify":"驗證企業郵箱","verify":"驗證","inputBusinessEmail":"請輸入企業郵箱","inputCode":"請輸入驗證碼","domainNotFound":"當前組織管理員未設定企業郵箱功能變數名稱,請聯系管理員設定後加入組織。"}'),Xu=JSON.parse('{"accPwdLoginVerify":"賬號登入驗證","adLogin":"AD 登入","authingOtpPushLogin":"推送登錄","authingOtpPushCancelLogin":"取消登錄","loginText":"登録","otpLoginPendingText":"已發送請求到Authing權杖APP,請在用戶端確認登入","getOtpLoginRequestAgain":"登錄請求已失效,請重新獲取","downloadOtpVerifier":"下載驗證器","loginToMobileClient":"登錄移動端","scanQrCode":"掃描二維碼","setAuthingTokenVerify":"設定Authing權杖Verify","phoneScanCodeAndDownloadAuthingToken":"请用手机扫码或前往应用市场下载 Authing 令牌","noPrompt":"以後不再提示","directLogin":"直接登錄","openAuthingOtp":"打開Authing權杖,點擊“登入/注册”","clickAndScanQrcode":"點擊“登入應用”頁面右上角的掃碼入口,掃描下方二維碼","downloadIOS":"iOS下載","downloadAndroid":"安卓下載","howBindClient":"如何綁定用戶端應?","installAuthingToken":"安裝Authing權杖","downloadAuthingToken":"請使用手機掃碼或前往應用市場下載Authing權杖","openAppList":"打開應用清單","addApp":"打開“應用清單”,點擊“添加應用”","openLoginPage":"打開登入頁","scanQrcode":"點擊“掃描二維碼”按鈕掃描應用二維碼","scanFollowingQrcode":"掃描以下應用二維碼","relevanceApp":"關聯應用並登入帳號","receiveMessageFromAuthingToken":"登录应用账号后即可在 Authing 令牌接收 Web 应用推送完成登录","howUsePushLogin":"如何使用推送登入","inputAccountInWeb":"在Web端登入面板輸入帳號資訊","clickLoginButton":"點擊\\"登入\\"","receiveMessageInApp":"在已綁定的移動端應用上接收登入推送","confirmLoginInApp":"確認“登入”,即可成功登入Web端。","howGetAppLoginUrl":"如何獲取應用登入地址","getCodeFromAdmin":"從管理員處獲取關聯應用二維碼","getCodeFromAdminTips":"管理員可在應用登入控制中得到應用二維碼,掃描二維碼即可登入對應應用。","getCodeFromPersonalCenter":"從個人中心獲取應用二維碼","getCodeFromPersonalCenterTips":"用戶可在“個人中心-快速認證”保存應用登入二維碼,使用Authing權杖掃碼後選擇應用即可登入。","getLoginUrlFromConsole":"管理員從控制台取得登入地址","getLoginUrlFromConsoleTips":"管理員可在「控制台-應用詳情-應用配寘-認證配寘」複製認證地址,用戶複製認證地址後即可登入和綁定。","nextStep":"下一步","enterAccount":"請輸入帳號","appScanLogin":"移動端 APP 掃碼登入","bindPhoneInfo":"請輸入手機號碼進行綁定","captchaCode":"圖形驗證碼","clickSent":"點擊發送驗證碼","reSent":"點擊重發驗證碼","forgetPwd":"忘記密碼","inputAccount":"請輸入{{text}}","inputAdPwd":"請輸入 AD 密碼","inputAdUsername":"請輸入 AD 用戶名","inputCaptchaCode":"請輸入圖形驗證碼","inputCorrectPhone":"請輸入正確的手機號碼或電子郵件","inputCorrectPhoneOrEmail":"請輸入有效的手機號碼或電子郵件","inputEmail":"請輸入電子郵件","inputEmailCode":"請輸入電子郵件驗證碼","inputLdapPwd":"請輸入 LDAP 密碼","inputLdapUsername":"請輸入 LDAP 用戶名","inputLoginPwd":"請輸入密碼","inputNewPwd":"請輸入新密碼","inputPhone":"請輸入手機號碼","inputPhoneCode":"請輸入手機驗證碼","inputPhoneOrEmail":"請輸入手機號碼或電子郵件","inputPwd":"請輸入密碼","inputPwdAgain":"再輸入一次密碼","inputRecoverCode":"請輸入恢復代碼","inputSixCode":"請輸入綁定的 6 位數字安全碼","inputUsername":"請輸入用戶名","ldapLogin":"LDAP 登入","login":{"setPwdLimit2":"至少六位,需包含英文、數字與符號中的兩種","setPwdLimit3":"至少六位,需包含英文、數字與符號"},"loginBy":"使用 {{name}} 登入","mediaDevicesSupport":"當前設備暫不支持人臉識別","mfaAfterReset":"如果您沒有恢復代碼,請聯繫管理員處理","moreWays":"更多登入","noEmpty":"請填入 {{label}}","noLoginMethodsDesc":"未配置登入方式","otherLoginWay":"其他登入方式","otherVerifyWay":"其他驗證方式","pwdLogin":"帳號","bindPwdLogin":"帳號","rememberedSecret":"已經安全地記錄了這段密鑰","resetPwd":"重設密碼","scanLogin":"掃碼登入","selfUnlock":"自助解鎖","selfUnlockText":"您的賬號已被鎖定,請輸入驗證碼及密碼自助解鎖。","sendCodeTimeout":"發送失敗,請稍後嘗試","setPwdLimit1":"設置至少 6 位字符密碼","setPwdLimitMsg1":"密碼長度至少為 6 位","setPwdLimitMsg2":"密碼長度至少為 6 位,且要包含英文、數字與符號中的兩種","setPwdLimitMsg3":"密碼長度至少為 6 位,且要同時包含英文、數字與符號","socialConnectionMessage":"不支持使用{{provider}}登入,請選擇其他方式登入,或在其它瀏覽器中重試","thridAccLogin":"第三方帳號登入","verifyCodeSended":"驗證碼已發送至","wechatmpQrcode":"公眾號關注登入","selectLoginAccount":"選擇登入賬號","useOtherAccount":"使用其他賬號","wechatScanLogin":"使用微信掃碼登錄","qrcodeRefer":"刷新","qrcodeNetWorkError":"網路異常 點擊重試","scanAgain":"重新掃碼","scanSuccess":"掃碼成功","tenant":{"consoleManage":"管理員控制台","ssoPad":"單點登錄應用面板"},"AuthorizationCamera":"請先開啟授權","checkPreferences":"請檢查偏好設置","requireError":"無法滿足要求錯誤","hardwareSupport":"硬件不支持","verifyCodeTip":"看不清?換一張","loginWithPasskey":"使用 Passkey 登入","resetPassword":{"pleaseInputPassword":"請輸入密碼","checkPasswordDiff":"請輸入一致的密碼","nextStep":"下一步","reset":"重置密碼","back":"返回","resetPasswordText1":"請輸入你注册的手機號/郵箱用於接收驗證碼,我們將為你重置密碼。","resetPasswordText2":"你正在重置 {{account}} 的密碼。","input":"輸入{{text}}","inputFourVerifyCode":"請輸入 {{length}} 位數驗證碼","inputNewPwd":"請輸入新密碼","confirmNewPwd":"請確認新密碼","successTipMsg":"你可以使用新密碼繼續登入","successTip":"密碼重置成功","backLogin":"秒後將自動跳轉登入頁"},"wecomScanLogin":"企業微信掃碼登入"}'),ed=JSON.parse('{"contactAdministrator":"未知的錯誤~ 請您聯繫管理員進行處理","error":"錯誤信息","inputCurrPwd":"請輸入當前密碼","inputNewPwd":"請輸入新密碼","inputOldPwd":"請輸入原登入密碼","mfaBind":"MFA 綁定","modifyNoticePwdText":"您的密碼連續使用超過 {{number}} 個月,即將過期,為了不影響您的使用,請設置新密碼","modifyPwd":"修改密碼","modifyPwdText":"您的密碼連續使用超過 {{number}} 個月,可能存在風險。\\n請重新設置密碼。","nextStep":"下一步","numberSafteyCode":"數字安全碼","resetpasswordText1":"請輸入您的註冊電子郵件 / 手機號碼,以及收到的驗證碼,我們將為您進行密碼重設。","unlockTip":"若解鎖遇到問題,請點"}'),td=JSON.parse('{"guidance":{},"uploadFail":"{{name}} アップロード失敗","confirm":"確認","retryAfterTime":"{{time}} 秒","sendVerifyCode":"認証コードを送信します","emailFormatError":"有効なメールアドレスをご入力ください","usernameFormatError":"有効なユーザー名を入力する","customNameFormatError":"有効なアカウントを入力","phoneFormateError":"有効な携帯番号を入力する","username":"ユーザー名","login":"ログイン","noAccYet":"アカウントがないので,","registerImmediate":"すぐに登録します","sure":"確定","hasLooseSaftyCode":"セキュリティコードの紛失?","useRecoverCode":"復旧コードを使って","register":"登録","unlock":"ロック","alreadyHasAcc":"すでにアカウントがある,","perfectUserInfo":"プロフィール充実","publicAccount":"パブリックアカウント","man":"男","female":"女","emailLabel":"メールアドレス","phoneLabel":"携帯電話番号","pleaseSelectDate":"日付を選んでください","bindEmail":"メールボックスを結びつける","email":"メールアドレス","inputFourVerifyCode":"{{length}}桁の認証コードをご入力ください","bindPhone":"携帯電話番号を結びつける","phoneNumber":"携帯電話","bind":"据え置き","yes":"は","no":"いいえ","problem":{"title":"ヘルプ・お問い合わせ","noVerify":"認証コードが届きません","noLogin":"ログインできません","noRegister":"登録できません","noAccount":"アカウントをお忘れ","noResetPass":"パスワードのリセットができません","locked":"アカウントがロックされました","other":"その他","noVerifyTip":{"tip":"認証コードのSMSが届かない原因としては以下の事象等が考えられます。","type1":"1. 通信状況が不安定 /モバイル通信ができない状態","type2":"2. 電話番号の入力間違い","type3":"3. SMSの受信の制限"},"noLoginTip":{"type1":"1. アカウントとパスワードの入力が正しいかどうかチェックします。","type2":"2. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。"},"noRegisterTip":{"tip":"ログインできない場合は、以下の操作をお勧めします。","type1":"1. すでにアカウント登録済みとなっているかどうかチェックします。","type2":"2. 携帯電話番号が正しく入力しているかどうかチェックします。","type3":"3. 認証コードのSMSがブロックされているかどうかチェックします。"},"noAccountTip":{"tip":"アカウントが紛失した場合は、以下の操作をお勧めします。","type1":"1. アカウントとパスワードの入力が正しいかどうかチェックします。","type2":"2. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。"},"noResetPassTip":{"tip":"パスワードをリセットできない場合は、以下の操作をお勧めします。","type1":"1. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。","type2":"2. 設定したパスワードが正しいかどうかチェックします。"},"otherTip":{},"successTip":"提出に成功する","successTipMsg":"あなたの情報はアプリケーション管理者に提出されており、フィードバックはすぐに処理されますので、お待ちください。","form":{"phone":"連絡方法","question":"ご用件","questionDescript":"お問い合わせ内容","questionClip":"スクリーンショット","submit":"提出"},"lockedTips":"アカウントがロックされた場合は、管理者にご連絡頂き、ロック解除された後もう一度ログインするようお願い致します。","noLoginTips":"ログインできない場合は、以下の操作をお勧めします。"},"backLoginPage":"ログイン画面に戻ります","LoginSuccess":"ログインに成功する","welcomeDoc":"{{name}}へようこそ、より良い使用体験をご提供できるよう個人情報のご記入をお願い致します。","bindEmailDoc":"メールアドレスを入力して結びつけてください","copied":"複製済み","copy":"コピー","repeatPasswordDoc":"2回のパスワード入力が一致しません","SMS":"sms認証","EmailVerification":"電子メール認証","OTPVerification":"OTP パスワード検証","faceVerification":"顔認証認証","registrationSuccess":"登録に成功する","copyFailed":"コピー失敗","downloadTotpAppIOS":"IOS のダウンロード","downloadTotpAppAndroid":"Android ダウンロード","downloadTotpAppDocs":"携帯電話のコードを使って検証をダウンロードしてください","bindTotp":"バインディング OTP","checkEmail":"メールボックスはすでに存在しています","checkUserName":"ユーザ名はすでに存在する","checkCustomName":"このアカウントは既に存在します","checkPhone":"携帯電話番号はすでに存在しています","loginFailCheck":"暖かい提示:あなたのパスワードは間違って、また試みることができます {{number}} 回","bindSuccess":"バインディング完了","pleaseRecordKey":"鍵を記録してください","totpText1":"回復コードを適切に保存してください","totpText2":"MFA が紛失した場合復旧コードが必要になります","otpText1":"バインドするには OTP バインド ページに移動してください","faceText1":"顔認証を結びつける","faceText2":"バインドする顔を認識するためにカメラをオンにしてください","faceText3":"検証を開始する","faceText4":"もう一度やってみる","checkPasswordHasSpace":"フレームを含まない","backToVerify":"検証ページに戻る","usePhoneOpen":"携帯で Google Authenticator または Microsoft Authenticator を開いてください","noValidator":"ベリファイアなしで","clickTodownload":"クリックしてダウンロードする","mfaText1":"OTP を追加して、携帯電話で調べて 6 桁の数字の安全なコードを入力します。","backToMFA":"MFA バインディングを戻す","timeoutLDAP":"要求タイムアウト、LDAP構成エラー","noQuestions":"問題がなく、","goToLogin":"直接にログインします","passwordAgain":"パスワードを確認してください","isMissing":"{{name}}が未入力です","password":"パスワード","captchaCode":"認証コード","account":"アカウント","phone":"携帯電話番号","pToLogin":"秒後に、ログイン画面に戻ります","resetSuccess":"リセットが完了しました","resetSuccessMessage":"パスワードのリセットが完了しました。新しいパスワードにて再ログインしてください。","welcome":"訪問を歓迎する","initPasswordText":"アカウントを安全に保つために、新しいパスワードを設定してください。","unsafePasswordChangeText":"あなたのパスワードは現在のパスワード強度の要件を満たしていません。新しいパスワードを設定してください。","updatePsswordSuccess":"パスワードの変更に成功しましたので、再ログインしてください","fullCaptchaCode":"{{name}}を記入してください","feedback":"ヘルプ・お問い合わせ","loginProtocolTips":"ログインプロトコルにチェックを入れてください","registerProtocolTips":"登録プロトコルにチェックを入れてください","accountLock":"アカウントがロックされたら、下の疑問符をクリックしてフィードバックしてください","corsErrorMessage":"現在のドメイン名はアクセスが許可されているドメイン名のリストには含まれていない。","corsErrorMessage2":"質問があれば<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">ドキュメント参照</a>","totpGenerateCode":"この鍵を安全に記録してください","verifyCodeLogin":"認証コード登録","phoneCodeTab":"携帯電話番号でのログイン","emailCodeTab":"電子メールでのログイン","phoneVerifyCode":"sms認証コード","emailVerifyCode":"メールボックス認証コード","phoneOrEmail":"携帯電話/メールアドレス","skip":"飛び越え","back":"戻る","identityBindingAskTitle":"つながり方を選ぶ","identityBindingAskDesc":"既存アカウントに紐付いている場合は、今回の方法で直接既存アカウントにログインすることができます。","identityBindingCreate":"新しいアカウントを作りたいのですが","identityBindingBinding":"既存のアカウントと結びつけたい","identityBindingTitle":"既存のアカウントを結びつける","identityBindingDesc":"紐付け后、次回から直接今回の方法でこのアカウントにログインすることができます","identityBindingSkipAskTitle":"アカウントのバインド","identityBindingSkipAskDesc":"既存のアカウントが存在する場合は、入力に成功するとバインドが完了します。新規アカウントを入力すると作成とバインドが完了します","internationPhoneMessage":"合法的な局番の携帯番号を入力してください","areaCodePhone":"+局番付き携帯番号","timeoutAD":"要求タイムアウト、AD設定ミス","timeout":"タイムアウトをお願いしますので,後ほど再試行してください","userNameIsExists":"このユーザー名はすでに存在します!","fetchError":"ネットワーク接続に失敗した場合は後ほどお試しください","passwordUnsafeTip":"パスワードが更新されましたので、ページを更新して再試行してください","i18nCheckErrorMessage":"地域番号の合法的な携帯電話番号または正しいメールアドレスを入力してください","verifyCodeRegister":"認証コード登録","EmailRegister":"Eメール登録","registerTab":"{{text}}登録","PasswordRegister":"アカウント登録","noFindEmail":"該当メールアドレスが見つかりません","noFindPhone":"携帯電話のアカウントが見つかりません","noFindUsername":"該当ユーザー名アカウントが見つからない","jobNumber":"工番の頭文字を大文字にする","loginWithWechatmpQrcodeTipsTitle":"qrコードを長押しして登録する","del":"除去","qrcode":"qrコード","registerCompletePasswordDesc":"アカウントを安全に保つために、パスワードを設定してください。","mfaCertification":"多要素認証","emailMfaCheck":"メール認証コードを入力してください","SmsMfaCheck":"SMS認証コードを入力してください","faceCheck":"カメラの電源を入れ、遮るものがない状態にしてください","resetAccount":{"title":"ユーザー名の設定","message":"現在のユーザー名は一つではありません。ユーザー名を再設定してからログインできます。"},"noTenant":"未加入のテナントは現在存在しません","joinTenant":"テナントへの参加","tenantExample":"テナント識別コードを入力してください(例:Ljrs18wa)","enter":"に入る","createTenant":"テナントの作成","pleaseInput":"入力してください","tenantName":"租户テナント名名称","tenantEmail":"テナント企業メールアドレスドメイン","tenantDesc":"テナントの説明","visitor":"ゲストモード","createTenantDesc":"新規テナントを作成するには、こちらをクリックしてください","codeError":"識別コードエラー、再入力してください","emailVerify":"エンタープライズメールボックスの検証","verify":"検証","inputBusinessEmail":"エンタープライズメールアドレスを入力してください","inputCode":"認証コードを入力してください","domainNotFound":"現在の組織管理者はエンタープライズメールアドレスのドメイン名を設定していません。管理者に連絡して設定してから組織に参加してください。"}'),nd=JSON.parse('{"inputAccount":"{{text}}をご入力ください","inputAdUsername":"AD ユーザー名を入力してください","inputAdPwd":"AD パスワードを入力してください","inputLdapUsername":"LDAP ユーザ名を入力してください","inputLdapPwd":"LDAP パスワードを入力してください","inputCaptchaCode":"図形認証コードを入力してください","captchaCode":"グラフィックス認証コード","accPwdLoginVerify":"アカウント登録検証","inputSixCode":"バインドされた 6 桁のセキュリティ コードを入力してください","inputLoginPwd":"パスワードをご入力ください","inputPhone":"携帯番号を入力してください","inputEmail":"メールアドレスをご入力ください","inputPwdAgain":"もう一度パスワードを入力する","loginBy":"{{name}}を使ってログインする","thridAccLogin":"第三者アカウントのログイン","inputRecoverCode":"復旧コードを入力してください","rememberedSecret":"鍵は安全に記録されています","mfaAfterReset":"復旧コードがない場合は管理者に連絡してください","noEmpty":"{{label}}が未入力です","inputCorrectPhone":"メールアドレス/携帯電話を正しくご入力ください","inputPhoneOrEmail":"携帯番号またはメールアドレスをご入力ください","resetPwd":"パスワードをリセット","selfUnlock":"セルフロック","selfUnlockText":"あなたのアカウントはロックされています。認証コードとパスワードを入力してセルフロックを解除してください。","pwdLogin":"既にアカウントをお持ち","bindPwdLogin":"アカウントログイン","appScanLogin":"モバイルアプリでコード登録","scanLogin":"コード登録","scanAgain":"コードを掃き直す","wechatScanLogin":"wechatのコードを使ってログインする","scanSuccess":"コード掃きに成功する","ldapLogin":"LDAP ログイン","adLogin":"AD 登録","authingOtpPushLogin":"プッシュ登録","authingOtpPushCancelLogin":"登録をキャンセルする","loginText":"登録","otpLoginPendingText":"AuthingトークンAPPにリクエストを送信しました。クライアントでログインを確認してください","getOtpLoginRequestAgain":"ログイン要求は無効になりましたので、再取得してください","downloadOtpVerifier":"ベリファイアのダウンロード","loginToMobileClient":"モバイル端末へのログイン","scanQrCode":"スキャン2次元コード","setAuthingTokenVerify":"AuthingトークンVerifyの設定","phoneScanCodeAndDownloadAuthingToken":"携帯電話でコードをスキャンするか、アプリケーション市場に行ってAuthingトークンをダウンロードしてください","noPrompt":"後でプロンプトしない","directLogin":"直接ログイン","openAuthingOtp":"Authingトークンを開き、「ログイン/登録」をクリックします","clickAndScanQrcode":"「ログインアプリケーション」ページの右上にあるスキャンコードの入り口をクリックし、下のQRコードをスキャンします","downloadIOS":"iOSダウンロード","downloadAndroid":"Androidダウンロード","howBindClient":"クライアントアプリケーションをバインドする方法","installAuthingToken":"Authingトークンのインストール","downloadAuthingToken":"携帯電話でコードをスキャンするか、アプリケーション市場に行ってAuthingトークンをダウンロードしてください","openAppList":"アプリケーションリストを開く","addApp":"「アプリケーションリスト」を開き、「アプリケーションの追加」をクリックします","openLoginPage":"ログインページを開く","scanQrcode":"「QRコードをスキャン」ボタンをクリックしてQRコードをスキャンして適用する","scanFollowingQrcode":"スキャン以下にQRコードを適用","relevanceApp":"アプリケーションを関連付けてアカウントにログインする","receiveMessageFromAuthingToken":"アプリケーションアカウントにログインすると、AuthingトークンでWebアプリケーションのプッシュを受信してログインを完了することができます","howUsePushLogin":"プッシュログインの使用方法","inputAccountInWeb":"Webログインパネルにアカウント情報を入力する","clickLoginButton":"「ログイン」をクリック","receiveMessageInApp":"バインドされたモバイル端末アプリケーションへのログインプッシュの受信","confirmLoginInApp":"「ログイン」を確認すると、Web側に正常にログインできます。","howGetAppLoginUrl":"アプリケーションログインアドレスを取得する方法","getCodeFromAdmin":"管理者から関連アプリケーションのQRコードを取得する","getCodeFromAdminTips":"管理者はアプリケーションログイン制御に二次元コードを適用することができ、二次元コードをスキャンすれば対応するアプリケーションにログインすることができる。","getCodeFromPersonalCenter":"パーソナルセンターからアプリケーションQRコードを取得する","getCodeFromPersonalCenterTips":"ユーザーは「パーソナルセンター-クイック認証」保存アプリケーションに二次元コードを登録し、Authingトークンを使用してコードをスキャンした後、アプリケーションを選択することでログインすることができます","getLoginUrlFromConsole":"管理者はコンソールからログインアドレスを取得する","getLoginUrlFromConsoleTips":"管理者は、コンソール-アプリケーション詳細-アプリケーション構成-認証構成で認証アドレスをコピーでき、ユーザーは認証アドレスをコピーするとログインとバインドできます。","nextStep":"次のステップ","enterAccount":"アカウントを入力してください","verifyCodeSended":"認証コードが送信され","inputEmailCode":"メールアドレス認証を入力してください","otherVerifyWay":"その他の検証方法","otherLoginWay":"その他の登録方法","clickSent":"認証コードの送信をクリックする","reSent":"認証コードの再送をクリックしてください","bindPhoneInfo":"携帯番号を入力して結びつけてください","inputPhoneCode":"携帯認証コードを入力してください","forgetPwd":"パスワードをお忘れの場合","inputPwd":"パスワードを入力してください","setPwdLimit1":"最低 6 ビットの文字パスワードを設定する","login":{"setPwdLimit2":"少なくとも6桁で、英数字と記号のうち2種類を含むこと","setPwdLimit3":"少なくとも6桁の英数字および記号を含むこと"},"setPwdLimitMsg1":"パスワードの長も 6桁で","setPwdLimitMsg2":"パスワードの長さは少なくとも 6桁で、英語、数字、記号のうち 2種類を含むこと","setPwdLimitMsg3":"パスワードの長も 6桁で、英文、数字および記号を同時に含むこと","wechatmpQrcode":"公衆番号フォロー登録","inputUsername":"ユーザー名を入力してください","moreWays":"もっとログインする","inputCorrectPhoneOrEmail":"有効な携帯番号またはメールアドレスをご入力ください","sendCodeTimeout":"送信に失敗した場合は後ほどお試しください","mediaDevicesSupport":"現在のデバイスは顔認識をサポートしていない","qrcodeNetWorkError":"ネットワーク異常クリック再試行","qrcodeRefer":"更新","noLoginMethodsDesc":"未構成登録方式","socialConnectionMessage":"{{provider}}を使用したログインはサポートされていません。他の方法でログインするか、他のブラウザで再試行してください。","inputNewPwd":"新しいパスワードをご入力ください","selectLoginAccount":"ログインアカウントを選択する","useOtherAccount":"別のアカウントを使う","tenant":{"consoleManage":"管理コンソール","ssoPad":"シングル サインオン アプリケーション パネル"},"AuthorizationCamera":"最初に認証を有効にしてください","checkPreferences":"設定を確認してください","requireError":"要求エラーを満たすことができません","hardwareSupport":"ハードウェアはサポートされていません","verifyCodeTip":"別の画像を表示","loginWithPasskey":"パスキーを使用してログインする","resetPassword":{"pleaseInputPassword":"パスワードを入力してください","checkPasswordDiff":"一貫したパスワードを入力してください","nextStep":"次のステップ","reset":"パスワードをリセット","back":"戻る","resetPasswordText1":"認証コードを受け取るために登録した携帯電話番号/メールボックスを入力してください。パスワードをリセットします。","resetPasswordText2":"あなたはリセットしています {{account}} のパスワード。","input":"インプット{{text}}","inputFourVerifyCode":"入力してください {{length}} ビット認証コード","inputNewPwd":"新しいパスワードを入力してください","confirmNewPwd":"新しいパスワードを確認してください","successTipMsg":"新しいパスワードを使用してログインを続けることができます","successTip":"パスワードのリセットに成功しました","backLogin":"秒ログインページが自動的にジャンプされます"},"wecomScanLogin":"エンタープライズ WeChat ログイン"}'),rd=JSON.parse('{"numberSafteyCode":"デジタルセキュリティコード","mfaBind":"MFA バインディング","nextStep":"次のステップ","inputCurrPwd":"現在のパスワードを入力してください","inputNewPwd":"新しいパスワードをご入力ください","inputOldPwd":"元のログインパスワードを入力してください","modifyPwd":"パスワードを変更する","modifyPwdText":"{{number}} か月以上連続して使用すると、パスワードが危険にさらされる可能性があります。 あなたのパスワードをリセットしてください。","modifyNoticePwdText":"あなたのパスワードは {{number}} か月以上継続して使用されており、有効期限が近づいています。使用に影響を与えないように、新しいパスワードを設定してください。","error":"エラーメッセージ","contactAdministrator":"不明なエラーです ~ 処理については管理者に連絡してください","resetpasswordText1":"登録の携帯番号/メールアドレスを入力し、認証コードを入力しください。パスワードのリセットをさせて頂きます。","unlockTip":"ロック解除に問題がある場合は、クリックしてください"}');// CONCATENATED MODULE: ./src/_utils/guardDocument.ts
|
|
12638
|
+
const Wu=JSON.parse('{"alreadyHasAcc":"already have an account,","bind":"Bind","yes":"Yes","no":"No","usernameFormatError":"Enter a valid user name","customNameFormatError":"Enter a valid account number","checkUserName":"The username already exists","checkCustomName":"The account already exists","pleaseSelectDate":"Please select date","bindEmail":"Bind Email","bindPhone":"Bind your phone number","confirm":"Confirm","unlock":"unlock","email":"Email","emailFormatError":"Enter a valid Email address ","emailLabel":"Email","female":"Female","guidance":{},"hasLooseSaftyCode":"Lost the security code?","inputFourVerifyCode":"{{length}}-digit code","login":"Log In","man":"Male","noAccYet":"No account yet,","perfectUserInfo":"Personal Information","phoneFormateError":"Please verify your phone number first","phoneLabel":"Phone","phoneNumber":"Phone number","register":"Sign Up","registerImmediate":"Sign Up","retryAfterTime":"{{time}} seconds","sendVerifyCode":"Send Code","sure":"Confirm","uploadFail":"{{name}} failed to upload","useRecoverCode":"Use recovery code","username":"Username","problem":{"title":"Tell us your problem","noVerify":"Unable to receive the verification code","noLogin":"Unable to log in","noRegister":"Unable to register","noAccount":"Lost Account","noResetPass":"Unable to reset password","locked":"Account is locked","other":"Other","noVerifyTip":{"tip":"If you cannot receive the mobile phone verification code, I suggest you do the following:","type1":"1. Check if your mobile phone is turned off or offline.","type2":"2. Check if your phone number has been entered correctly.","type3":"3. Check if your SMS with the verification code is blocked."},"noLoginTip":{"type1":"1. Check if your username and password have been entered correctly.","type2":"2. Check if your mobile phone is turned off or offline."},"noRegisterTip":{"tip":"If you cannot register, please do the following steps to solve this issue:","type1":"1. Check if your account has been registered.","type2":"2. Check if your phone number has been entered correctly.","type3":"3. Check if your SMS with the verification code is blocked."},"noAccountTip":{"tip":"If your account is lost, please do the following steps to solve this issue:","type1":"1. Check if your username and password have been entered correctly.","type2":"2. Check if your mobile phone is turned off or offline."},"noResetPassTip":{"tip":"If your password cannot be reset, please do the following steps to solve this issue:","type1":"1. Check if your mobile phone is turned off or offline.","type2":"2. Check if your password has been entered correctly."},"otherTip":{},"successTip":"Submitted successfully","successTipMsg":"Your information has been submitted to the application administrator. Your feedback will be processed as soon as possible. Please wait patiently.","form":{"phone":"Contact","question":"Problem","questionDescript":"Problem description","questionClip":"Problem screenshot","submit":"Submit"},"noLoginTips":"If you cannot log in, we suggest you do the following:","lockedTips":"If your account is locked, please contact the administrator to unlock it and try to log in again"},"backLoginPage":"Back","LoginSuccess":"Login Success","welcomeDoc":"Welcome to {{name}}. Providing your personal information will allow us to give you the best online\\nexperience.","copied":"Copied","bindEmailDoc":"please enter the mailbox to bind","copy":"Copy","SMS":"SMS Verification","EmailVerification":"Email Verification","OTPVerification":"OTP Verification","faceVerification":"Face Verification","registrationSuccess":"Registration Success","repeatPasswordDoc":"The Two Passwords Entered are Inconsistent","copyFailed":"Copy Failed","downloadTotpAppAndroid":"Android download","downloadTotpAppDocs":"Please use your mobile phone to scan the code to download the verifier","downloadTotpAppIOS":"IOS download","bindTotp":"Bind OTP","checkEmail":"The email already exists","checkPhone":"The phone number already exists","loginFailCheck":"Reminder: Your password is wrong, you can try {{number}} times","otpText1":"Please go to the OTP binding page to bind","faceText1":"Bind facial recognition","faceText2":"Please turn on the camera to recognize the face for binding","faceText3":"Start","faceText4":"Try again","checkPasswordHasSpace":"No spaces","backToVerify":"Back","backToMFA":"Return to MFA binding","bindSuccess":"Complete binding","clickTodownload":"click to download","goToLogin":"Back","mfaText1":"Scan the code to add MFA, check it on your mobile phone and enter the 6-digit security code.","noQuestions":"no problem,","noValidator":"No validator please","pleaseRecordKey":"Please record the key","timeoutLDAP":"Request timed out, LDAP configuration error","totpText1":"Please keep the recovery code properly","totpText2":"If your MFA is lost, you will need a recovery code","usePhoneOpen":"Please open Google Authenticator or Microsoft Authenticator on your phone","passwordAgain":"Confirm password","isMissing":"{{name}} is missing","password":"Password","captchaCode":"Digit code","account":"Account","phone":"Phone number","pToLogin":"seconds later back","resetSuccess":"Reset successfully","resetSuccessMessage":"The password is reset successfully, you can continue to log in with the new password","welcome":"Welcome","initPasswordText":"To ensure account security, please set your new password.","unsafePasswordChangeText":"Your password does not meet the current password strength requirements. Please set a new password.","updatePsswordSuccess":"Change the password successfully, please log in again","fullCaptchaCode":"Please fill in the complete","feedback":"Need help ?","loginProtocolTips":"Please check the login protocol","registerProtocolTips":"Please check the registration agreement","accountLock":"The account is locked, please click the question mark below to give feedback","corsErrorMessage":"The current domain name is not in the list of allowed domain names","corsErrorMessage2":"If you have any questions, you can <a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">refer to the document</a>","totpGenerateCode":"Generate a new recovery code for you, please record this key safely","verifyCodeLogin":"Verify Code","phoneVerifyCode":"Phone Code","emailVerifyCode":"Email Code","phoneCodeTab":"Phone Code","emailCodeTab":"Email Code","phoneOrEmail":"Phone Or Email","skip":"Skip","back":"Back","publicAccount":"Public account","identityBindingAskTitle":"Choose how to connect","identityBindingAskDesc":"If you are bound to an existing account, you can directly log in to the existing account by this method next time.","identityBindingCreate":"Create a new account","identityBindingBinding":"Bind to an existing account","identityBindingTitle":"Bind existing account","identityBindingDesc":"After binding, you can log in to this account directly by this method next time","identityBindingSkipAskTitle":"Account Binding","identityBindingSkipAskDesc":"Enter an exisiting account to bind, or enter a new account to sign up.","internationPhoneMessage":"Please enter a valid mobile phone number","areaCodePhone":"Area code Mobile number","timeoutAD":"Request timed out, AD misconfigured","timeout":"Request timed out, please try again later","userNameIsExists":"This username already exists!","fetchError":"Network connection failed, please try again later","i18nCheckErrorMessage":"Please enter a valid mobile phone number or correct email address","verifyCodeRegister":"Verify Code","PasswordRegister":"Password","EmailRegister":"Email","registerTab":"{{text}}","noFindEmail":"Can\'t find the email account","noFindPhone":"Can\'t find the phone account","noFindUsername":"Can\'t find the username account","jobNumber":"Account first letter must be capital","passwordUnsafeTip":"Password strength has been updated, please refresh the page and try again","loginWithWechatmpQrcodeTipsTitle":"Long press the QR code to login","del":"Delete","qrcode":"QR Code","registerCompletePasswordDesc":"To ensure account security, please set your password.","mfaCertification":"Multi-factor authentication","emailMfaCheck":"Please enter email verification code","SmsMfaCheck":"Please enter SMS verification code","faceCheck":"Please keep the camera turned on and unobstructed","resetAccount":{"title":"Set the user name","message":"The current user name is not unique, please reset the user name before you can successfully log on."}}'),Gu=JSON.parse('{"inputAccount":"Enter {{text}}","inputAdUsername":"Enter AD username","accPwdLoginVerify":"Account login verification","captchaCode":"Captcha","inputAdPwd":"Enter AD password","inputCaptchaCode":"Digit code","inputCorrectPhone":"Enter correct phone number or email address","inputEmail":"Enter Email","inputLdapPwd":"LDAP Password","inputLdapUsername":"LDAP Username","inputLoginPwd":"Enter Password","inputPhone":"Phone number","inputPhoneOrEmail":"Enter Phone number or Email","inputPwdAgain":"Enter password again","inputRecoverCode":"Enter recovery code","inputSixCode":"Enter 6-digit security code","loginBy":"Sign in with {{name}}","mfaAfterReset":"If you do not have a recovery code, please contact the administrator","noEmpty":"Please enter a {{label}}","rememberedSecret":"This key has been safely recorded","resetPwd":"Reset password","selfUnlock":"self unlock","selfUnlockText":"Your account has been locked, please enter the verification code and password to unlock it by yourself.","thridAccLogin":"Or sign in with","pwdLogin":"Password","bindPwdLogin":"Password","appScanLogin":"Mobile APP QR Code","scanLogin":"QR Code","ldapLogin":"LDAP","adLogin":"AD","authingOtpPushLogin":"Login by push","authingOtpPushCancelLogin":"Cancel login","loginText":"Login","otpLoginPendingText":"The request has been sent to the Authoring Token APP. Please confirm login at the client","getOtpLoginRequestAgain":"The login request is invalid. Please send request again","downloadOtpVerifier":"Download Authing OTP","loginToMobileClient":"Login Authing OTP","scanQrCode":"Scan QR code","setAuthingTokenVerify":"Set Authing OTP Verify","phoneScanCodeAndDownloadAuthingToken":"Please scan the code with your mobile phone or go to the app market to download the Authing OTP","noPrompt":"Don\'t prompt again","directLogin":"Direct login","openAuthingOtp":"Open the Authing OTP and click \\"Login / Register\\"","clickAndScanQrcode":"Click the scanning entry at the upper right corner of the \\"Login Application\\" page to scan the QR code below","downloadIOS":"IOS download","downloadAndroid":"Android download","howBindClient":"How to bind client applications","installAuthingToken":"Install the Authing Token App","downloadAuthingToken":"Please use your mobile phone to scan the code or go to the application market to download the Authoring token","openAppList":"Open app list","addApp":"Open the \\"Application List\\" and click \\"Add Application\\"","openLoginPage":"Open the login page","scanQrcode":"Click the \\"Scan QR code\\" button to scan the application QR code","scanFollowingQrcode":"Scan the following application QR code","relevanceApp":"Associate the application and log in to the account","receiveMessageFromAuthingToken":"After logging in to the application account, you can complete the login by receiving the Web application push in the Authing token","howUsePushLogin":"How to use push login","inputAccountInWeb":"Enter account information in the web login panel","clickLoginButton":"Click \\"Login\\"","receiveMessageInApp":"Receive login push on the bound mobile application","confirmLoginInApp":"Confirm \\"Login\\" to successfully log in to the web side.","howGetAppLoginUrl":"How to get the application login address","getCodeFromAdmin":"Get the associated application QR code from the administrator","getCodeFromAdminTips":"The administrator can get the application QR code in the application login control, and scan the QR code to log in to the corresponding application.","getCodeFromPersonalCenter":"Get application QR code from personal center","getCodeFromPersonalCenterTips":"Users can save the application login QR code in \\"Personal Center - Quick Authentication\\", and use the Authoring token to scan the code and select the application to log in","getLoginUrlFromConsole":"The administrator obtains the login address from the console","getLoginUrlFromConsoleTips":"Administrators can copy the authentication address in \\"Console - Application Details - Application Configuration - Authentication Configuration\\". Users can log in and bind after copying the authentication address.","nextStep":"Next Step","enterAccount":"Please enter the account","inputEmailCode":"Enter email verification code","otherVerifyWay":"Other verification methods","otherLoginWay":"OR","verifyCodeSended":"Verification code has been sent to","clickSent":"Click send","reSent":"Click to resend the verification code","bindPhoneInfo":"Please enter the phone number to bind","inputPhoneCode":"Please enter the phone verification code","forgetPwd":"Forgot Password","inputPwd":"Password","login":{"setPwdLimit2":"At least six digits, must contain two of English, numbers and symbols","setPwdLimit3":"At least six digits, including English, numbers and symbols"},"setPwdLimit1":"Set a password of at least 6 characters","setPwdLimitMsg1":"Passwords must be at least 6 characters long","setPwdLimitMsg2":"The password must be at least 6 characters long and must contain two of English, numbers and symbols","setPwdLimitMsg3":"The password must be at least 6 digits long and must contain English, numbers and symbols at the same time","wechatmpQrcode":"WechatMp QRcode\\t","inputUsername":"Username","moreWays":"More Login","inputCorrectPhoneOrEmail":"Enter a valid Email or Phone number","sendCodeTimeout":"Sending failed, please try later","mediaDevicesSupport":"The current device does not support face recognition","noLoginMethodsDesc":"No login method configured","inputNewPwd":"Please enter a new password","socialConnectionMessage":"Login with {{provider}} is not supported, please choose another way to log in, or try again in another browser","selectLoginAccount":"Select login account","useOtherAccount":"Use another account","wechatScanLogin":"WeChat QR Code","qrcodeRefer":"Refresh","qrcodeNetWorkError":"Retry","scanAgain":"Scan the code again","scanSuccess":"Scan Success","tenant":{"consoleManage":"Admin console","ssoPad":"Single sign-on application panel"},"AuthorizationCamera":"Please enable authorization first","checkPreferences":"Please check preferences","requireError":"Unable to satisfy request error","hardwareSupport":"Hardware not supported","verifyCodeTip":"Try another","loginWithPasskey":"Sign in with Passkey","resetPassword":{"pleaseInputPassword":"Please input a password","checkPasswordDiff":"Please enter a consistent password","nextStep":"Next","reset":"reset password","back":"Back","resetPasswordText1":"Please enter your registered mobile phone number/email to receive the verification code, and we will reset your password.","resetPasswordText2":"You are resetting Password for {{account}}。","input":"Input{{text}}","inputFourVerifyCode":"{{length}}-digit code","inputNewPwd":"Please enter a new password","confirmNewPwd":"Please confirm the new password","successTipMsg":"You can continue to log in with your new password","successTip":"Password reset succeeded","backLogin":"Seconds will automatically jump to the login page"},"wecomScanLogin":"Enterprise WeChat scan code to log in"}'),Ku=JSON.parse('{"inputCurrPwd":"Enter current password","inputNewPwd":"Enter a new Password","inputOldPwd":"Enter a old Password","mfaBind":"MFA Binding","modifyPwd":"Change Password","nextStep":"Next","numberSafteyCode":"Digital Security Code","error":"Error~","contactAdministrator":"Unknown error ~ please contact the administrator for processing","resetpasswordText1":"Enter your registered phone number/email, enter the verification code received, and we will reset your password.","modifyPwdText":"Your password has been used continuously for more than {{number}} months, which may be risky. Please reset your password.","modifyNoticePwdText":"Your password has been used continuously for more than {{number}} months, It will expire soon, in order not to affect your use, please set a new password","unlockTip":"If you encounter problems with unlocking, please click"}'),Yu=JSON.parse('{"guidance":{},"uploadFail":"{{name}} 上传失败","confirm":"确认","retryAfterTime":"{{time}} 秒","sendVerifyCode":"发送验证码","emailFormatError":"输入有效的邮箱","usernameFormatError":"输入有效的用户名","customNameFormatError":"输入有效的账号","phoneFormateError":"输入有效的手机号","username":"用户名","login":"登录","noAccYet":"还没有账号,","registerImmediate":"立即注册","sure":"确定","hasLooseSaftyCode":"安全码丢失?","useRecoverCode":"使用恢复代码","register":"注册","unlock":"解锁","alreadyHasAcc":"已有账号,","perfectUserInfo":"完善用户信息","man":"男","female":"女","emailLabel":"邮箱","phoneLabel":"手机号","pleaseSelectDate":"请选择日期","bindEmail":"绑定邮箱","email":"邮箱","inputFourVerifyCode":"请输入 {{length}} 位验证码","bindPhone":"绑定手机号","phoneNumber":"手机号","bind":"绑定","yes":"是","no":"否","problem":{"title":"问题反馈","noVerify":"无法收到验证码","noLogin":"无法登录","noRegister":"无法注册","noAccount":"帐号丢失","noResetPass":"无法重置密码","locked":"账号被锁定","other":"其他","noVerifyTip":{"tip":"如果无法收到手机验证码,建议你进行以下操作:","type1":"1. 检查你的手机是否停机/无网络","type2":"2. 检查你的手机号是否输入正确","type3":"3. 检查你的验证码短信是否被屏蔽"},"noLoginTip":{"type1":"1. 检查你的用户名与密码输入是否正确","type2":"2. 检查你的手机是否停机/无网络"},"noRegisterTip":{"tip":"如果无法注册,建议你进行以下操作:","type1":"1. 检查你的帐号是否已注册","type2":"2. 检查你的注册手机号是否输入正确","type3":"3. 检查你的验证码短信是否被屏蔽"},"noAccountTip":{"tip":"如果帐号丢失,建议你进行以下操作:","type1":"1. 检查你的用户名与密码输入是否正确","type2":"2. 检查你的手机是否停机/无网络"},"noResetPassTip":{"tip":"如果无法重置密码,建议你进行以下操作:","type1":"1. 检查你的手机是否停机/无网络","type2":"2. 检查你的设置的密码是否正确"},"otherTip":{},"successTip":"提交成功","successTipMsg":"你的信息已经提交给应用管理员,会尽快处理你的反馈,请你耐心等待。","form":{"phone":"联系方式","question":"相关问题","questionDescript":"问题描述","questionClip":"问题截图","submit":"提交"},"lockedTips":"如果你的账号被锁定,请联系管理员解锁后再尝试登录","noLoginTips":"如果无法登录,建议你进行以下操作:"},"backLoginPage":"返回登录","LoginSuccess":"登录成功","welcomeDoc":"欢迎加入 {{name}} ,为了更好的使用体验,请先完善你的个人信息","bindEmailDoc":"请输入邮箱进行绑定","copied":"已复制","copy":"复制","repeatPasswordDoc":"两次密码输入不一致","SMS":"短信验证码验证","EmailVerification":"电子邮箱验证","OTPVerification":"OTP 口令验证","faceVerification":"人脸识别验证","registrationSuccess":"注册成功","copyFailed":"复制失败","downloadTotpAppIOS":"IOS 下载","downloadTotpAppAndroid":"Android 下载","downloadTotpAppDocs":"请使用手机扫码下载验证器","bindTotp":"绑定 OTP","checkEmail":"该邮箱已存在","checkUserName":"该用户名已存在","checkCustomName":"该账号已存在","checkPhone":"该手机号已存在","loginFailCheck":"温馨提示:你的密码错误,还可以尝试 {{number}} 次","bindSuccess":"完成绑定","pleaseRecordKey":"请记录密钥","totpText1":"请妥善保存恢复代码","totpText2":"如果你的 MFA 丢失时,你将需要一个恢复代码","otpText1":"请前往 OTP 绑定页面进行绑定","faceText1":"绑定人脸识别","faceText2":"请打开摄像头识别人脸进行绑定","faceText3":"开始验证","faceText4":"重试一次","publicAccount":"公共账号","checkPasswordHasSpace":"不能包含空格","backToVerify":"返回验证页","usePhoneOpen":"请在手机打开 Google Authenticator 或 Microsoft Authenticator","noValidator":"没有验证器请","clickTodownload":"点击下载","mfaText1":"扫码添加 OTP,在手机查看并输入 6 位数字安全码。","backToMFA":"返回 MFA 绑定","timeoutLDAP":"请求超时,LDAP 配置错误","noQuestions":"没有问题,","goToLogin":"直接登录","passwordAgain":"请确认密码","isMissing":"{{name}}未填写","password":"密码","captchaCode":"验证码","account":"账号","phone":"手机号","pToLogin":"秒后返回登录","resetSuccess":"重置成功","resetSuccessMessage":"密码重置成功,你可以使用新密码继续登录","welcome":"欢迎访问","initPasswordText":"为了保障账号安全,请设置你的新密码。","unsafePasswordChangeText":"你的密码不符合当前密码强度要求,请设置新密码。","updatePsswordSuccess":"修改密码成功,请重新登录","fullCaptchaCode":"请填写完整的{{name}}","feedback":"问题反馈","loginProtocolTips":"请勾选登录协议","registerProtocolTips":"请勾选注册协议","accountLock":"账号被锁定,请点击下方问号进行反馈","corsErrorMessage":"当前域名不在允许访问的域名列表中。","corsErrorMessage2":"如果有疑问可以<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">参考文档</a>","totpGenerateCode":"为你生成一串新的恢复代码,请安全地记录这段密钥","verifyCodeLogin":"验证码登录","phoneCodeTab":"手机号登录","emailCodeTab":"邮箱登录","phoneVerifyCode":"短信验证码","emailVerifyCode":"邮箱验证码","phoneOrEmail":"手机号或邮箱","skip":"跳过","back":"返回","identityBindingAskTitle":"选择关联方式","identityBindingAskDesc":"如果绑定到已有账号,下次可以通过本次的方式直接登录已有账号","identityBindingCreate":"我想创建一个新账号","identityBindingBinding":"我想绑定到已有账号","identityBindingTitle":"绑定已有账号","identityBindingDesc":"绑定后,下次可以直接通过这次的方式登录到此账号","identityBindingSkipAskTitle":"账号绑定","identityBindingSkipAskDesc":"若存在已有账号,输入成功后将会完成绑定;若输入新账号则会完成创建和绑定","internationPhoneMessage":"请输入所在区号合法的手机号","areaCodePhone":"+区号 手机号","timeoutAD":"请求超时,AD 配置错误","timeout":"请求超时,请稍后重试","userNameIsExists":"该用户名已存在!","fetchError":"网络连接失败,请稍后再试","passwordUnsafeTip":"密码强度已更新,请刷新页面后重试","i18nCheckErrorMessage":"请输入所在区号合法的手机号或正确的邮箱","verifyCodeRegister":"验证码注册","PasswordRegister":"密码注册","EmailRegister":"邮箱注册","registerTab":"{{text}}注册","noFindEmail":"找不到该邮箱账号","noFindPhone":"找不到该手机账号","noFindUsername":"找不到该用户名账号","jobNumber":"工号首字母大写","loginWithWechatmpQrcodeTipsTitle":"长按二维码登录","del":"移除","qrcode":"二维码","registerCompletePasswordDesc":"为了保障账号安全,请设置你的密码。","mfaCertification":"多因素认证","emailMfaCheck":"请输入电子邮箱验证码","SmsMfaCheck":"请输入短信验证码","faceCheck":"请保持摄像头已打开并无遮挡","resetAccount":{"title":"设置用户名","message":"当前用户名不是唯一的,请重新设置用户名后才可以成功登录。"}}'),Ju=JSON.parse('{"inputAccount":"请输入{{text}}","inputAdUsername":"请输入 AD 用户名","inputAdPwd":"请输入 AD 密码","inputLdapUsername":"请输入 LDAP 用户名","inputLdapPwd":"请输入 LDAP 密码","inputCaptchaCode":"请输入图形验证码","captchaCode":"图形验证码","accPwdLoginVerify":"账号登录验证","inputSixCode":"请输入绑定的 6 位数字安全码","inputLoginPwd":"请输入登录密码","inputPhone":"请输入手机号","inputEmail":"请输入邮箱","inputPwdAgain":"再输入一次密码","loginBy":"使用 {{name}} 登录","thridAccLogin":"第三方账号登录","inputRecoverCode":"请输入恢复代码","rememberedSecret":"已经安全地记录了这段密钥","mfaAfterReset":"如果你没有恢复代码,请联系管理员处理","noEmpty":"{{label}} 不能为空","inputCorrectPhone":"请输入正确的手机号或邮箱","inputPhoneOrEmail":"请输入手机号或邮箱","resetPwd":"重置密码","selfUnlock":"自助解锁","selfUnlockText":"你的账号已被锁定,请输入验证码及密码自助解锁。","pwdLogin":"密码登录","bindPwdLogin":"密码登录","appScanLogin":"移动端 APP 扫码登录","scanLogin":"扫码登录","scanAgain":"重新扫码","wechatScanLogin":"使用微信扫码登录","scanSuccess":"扫码成功","ldapLogin":"LDAP 登录","adLogin":"AD 登录","loginText":"登录","authingOtpPushLogin":"推送登录","authingOtpPushCancelLogin":"取消登录","otpLoginPendingText":"已发送请求到 Authing 令牌 APP,请在客户端确认登录","getOtpLoginRequestAgain":"登录请求已失效,请重新获取","downloadOtpVerifier":"下载验证器","loginToMobileClient":"登录移动端","scanQrCode":"扫描二维码","setAuthingTokenVerify":"设置 Authing 令牌 Verify","phoneScanCodeAndDownloadAuthingToken":"请用手机扫码或前往应用市场下载 Authing 令牌","noPrompt":"以后不再提示","directLogin":"直接登录","openAuthingOtp":"打开 Authing 令牌,点击“登录/注册”","clickAndScanQrcode":"点击“登录应用”页面右上角的扫码入口,扫描下方二维码","downloadIOS":"iOS下载","downloadAndroid":"安卓下载","howBindClient":"如何绑定客户端应用","installAuthingToken":"安装 Authing 令牌","downloadAuthingToken":"请使用手机扫码或前往应用市场下载 Authing 令牌","openAppList":"打开应用列表","addApp":"打开\\"应用列表\\",点击\\"添加应用\\"","openLoginPage":"打开登录页","scanQrcode":"点击\\"扫描二维码\\"按钮扫描应用二维码","scanFollowingQrcode":"扫描以下应用二维码","relevanceApp":"关联应用并登录账号","receiveMessageFromAuthingToken":"登录应用账号后即可在 Authing 令牌接收 Web 应用推送完成登录","howUsePushLogin":"如何使用推送登录","inputAccountInWeb":"在 Web 端登录面板输入账号信息","clickLoginButton":"点击\\"登录\\"","receiveMessageInApp":"在已绑定的移动端应用上接收登录推送","confirmLoginInApp":"确认“登录”,即可成功登录 Web 端。","howGetAppLoginUrl":"如何获取应用登录地址","getCodeFromAdmin":"从管理员处获取关联应用二维码","getCodeFromAdminTips":"管理员可在应用登录控制中得到应用二维码,扫描二维码即可登录对应应用。","getCodeFromPersonalCenter":"从个人中心获取应用二维码","getCodeFromPersonalCenterTips":"用户可在\\"个人中心 - 快速认证\\"保存应用登录二维码,使用 Authing 令牌扫码后选择应用即可登录。","getLoginUrlFromConsole":"管理员从控制台取得登录地址","getLoginUrlFromConsoleTips":"管理员可在「控制台 - 应用详情 - 应用配置 - 认证配置」复制认证地址,用户复制认证地址后即可登录和绑定。","nextStep":"下一步","enterAccount":"请输入账号","verifyCodeSended":"验证码已发送至","inputEmailCode":"请输入邮箱验证码","otherVerifyWay":"其他验证方式","otherLoginWay":"其他登录方式","clickSent":"点击发送验证码","reSent":"点击重发验证码","bindPhoneInfo":"请输入手机号进行绑定","inputPhoneCode":"请输入手机验证码","forgetPwd":"忘记密码","inputPwd":"请输入密码","setPwdLimit1":"设置至少 6 位字符密码","login":{"setPwdLimit2":"至少六位,需包含英文、数字与符号中的两种","setPwdLimit3":"至少六位,需包含英文、数字与符号"},"setPwdLimitMsg1":"密码长度至少为 6 位","setPwdLimitMsg2":"密码长度至少为 6 位,且要包含英文、数字与符号中的两种","setPwdLimitMsg3":"密码长度至少为 6 位,且要同时包含英文、数字与符号","wechatmpQrcode":"公众号关注登录","inputUsername":"请输入用户名","moreWays":"更多登录","inputCorrectPhoneOrEmail":"请输入有效的手机号或邮箱","sendCodeTimeout":"发送失败,请稍后尝试","mediaDevicesSupport":"当前设备暂不支持人脸识别","qrcodeNetWorkError":"网络异常 点击重试","qrcodeRefer":"刷新","noLoginMethodsDesc":"未配置登录方式","socialConnectionMessage":"不支持使用{{provider}}登录,请选择其他方式登录,或在其它浏览器中重试","inputNewPwd":"请输入新密码","selectLoginAccount":"选择登录账号","useOtherAccount":"使用其他账号","tenant":{"consoleManage":"管理员控制台","ssoPad":"单点登录应用面板"},"AuthorizationCamera":"请先开启授权","checkPreferences":"请检查偏好设置","requireError":"无法满足要求错误","hardwareSupport":"硬件不支持","verifyCodeTip":"看不清?换一张","loginWithPasskey":"使用 Passkey 登录","resetPassword":{"pleaseInputPassword":"请输入密码","checkPasswordDiff":"请输入一致的密码","nextStep":"下一步","reset":"重置密码","back":"返回","resetPasswordText1":"请输入你注册的手机号/邮箱用于接收验证码,我们将为你重置密码。","resetPasswordText2":"你正在重置 {{account}} 的密码。","input":"输入{{text}}","inputFourVerifyCode":"请输入 {{length}} 位验证码","inputNewPwd":"请输入新密码","confirmNewPwd":"请确认新密码","successTipMsg":"你可以使用新密码继续登录","successTip":"密码重置成功","backLogin":"秒后将自动跳转登录页"},"wecomScanLogin":"企业微信扫码登录"}'),Qu=JSON.parse('{"numberSafteyCode":"数字安全码","mfaBind":"MFA 绑定","nextStep":"下一步","inputCurrPwd":"请输入当前密码","inputNewPwd":"请输入新密码","inputOldPwd":"请输入原登录密码","modifyPwd":"修改密码","modifyPwdText":"你的密码连续使用超过 {{number}} 个月,可能存在风险。请重新设置密码。","modifyNoticePwdText":"你的密码连续使用超过 {{number}} 个月,即将过期,为了不影响你的使用,请设置新密码","error":"错误信息","contactAdministrator":"未知的错误~ 请你联系管理员进行处理","resetpasswordText1":"输入你的注册电话/邮箱,输入收到的验证码,我们将为你进行密码重置。","unlockTip":"若解锁遇到问题,请点"}'),Zu=JSON.parse('{"EmailVerification":"電子郵件驗證","LoginSuccess":"登入成功","OTPVerification":"OTP 口令驗證","PasswordRegister":"密碼註冊","EmailRegister":"電子郵件註冊","registerTab":"{{text}}註冊","SMS":"短信驗證碼驗證","account":"賬號","accountLock":"賬號被鎖定,請點擊下方問號進行反饋","alreadyHasAcc":"已有賬號,","areaCodePhone":"區號 手機號碼","back":"返回","backLoginPage":"返回登入","backToMFA":"返回 MFA 綁定","backToVerify":"返回驗證頁","bind":"綁定","bindEmail":"綁定電子郵件","bindEmailDoc":"請輸入電子郵件進行綁定","bindPhone":"綁定手機號碼","bindSuccess":"完成綁定","bindTotp":"綁定 OTP","captchaCode":"驗證碼","checkEmail":"該電子郵件已存在","checkPasswordHasSpace":"不能包含空格","checkPhone":"該手機號碼已存在","checkUserName":"該用戶名已存在","checkCustomName":"該帳號已存在","clickTodownload":"點擊下載","confirm":"確認","copied":"已復制","copy":"複製","copyFailed":"複製失敗","corsErrorMessage":"當前域名不在允許訪問的域名列表中。","corsErrorMessage2":"如果有疑問可以<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">參考文檔</a>","downloadTotpAppAndroid":"Android 下載","downloadTotpAppDocs":"請使用手機掃碼下載驗證器","downloadTotpAppIOS":"IOS 下載","email":"電子郵件","emailFormatError":"請輸入有效的電子郵件","emailLabel":"電子郵件","emailVerifyCode":"電子郵件驗證碼","faceText1":"綁定人臉識別","faceText2":"請打開攝像頭識別人臉進行綁定","faceText3":"開始驗證","faceText4":"重試一次","faceVerification":"人臉識別驗證","feedback":"幫助中心","female":"女","fetchError":"網路連接失敗,請稍後再試","fullCaptchaCode":"請填寫完整的{{name}}","goToLogin":"直接登入","hasLooseSaftyCode":"安全碼丟失?","i18nCheckErrorMessage":"請輸入所在區號合法的手機號或正確的郵箱","identityBindingAskDesc":"如果綁定到已有賬號,下次可以通過本次的方式直接登入已有賬號","identityBindingAskTitle":"選擇關聯方式","identityBindingBinding":"我想綁定到已有賬號","identityBindingCreate":"我想創建一個新賬號","identityBindingDesc":"綁定後,下次可以直接通過這次的方式登入到此賬號","identityBindingTitle":"綁定已有賬號","identityBindingSkipAskTitle":"帳號綁定","identityBindingSkipAskDesc":"若存在已有帳號,輸入成功後將會完成綁定; 若輸入新帳號則會完成創建和綁定","initPasswordText":"為了保障賬號安全,請設置您的新密碼。","inputFourVerifyCode":"請輸入 {{length}} 位數驗證碼","internationPhoneMessage":"請輸入所在區號合法的手機號碼","isMissing":"{{name}}未填寫","jobNumber":"工號首字母大寫","login":"登入","loginFailCheck":"溫馨提示:您的密碼錯誤,還可以嘗試 {{number}} 次","loginProtocolTips":"請勾選登入協議","man":"男","mfaText1":"掃碼添加 OTP,在手機查看並輸入 6 位數字安全碼。","no":"否","noAccYet":"還沒有賬號,","noFindEmail":"找不到該電子郵件","noFindPhone":"找不到該手機賬號","noFindUsername":"找不到該用戶名賬號","noQuestions":"沒有問題,","noValidator":"沒有驗證器請","otpText1":"請前往 OTP 綁定頁面進行綁定","pToLogin":"秒後返回","password":"密碼","passwordAgain":"請確認密碼","publicAccount":"公共帳戶","passwordUnsafeTip":"密碼強度已更新,請刷新頁面後重試","perfectUserInfo":"個人資訊","phone":"手機號碼","phoneFormateError":"輸入有效的手機號碼","phoneLabel":"手機號碼","phoneNumber":"手機號碼","phoneOrEmail":"手機號碼或電子郵件","phoneVerifyCode":"短信驗證碼","pleaseRecordKey":"請記錄密鑰","pleaseSelectDate":"請選擇日期","problem":{"form":{"phone":"聯絡方式","question":"相關問題","questionClip":"截圖","questionDescript":"問題描述","submit":"提交"},"locked":"帳號被鎖住","lockedTips":"如果您的帳號被鎖定,請聯繫管理員解鎖後再嘗試登入","noAccount":"帳號遺失","noAccountTip":{"tip":"如果帳號丟失,建議您進行以下操作:","type1":"1. 檢查您的帳號與密碼是否正確輸入","type2":"2. 檢查您的手機服務是否停用 / 沒有網路"},"noLogin":"無法登入","noLoginTip":{"type1":"1. 檢查您的帳號與密碼是否正確輸入","type2":"2. 檢查您的手機服務是否停用 / 沒有網路"},"noLoginTips":"如果無法登入,建議您進行以下操作:","noRegister":"無法註冊","noRegisterTip":{"tip":"如果無法註冊,建議您進行以下操作:","type1":"1. 檢查您的帳號是否已註冊","type2":"2. 檢查您的註冊手機號碼是否正確輸入","type3":"3. 檢查您的驗證碼簡訊是否被阻擋"},"noResetPass":"無法重設密碼","noResetPassTip":{"tip":"如果無法重設密碼,建議您進行以下操作:","type1":"1. 檢查您的手機服務是否停用 / 沒有網路","type2":"2. 檢查您設定的密碼是否正確"},"noVerify":"無法收到驗證碼","noVerifyTip":{"tip":"如果無法收到手機驗證碼,建議您進行以下操作:","type1":"1. 檢查您的手機服務是否停用 / 沒有網路","type2":"2. 檢查您的手機號碼是否輸入正確","type3":"3. 檢查您的驗證碼簡訊是否被阻擋"},"other":"其他","successTip":"提交成功","successTipMsg":"您的信息已經提交給應用管理員,會盡快處理您的反饋,請您耐心等待。","title":"問題回報"},"register":"註冊","registerImmediate":"立即註冊","registerProtocolTips":"請勾選註冊協議","registrationSuccess":"註冊成功","repeatPasswordDoc":"兩次密碼輸入不一致","resetSuccess":"重設密碼","resetSuccessMessage":"密碼重設成功,請使用新密碼登入","retryAfterTime":"{{time}} 秒","sendVerifyCode":"發送驗證碼","skip":"跳過","sure":"確定","timeout":"請求超時,請稍後重試","timeoutAD":"請求超時,AD 配置錯誤","timeoutLDAP":"請求超時,LDAP 配置錯誤","totpGenerateCode":"為您生成一串新的恢復代碼,請安全地記錄這段密鑰","totpText1":"請妥善保存恢復代碼","totpText2":"如果您的 MFA 丟失時,您將需要一個恢復代碼","unlock":"解鎖","unsafePasswordChangeText":"您的密碼不符合當前密碼強度要求,請設置新密碼。","updatePsswordSuccess":"修改密碼成功,請重新登入","uploadFail":"{{name}} 上傳失敗","usePhoneOpen":"請在手機打開 Google Authenticator 或 Microsoft Authenticator","useRecoverCode":"使用恢復代碼","userNameIsExists":"該用戶名已存在!","username":"用戶名","usernameFormatError":"輸入有效的用戶名","customNameFormatError":"輸入有效的帳號","verifyCodeLogin":"驗證碼登入","phoneCodeTab":"手機號登錄","emailCodeTab":"郵箱登錄","verifyCodeRegister":"驗證碼註冊","welcome":"歡迎訪問","welcomeDoc":"歡迎加入 {{name}} ,為了提供最佳的線上體驗,請填寫您的個人資訊","yes":"是","loginWithWechatmpQrcodeTipsTitle":"長按二維碼登入","del":"移除","qrcode":"二維碼","registerCompletePasswordDesc":"為了保障賬號安全,請設置您的密碼。","mfaCertification":"多因素認證","emailMfaCheck":"請輸入電子郵箱驗證碼","SmsMfaCheck":"請輸入短信驗證碼","faceCheck":"請保持攝像頭已打開並無遮擋","resetAccount":{"title":"設定用戶名","message":"當前用戶名不是唯一的,請重新設定用戶名後才可以成功登入。"}}'),Xu=JSON.parse('{"accPwdLoginVerify":"賬號登入驗證","adLogin":"AD 登入","authingOtpPushLogin":"推送登錄","authingOtpPushCancelLogin":"取消登錄","loginText":"登録","otpLoginPendingText":"已發送請求到Authing權杖APP,請在用戶端確認登入","getOtpLoginRequestAgain":"登錄請求已失效,請重新獲取","downloadOtpVerifier":"下載驗證器","loginToMobileClient":"登錄移動端","scanQrCode":"掃描二維碼","setAuthingTokenVerify":"設定Authing權杖Verify","phoneScanCodeAndDownloadAuthingToken":"请用手机扫码或前往应用市场下载 Authing 令牌","noPrompt":"以後不再提示","directLogin":"直接登錄","openAuthingOtp":"打開Authing權杖,點擊“登入/注册”","clickAndScanQrcode":"點擊“登入應用”頁面右上角的掃碼入口,掃描下方二維碼","downloadIOS":"iOS下載","downloadAndroid":"安卓下載","howBindClient":"如何綁定用戶端應?","installAuthingToken":"安裝Authing權杖","downloadAuthingToken":"請使用手機掃碼或前往應用市場下載Authing權杖","openAppList":"打開應用清單","addApp":"打開“應用清單”,點擊“添加應用”","openLoginPage":"打開登入頁","scanQrcode":"點擊“掃描二維碼”按鈕掃描應用二維碼","scanFollowingQrcode":"掃描以下應用二維碼","relevanceApp":"關聯應用並登入帳號","receiveMessageFromAuthingToken":"登录应用账号后即可在 Authing 令牌接收 Web 应用推送完成登录","howUsePushLogin":"如何使用推送登入","inputAccountInWeb":"在Web端登入面板輸入帳號資訊","clickLoginButton":"點擊\\"登入\\"","receiveMessageInApp":"在已綁定的移動端應用上接收登入推送","confirmLoginInApp":"確認“登入”,即可成功登入Web端。","howGetAppLoginUrl":"如何獲取應用登入地址","getCodeFromAdmin":"從管理員處獲取關聯應用二維碼","getCodeFromAdminTips":"管理員可在應用登入控制中得到應用二維碼,掃描二維碼即可登入對應應用。","getCodeFromPersonalCenter":"從個人中心獲取應用二維碼","getCodeFromPersonalCenterTips":"用戶可在“個人中心-快速認證”保存應用登入二維碼,使用Authing權杖掃碼後選擇應用即可登入。","getLoginUrlFromConsole":"管理員從控制台取得登入地址","getLoginUrlFromConsoleTips":"管理員可在「控制台-應用詳情-應用配寘-認證配寘」複製認證地址,用戶複製認證地址後即可登入和綁定。","nextStep":"下一步","enterAccount":"請輸入帳號","appScanLogin":"移動端 APP 掃碼登入","bindPhoneInfo":"請輸入手機號碼進行綁定","captchaCode":"圖形驗證碼","clickSent":"點擊發送驗證碼","reSent":"點擊重發驗證碼","forgetPwd":"忘記密碼","inputAccount":"請輸入{{text}}","inputAdPwd":"請輸入 AD 密碼","inputAdUsername":"請輸入 AD 用戶名","inputCaptchaCode":"請輸入圖形驗證碼","inputCorrectPhone":"請輸入正確的手機號碼或電子郵件","inputCorrectPhoneOrEmail":"請輸入有效的手機號碼或電子郵件","inputEmail":"請輸入電子郵件","inputEmailCode":"請輸入電子郵件驗證碼","inputLdapPwd":"請輸入 LDAP 密碼","inputLdapUsername":"請輸入 LDAP 用戶名","inputLoginPwd":"請輸入密碼","inputNewPwd":"請輸入新密碼","inputPhone":"請輸入手機號碼","inputPhoneCode":"請輸入手機驗證碼","inputPhoneOrEmail":"請輸入手機號碼或電子郵件","inputPwd":"請輸入密碼","inputPwdAgain":"再輸入一次密碼","inputRecoverCode":"請輸入恢復代碼","inputSixCode":"請輸入綁定的 6 位數字安全碼","inputUsername":"請輸入用戶名","ldapLogin":"LDAP 登入","login":{"setPwdLimit2":"至少六位,需包含英文、數字與符號中的兩種","setPwdLimit3":"至少六位,需包含英文、數字與符號"},"loginBy":"使用 {{name}} 登入","mediaDevicesSupport":"當前設備暫不支持人臉識別","mfaAfterReset":"如果您沒有恢復代碼,請聯繫管理員處理","moreWays":"更多登入","noEmpty":"請填入 {{label}}","noLoginMethodsDesc":"未配置登入方式","otherLoginWay":"其他登入方式","otherVerifyWay":"其他驗證方式","pwdLogin":"帳號","bindPwdLogin":"帳號","rememberedSecret":"已經安全地記錄了這段密鑰","resetPwd":"重設密碼","scanLogin":"掃碼登入","selfUnlock":"自助解鎖","selfUnlockText":"您的賬號已被鎖定,請輸入驗證碼及密碼自助解鎖。","sendCodeTimeout":"發送失敗,請稍後嘗試","setPwdLimit1":"設置至少 6 位字符密碼","setPwdLimitMsg1":"密碼長度至少為 6 位","setPwdLimitMsg2":"密碼長度至少為 6 位,且要包含英文、數字與符號中的兩種","setPwdLimitMsg3":"密碼長度至少為 6 位,且要同時包含英文、數字與符號","socialConnectionMessage":"不支持使用{{provider}}登入,請選擇其他方式登入,或在其它瀏覽器中重試","thridAccLogin":"第三方帳號登入","verifyCodeSended":"驗證碼已發送至","wechatmpQrcode":"公眾號關注登入","selectLoginAccount":"選擇登入賬號","useOtherAccount":"使用其他賬號","wechatScanLogin":"使用微信掃碼登錄","qrcodeRefer":"刷新","qrcodeNetWorkError":"網路異常 點擊重試","scanAgain":"重新掃碼","scanSuccess":"掃碼成功","tenant":{"consoleManage":"管理員控制台","ssoPad":"單點登錄應用面板"},"AuthorizationCamera":"請先開啟授權","checkPreferences":"請檢查偏好設置","requireError":"無法滿足要求錯誤","hardwareSupport":"硬件不支持","verifyCodeTip":"看不清?換一張","loginWithPasskey":"使用 Passkey 登入","resetPassword":{"pleaseInputPassword":"請輸入密碼","checkPasswordDiff":"請輸入一致的密碼","nextStep":"下一步","reset":"重置密碼","back":"返回","resetPasswordText1":"請輸入你注册的手機號/郵箱用於接收驗證碼,我們將為你重置密碼。","resetPasswordText2":"你正在重置 {{account}} 的密碼。","input":"輸入{{text}}","inputFourVerifyCode":"請輸入 {{length}} 位數驗證碼","inputNewPwd":"請輸入新密碼","confirmNewPwd":"請確認新密碼","successTipMsg":"你可以使用新密碼繼續登入","successTip":"密碼重置成功","backLogin":"秒後將自動跳轉登入頁"},"wecomScanLogin":"企業微信掃碼登入"}'),ed=JSON.parse('{"contactAdministrator":"未知的錯誤~ 請您聯繫管理員進行處理","error":"錯誤信息","inputCurrPwd":"請輸入當前密碼","inputNewPwd":"請輸入新密碼","inputOldPwd":"請輸入原登入密碼","mfaBind":"MFA 綁定","modifyNoticePwdText":"您的密碼連續使用超過 {{number}} 個月,即將過期,為了不影響您的使用,請設置新密碼","modifyPwd":"修改密碼","modifyPwdText":"您的密碼連續使用超過 {{number}} 個月,可能存在風險。\\n請重新設置密碼。","nextStep":"下一步","numberSafteyCode":"數字安全碼","resetpasswordText1":"請輸入您的註冊電子郵件 / 手機號碼,以及收到的驗證碼,我們將為您進行密碼重設。","unlockTip":"若解鎖遇到問題,請點"}'),td=JSON.parse('{"guidance":{},"uploadFail":"{{name}} アップロード失敗","confirm":"確認","retryAfterTime":"{{time}} 秒","sendVerifyCode":"認証コードを送信します","emailFormatError":"有効なメールアドレスをご入力ください","usernameFormatError":"有効なユーザー名を入力する","customNameFormatError":"有効なアカウントを入力","phoneFormateError":"有効な携帯番号を入力する","username":"ユーザー名","login":"ログイン","noAccYet":"アカウントがないので,","registerImmediate":"すぐに登録します","sure":"確定","hasLooseSaftyCode":"セキュリティコードの紛失?","useRecoverCode":"復旧コードを使って","register":"登録","unlock":"ロック","alreadyHasAcc":"すでにアカウントがある,","perfectUserInfo":"プロフィール充実","publicAccount":"パブリックアカウント","man":"男","female":"女","emailLabel":"メールアドレス","phoneLabel":"携帯電話番号","pleaseSelectDate":"日付を選んでください","bindEmail":"メールボックスを結びつける","email":"メールアドレス","inputFourVerifyCode":"{{length}}桁の認証コードをご入力ください","bindPhone":"携帯電話番号を結びつける","phoneNumber":"携帯電話","bind":"据え置き","yes":"は","no":"いいえ","problem":{"title":"ヘルプ・お問い合わせ","noVerify":"認証コードが届きません","noLogin":"ログインできません","noRegister":"登録できません","noAccount":"アカウントをお忘れ","noResetPass":"パスワードのリセットができません","locked":"アカウントがロックされました","other":"その他","noVerifyTip":{"tip":"認証コードのSMSが届かない原因としては以下の事象等が考えられます。","type1":"1. 通信状況が不安定 /モバイル通信ができない状態","type2":"2. 電話番号の入力間違い","type3":"3. SMSの受信の制限"},"noLoginTip":{"type1":"1. アカウントとパスワードの入力が正しいかどうかチェックします。","type2":"2. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。"},"noRegisterTip":{"tip":"ログインできない場合は、以下の操作をお勧めします。","type1":"1. すでにアカウント登録済みとなっているかどうかチェックします。","type2":"2. 携帯電話番号が正しく入力しているかどうかチェックします。","type3":"3. 認証コードのSMSがブロックされているかどうかチェックします。"},"noAccountTip":{"tip":"アカウントが紛失した場合は、以下の操作をお勧めします。","type1":"1. アカウントとパスワードの入力が正しいかどうかチェックします。","type2":"2. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。"},"noResetPassTip":{"tip":"パスワードをリセットできない場合は、以下の操作をお勧めします。","type1":"1. 携帯電話が利用停止かどうか若しくはネットワーク接続状態チェックします。","type2":"2. 設定したパスワードが正しいかどうかチェックします。"},"otherTip":{},"successTip":"提出に成功する","successTipMsg":"あなたの情報はアプリケーション管理者に提出されており、フィードバックはすぐに処理されますので、お待ちください。","form":{"phone":"連絡方法","question":"ご用件","questionDescript":"お問い合わせ内容","questionClip":"スクリーンショット","submit":"提出"},"lockedTips":"アカウントがロックされた場合は、管理者にご連絡頂き、ロック解除された後もう一度ログインするようお願い致します。","noLoginTips":"ログインできない場合は、以下の操作をお勧めします。"},"backLoginPage":"ログイン画面に戻ります","LoginSuccess":"ログインに成功する","welcomeDoc":"{{name}}へようこそ、より良い使用体験をご提供できるよう個人情報のご記入をお願い致します。","bindEmailDoc":"メールアドレスを入力して結びつけてください","copied":"複製済み","copy":"コピー","repeatPasswordDoc":"2回のパスワード入力が一致しません","SMS":"sms認証","EmailVerification":"電子メール認証","OTPVerification":"OTP パスワード検証","faceVerification":"顔認証認証","registrationSuccess":"登録に成功する","copyFailed":"コピー失敗","downloadTotpAppIOS":"IOS のダウンロード","downloadTotpAppAndroid":"Android ダウンロード","downloadTotpAppDocs":"携帯電話のコードを使って検証をダウンロードしてください","bindTotp":"バインディング OTP","checkEmail":"メールボックスはすでに存在しています","checkUserName":"ユーザ名はすでに存在する","checkCustomName":"このアカウントは既に存在します","checkPhone":"携帯電話番号はすでに存在しています","loginFailCheck":"暖かい提示:あなたのパスワードは間違って、また試みることができます {{number}} 回","bindSuccess":"バインディング完了","pleaseRecordKey":"鍵を記録してください","totpText1":"回復コードを適切に保存してください","totpText2":"MFA が紛失した場合復旧コードが必要になります","otpText1":"バインドするには OTP バインド ページに移動してください","faceText1":"顔認証を結びつける","faceText2":"バインドする顔を認識するためにカメラをオンにしてください","faceText3":"検証を開始する","faceText4":"もう一度やってみる","checkPasswordHasSpace":"フレームを含まない","backToVerify":"検証ページに戻る","usePhoneOpen":"携帯で Google Authenticator または Microsoft Authenticator を開いてください","noValidator":"ベリファイアなしで","clickTodownload":"クリックしてダウンロードする","mfaText1":"OTP を追加して、携帯電話で調べて 6 桁の数字の安全なコードを入力します。","backToMFA":"MFA バインディングを戻す","timeoutLDAP":"要求タイムアウト、LDAP構成エラー","noQuestions":"問題がなく、","goToLogin":"直接にログインします","passwordAgain":"パスワードを確認してください","isMissing":"{{name}}が未入力です","password":"パスワード","captchaCode":"認証コード","account":"アカウント","phone":"携帯電話番号","pToLogin":"秒後に、ログイン画面に戻ります","resetSuccess":"リセットが完了しました","resetSuccessMessage":"パスワードのリセットが完了しました。新しいパスワードにて再ログインしてください。","welcome":"訪問を歓迎する","initPasswordText":"アカウントを安全に保つために、新しいパスワードを設定してください。","unsafePasswordChangeText":"あなたのパスワードは現在のパスワード強度の要件を満たしていません。新しいパスワードを設定してください。","updatePsswordSuccess":"パスワードの変更に成功しましたので、再ログインしてください","fullCaptchaCode":"{{name}}を記入してください","feedback":"ヘルプ・お問い合わせ","loginProtocolTips":"ログインプロトコルにチェックを入れてください","registerProtocolTips":"登録プロトコルにチェックを入れてください","accountLock":"アカウントがロックされたら、下の疑問符をクリックしてフィードバックしてください","corsErrorMessage":"現在のドメイン名はアクセスが許可されているドメイン名のリストには含まれていない。","corsErrorMessage2":"質問があれば<a href=\\"https://docs.authing.cn/v2/guides/security/config-domain.html\\">ドキュメント参照</a>","totpGenerateCode":"この鍵を安全に記録してください","verifyCodeLogin":"認証コード登録","phoneCodeTab":"携帯電話番号でのログイン","emailCodeTab":"電子メールでのログイン","phoneVerifyCode":"sms認証コード","emailVerifyCode":"メールボックス認証コード","phoneOrEmail":"携帯電話/メールアドレス","skip":"飛び越え","back":"戻る","identityBindingAskTitle":"つながり方を選ぶ","identityBindingAskDesc":"既存アカウントに紐付いている場合は、今回の方法で直接既存アカウントにログインすることができます。","identityBindingCreate":"新しいアカウントを作りたいのですが","identityBindingBinding":"既存のアカウントと結びつけたい","identityBindingTitle":"既存のアカウントを結びつける","identityBindingDesc":"紐付け后、次回から直接今回の方法でこのアカウントにログインすることができます","identityBindingSkipAskTitle":"アカウントのバインド","identityBindingSkipAskDesc":"既存のアカウントが存在する場合は、入力に成功するとバインドが完了します。新規アカウントを入力すると作成とバインドが完了します","internationPhoneMessage":"合法的な局番の携帯番号を入力してください","areaCodePhone":"+局番付き携帯番号","timeoutAD":"要求タイムアウト、AD設定ミス","timeout":"タイムアウトをお願いしますので,後ほど再試行してください","userNameIsExists":"このユーザー名はすでに存在します!","fetchError":"ネットワーク接続に失敗した場合は後ほどお試しください","passwordUnsafeTip":"パスワードが更新されましたので、ページを更新して再試行してください","i18nCheckErrorMessage":"地域番号の合法的な携帯電話番号または正しいメールアドレスを入力してください","verifyCodeRegister":"認証コード登録","EmailRegister":"Eメール登録","registerTab":"{{text}}登録","PasswordRegister":"アカウント登録","noFindEmail":"該当メールアドレスが見つかりません","noFindPhone":"携帯電話のアカウントが見つかりません","noFindUsername":"該当ユーザー名アカウントが見つからない","jobNumber":"工番の頭文字を大文字にする","loginWithWechatmpQrcodeTipsTitle":"qrコードを長押しして登録する","del":"除去","qrcode":"qrコード","registerCompletePasswordDesc":"アカウントを安全に保つために、パスワードを設定してください。","mfaCertification":"多要素認証","emailMfaCheck":"メール認証コードを入力してください","SmsMfaCheck":"SMS認証コードを入力してください","faceCheck":"カメラの電源を入れ、遮るものがない状態にしてください","resetAccount":{"title":"ユーザー名の設定","message":"現在のユーザー名は一つではありません。ユーザー名を再設定してからログインできます。"}}'),nd=JSON.parse('{"inputAccount":"{{text}}をご入力ください","inputAdUsername":"AD ユーザー名を入力してください","inputAdPwd":"AD パスワードを入力してください","inputLdapUsername":"LDAP ユーザ名を入力してください","inputLdapPwd":"LDAP パスワードを入力してください","inputCaptchaCode":"図形認証コードを入力してください","captchaCode":"グラフィックス認証コード","accPwdLoginVerify":"アカウント登録検証","inputSixCode":"バインドされた 6 桁のセキュリティ コードを入力してください","inputLoginPwd":"パスワードをご入力ください","inputPhone":"携帯番号を入力してください","inputEmail":"メールアドレスをご入力ください","inputPwdAgain":"もう一度パスワードを入力する","loginBy":"{{name}}を使ってログインする","thridAccLogin":"第三者アカウントのログイン","inputRecoverCode":"復旧コードを入力してください","rememberedSecret":"鍵は安全に記録されています","mfaAfterReset":"復旧コードがない場合は管理者に連絡してください","noEmpty":"{{label}}が未入力です","inputCorrectPhone":"メールアドレス/携帯電話を正しくご入力ください","inputPhoneOrEmail":"携帯番号またはメールアドレスをご入力ください","resetPwd":"パスワードをリセット","selfUnlock":"セルフロック","selfUnlockText":"あなたのアカウントはロックされています。認証コードとパスワードを入力してセルフロックを解除してください。","pwdLogin":"既にアカウントをお持ち","bindPwdLogin":"アカウントログイン","appScanLogin":"モバイルアプリでコード登録","scanLogin":"コード登録","scanAgain":"コードを掃き直す","wechatScanLogin":"wechatのコードを使ってログインする","scanSuccess":"コード掃きに成功する","ldapLogin":"LDAP ログイン","adLogin":"AD 登録","authingOtpPushLogin":"プッシュ登録","authingOtpPushCancelLogin":"登録をキャンセルする","loginText":"登録","otpLoginPendingText":"AuthingトークンAPPにリクエストを送信しました。クライアントでログインを確認してください","getOtpLoginRequestAgain":"ログイン要求は無効になりましたので、再取得してください","downloadOtpVerifier":"ベリファイアのダウンロード","loginToMobileClient":"モバイル端末へのログイン","scanQrCode":"スキャン2次元コード","setAuthingTokenVerify":"AuthingトークンVerifyの設定","phoneScanCodeAndDownloadAuthingToken":"携帯電話でコードをスキャンするか、アプリケーション市場に行ってAuthingトークンをダウンロードしてください","noPrompt":"後でプロンプトしない","directLogin":"直接ログイン","openAuthingOtp":"Authingトークンを開き、「ログイン/登録」をクリックします","clickAndScanQrcode":"「ログインアプリケーション」ページの右上にあるスキャンコードの入り口をクリックし、下のQRコードをスキャンします","downloadIOS":"iOSダウンロード","downloadAndroid":"Androidダウンロード","howBindClient":"クライアントアプリケーションをバインドする方法","installAuthingToken":"Authingトークンのインストール","downloadAuthingToken":"携帯電話でコードをスキャンするか、アプリケーション市場に行ってAuthingトークンをダウンロードしてください","openAppList":"アプリケーションリストを開く","addApp":"「アプリケーションリスト」を開き、「アプリケーションの追加」をクリックします","openLoginPage":"ログインページを開く","scanQrcode":"「QRコードをスキャン」ボタンをクリックしてQRコードをスキャンして適用する","scanFollowingQrcode":"スキャン以下にQRコードを適用","relevanceApp":"アプリケーションを関連付けてアカウントにログインする","receiveMessageFromAuthingToken":"アプリケーションアカウントにログインすると、AuthingトークンでWebアプリケーションのプッシュを受信してログインを完了することができます","howUsePushLogin":"プッシュログインの使用方法","inputAccountInWeb":"Webログインパネルにアカウント情報を入力する","clickLoginButton":"「ログイン」をクリック","receiveMessageInApp":"バインドされたモバイル端末アプリケーションへのログインプッシュの受信","confirmLoginInApp":"「ログイン」を確認すると、Web側に正常にログインできます。","howGetAppLoginUrl":"アプリケーションログインアドレスを取得する方法","getCodeFromAdmin":"管理者から関連アプリケーションのQRコードを取得する","getCodeFromAdminTips":"管理者はアプリケーションログイン制御に二次元コードを適用することができ、二次元コードをスキャンすれば対応するアプリケーションにログインすることができる。","getCodeFromPersonalCenter":"パーソナルセンターからアプリケーションQRコードを取得する","getCodeFromPersonalCenterTips":"ユーザーは「パーソナルセンター-クイック認証」保存アプリケーションに二次元コードを登録し、Authingトークンを使用してコードをスキャンした後、アプリケーションを選択することでログインすることができます","getLoginUrlFromConsole":"管理者はコンソールからログインアドレスを取得する","getLoginUrlFromConsoleTips":"管理者は、コンソール-アプリケーション詳細-アプリケーション構成-認証構成で認証アドレスをコピーでき、ユーザーは認証アドレスをコピーするとログインとバインドできます。","nextStep":"次のステップ","enterAccount":"アカウントを入力してください","verifyCodeSended":"認証コードが送信され","inputEmailCode":"メールアドレス認証を入力してください","otherVerifyWay":"その他の検証方法","otherLoginWay":"その他の登録方法","clickSent":"認証コードの送信をクリックする","reSent":"認証コードの再送をクリックしてください","bindPhoneInfo":"携帯番号を入力して結びつけてください","inputPhoneCode":"携帯認証コードを入力してください","forgetPwd":"パスワードをお忘れの場合","inputPwd":"パスワードを入力してください","setPwdLimit1":"最低 6 ビットの文字パスワードを設定する","login":{"setPwdLimit2":"少なくとも6桁で、英数字と記号のうち2種類を含むこと","setPwdLimit3":"少なくとも6桁の英数字および記号を含むこと"},"setPwdLimitMsg1":"パスワードの長も 6桁で","setPwdLimitMsg2":"パスワードの長さは少なくとも 6桁で、英語、数字、記号のうち 2種類を含むこと","setPwdLimitMsg3":"パスワードの長も 6桁で、英文、数字および記号を同時に含むこと","wechatmpQrcode":"公衆番号フォロー登録","inputUsername":"ユーザー名を入力してください","moreWays":"もっとログインする","inputCorrectPhoneOrEmail":"有効な携帯番号またはメールアドレスをご入力ください","sendCodeTimeout":"送信に失敗した場合は後ほどお試しください","mediaDevicesSupport":"現在のデバイスは顔認識をサポートしていない","qrcodeNetWorkError":"ネットワーク異常クリック再試行","qrcodeRefer":"更新","noLoginMethodsDesc":"未構成登録方式","socialConnectionMessage":"{{provider}}を使用したログインはサポートされていません。他の方法でログインするか、他のブラウザで再試行してください。","inputNewPwd":"新しいパスワードをご入力ください","selectLoginAccount":"ログインアカウントを選択する","useOtherAccount":"別のアカウントを使う","tenant":{"consoleManage":"管理コンソール","ssoPad":"シングル サインオン アプリケーション パネル"},"AuthorizationCamera":"最初に認証を有効にしてください","checkPreferences":"設定を確認してください","requireError":"要求エラーを満たすことができません","hardwareSupport":"ハードウェアはサポートされていません","verifyCodeTip":"別の画像を表示","loginWithPasskey":"パスキーを使用してログインする","resetPassword":{"pleaseInputPassword":"パスワードを入力してください","checkPasswordDiff":"一貫したパスワードを入力してください","nextStep":"次のステップ","reset":"パスワードをリセット","back":"戻る","resetPasswordText1":"認証コードを受け取るために登録した携帯電話番号/メールボックスを入力してください。パスワードをリセットします。","resetPasswordText2":"あなたはリセットしています {{account}} のパスワード。","input":"インプット{{text}}","inputFourVerifyCode":"入力してください {{length}} ビット認証コード","inputNewPwd":"新しいパスワードを入力してください","confirmNewPwd":"新しいパスワードを確認してください","successTipMsg":"新しいパスワードを使用してログインを続けることができます","successTip":"パスワードのリセットに成功しました","backLogin":"秒ログインページが自動的にジャンプされます"},"wecomScanLogin":"エンタープライズ WeChat ログイン"}'),rd=JSON.parse('{"numberSafteyCode":"デジタルセキュリティコード","mfaBind":"MFA バインディング","nextStep":"次のステップ","inputCurrPwd":"現在のパスワードを入力してください","inputNewPwd":"新しいパスワードをご入力ください","inputOldPwd":"元のログインパスワードを入力してください","modifyPwd":"パスワードを変更する","modifyPwdText":"{{number}} か月以上連続して使用すると、パスワードが危険にさらされる可能性があります。 あなたのパスワードをリセットしてください。","modifyNoticePwdText":"あなたのパスワードは {{number}} か月以上継続して使用されており、有効期限が近づいています。使用に影響を与えないように、新しいパスワードを設定してください。","error":"エラーメッセージ","contactAdministrator":"不明なエラーです ~ 処理については管理者に連絡してください","resetpasswordText1":"登録の携帯番号/メールアドレスを入力し、認証コードを入力しください。パスワードのリセットをさせて頂きます。","unlockTip":"ロック解除に問題がある場合は、クリックしてください"}');// CONCATENATED MODULE: ./src/_utils/guardDocument.ts
|
|
12639
12639
|
var od,id=function(){return od},ad=function(e){od=e},sd=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},cd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ld={"en-US":{translation:e},"zh-CN":{translation:t},"zh-TW":{translation:n},"ja-JP":{translation:r}},ud=function(e){if(void 0===e&&(e=""),!e||"en"===e)return["en-US"];if(!e||"zh"===e)return["zh-CN"];if(!e||"ja"===e)return["ja-JP"];var t=[];return e.startsWith("en-")?(t.push("en-US"),t):e.startsWith("ja-")?(t.push("ja-JP"),t):e.startsWith("zh-")?(["zh-tw","zh-hk","zh-mo","zh-hant"].includes(e.toLocaleLowerCase())?t.push("zh-TW"):(["zh-cn","zh-sg","zh-my"].includes(e.toLocaleLowerCase()),t.push("zh-CN")),t):["en-US"]},dd=i(8424),fd=i.n(dd),pd=i(6888),hd=i.n(pd);// CONCATENATED MODULE: ./shim-antd4/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
12640
12640
|
function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},md.apply(this,arguments)}// CONCATENATED MODULE: ./shim-antd4/node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
12641
12641
|
function vd(e){return vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vd(e)}// CONCATENATED MODULE: ./shim-antd4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
@@ -17577,14 +17577,14 @@ return g.createElement(qD,Dd(Dd({},e),{},{ref:t,icon:FA}))};UD.displayName="Plus
|
|
|
17577
17577
|
/* harmony default export */const VD=g.forwardRef(UD);// CONCATENATED MODULE: ./shim-antd4/node_modules/@ant-design/icons/es/index.js
|
|
17578
17578
|
uD.Provider;
|
|
17579
17579
|
// EXTERNAL MODULE: ./shim-antd4/node_modules/antd/lib/locale/zh_CN.js
|
|
17580
|
-
var $D=i(4232),zD=i(4631),HD=i(1062),WD=i(8787),GD={zhCN:$D/* default */.Z,enUS:zD/* default */.Z,jaJP:HD/* default */.Z,zhTW:WD/* default */.Z},KD=function(){return KD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KD.apply(this,arguments)},YD=function(e){var t=e.type,n=e.style,r=e.className;return y().createElement("svg",{style:KD({},n),className:
|
|
17580
|
+
var $D=i(4232),zD=i(4631),HD=i(1062),WD=i(8787),GD={zhCN:$D/* default */.Z,enUS:zD/* default */.Z,jaJP:HD/* default */.Z,zhTW:WD/* default */.Z},KD=function(){return KD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KD.apply(this,arguments)},YD=function(e){var t=e.type,n=e.style,r=e.className;return y().createElement("svg",{style:KD({},n),className:yQ(["g2-icon",r])},y().createElement("use",{xlinkHref:"#".concat(t)}))},JD=function(){return JD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},JD.apply(this,arguments)},QD=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZD=y().useContext,XD=y().useMemo,eL={finallyConfig:{},defaultMergedConfig:{},publicConfig:{},httpClient:{},appId:"",initData:{},currentModule:{},events:{},isAuthFlow:!1,contextLoaded:!1,guardPageConfig:{},
|
|
17581
17581
|
/**
|
|
17582
17582
|
* 多账号 状态
|
|
17583
17583
|
*/
|
|
17584
|
-
multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isForeignUserpool:!1},tL=y().createContext(eL),nL=y().createContext({spin:!1,spinChange:function(){}}),rL=function(){return ZD(nL)},oL=function(){return ZD(tL).publicConfig},iL=function(){return ZD(tL).httpClient},aL=function(){return ZD(tL).appId},sL=function(){return ZD(tL).tenantId};function cL(){return ZD(tL).initData}var lL=function(){return ZD(tL).currentModule},uL=function(){return ZD(tL).events},dL=function(){var e=ZD(tL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},fL=function(){return ZD(tL).finallyConfig},pL=function(){return ZD(tL).isAuthFlow},hL=function(){return ZD(tL).multipleInstance},mL=function(){return ZD(tL).phoneRegex},vL=function(){return ZD(tL).defaultLanguageConfig},gL=function(){var e=oL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},yL=function(){return ZD(tL).isForeignUserpool},bL=y().useMemo,wL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},CL=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=Pu().i18n,i=ZD(tL).guardPageConfig,a=fL(),s=bL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=bL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=bL((function(){return Object.keys(wL).includes(o.
|
|
17585
|
-
const EL=
|
|
17586
|
-
function kL(){return EL
|
|
17587
|
-
var SL,xL=function(){return SL},PL=function(e){SL=e},_L=function(){return _L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_L.apply(this,arguments)},TL=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OL=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},NL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},IL=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},AL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return TL(void 0,void 0,void 0,(function(){return OL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,IL([],NL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},RL=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};AL.get=function(e,t,n){return void 0===t&&(t={}),TL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return OL(this,(function(c){switch(c.label){case 0:r=_L(_L({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[AL.langHeader]=
|
|
17584
|
+
multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isForeignUserpool:!1},tL=y().createContext(eL),nL=y().createContext({spin:!1,spinChange:function(){}}),rL=function(){return ZD(nL)},oL=function(){return ZD(tL).publicConfig},iL=function(){return ZD(tL).httpClient},aL=function(){return ZD(tL).appId},sL=function(){return ZD(tL).tenantId};function cL(){return ZD(tL).initData}var lL=function(){return ZD(tL).currentModule},uL=function(){return ZD(tL).events},dL=function(){var e=ZD(tL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},fL=function(){return ZD(tL).finallyConfig},pL=function(){return ZD(tL).isAuthFlow},hL=function(){return ZD(tL).multipleInstance},mL=function(){return ZD(tL).phoneRegex},vL=function(){return ZD(tL).defaultLanguageConfig},gL=function(){var e=oL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},yL=function(){return ZD(tL).isForeignUserpool},bL=y().useMemo,wL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},CL=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=Pu().i18n,i=ZD(tL).guardPageConfig,a=fL(),s=bL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=bL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=bL((function(){return Object.keys(wL).includes(o.resolvedLanguage)?o.resolvedLanguage:ud(o.resolvedLanguage)[0]||"en-US"}),[o.resolvedLanguage]),u=bL((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,wL[l].label))}),[l]),d=bL((function(){return Object.keys(wL).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:wL[e].label}}))}),[n]);if(!c||0===n.length)return null;var f={items:d,onClick:function(e){l!==e.key&&(o.changeLanguage(e.key),null==r||r(e.key))}};return y().createElement("div",{className:"g2-change-language-container"},y().createElement(w_,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"authing-g2-change-language-menu"},y().createElement("span",{className:s},u,y().createElement(YD,{type:"authing-arrow-down-s-fill",className:"down-fill-svg"}))))};// CONCATENATED MODULE: ./package.json
|
|
17585
|
+
const EL="4.5.8";// CONCATENATED MODULE: ./src/_utils/getVersion.ts
|
|
17586
|
+
function kL(){return EL}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
|
|
17587
|
+
var SL,xL=function(){return SL},PL=function(e){SL=e},_L=function(){return _L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_L.apply(this,arguments)},TL=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OL=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},NL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},IL=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},AL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return TL(void 0,void 0,void 0,(function(){return OL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,IL([],NL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},RL=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};AL.get=function(e,t,n){return void 0===t&&(t={}),TL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return OL(this,(function(c){switch(c.label){case 0:r=_L(_L({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[AL.langHeader]=MQ(),s)),""!==AL.tenantId&&(r[AL.tenantHeader]=AL.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([RL(i.cancel),ma()("".concat(AL.baseUrl).concat(e).concat(Fc().stringify(t,{addQueryPrefix:!0})),_L(_L({method:"GET"},n),{withCredentials:!0,headers:r,cancelToken:i.token}))])];case 2:return[2/*return*/,null==(a=c.sent())?void 0:a.data];case 3:return c.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},AL.post=function(e,t,n){return TL(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return OL(this,(function(l){switch(l.label){case 0:r=_L(_L({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[AL.langHeader]=su.resolvedLanguage,s)),""!==AL.tenantId&&(r[AL.tenantHeader]=AL.tenantId),l.label=1;case 1:return l.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([RL(i.cancel),ma()("".concat(AL.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:_L(_L({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[AL.langHeader]=MQ(),c))})])];case 2:return[2/*return*/,null==(a=l.sent())?void 0:a.data];case 3:return l.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},AL.postForm=function(e,t,n){return TL(void 0,void 0,void 0,(function(){var r,o,i,a;return OL(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=ma().CancelToken,o=r.source(),[4/*yield*/,Promise.race([RL(o.cancel),ma()("".concat(AL.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:_L(_L({},null==n?void 0:n.headers),(a={},a[AL.langHeader]=MQ(),a))})])];case 1:return[2/*return*/,null==(i=s.sent())?void 0:i.data];case 2:return s.sent(),[2/*return*/,Promise.resolve({code:-2})];case 3:return[2/*return*/]}}))}))},AL.baseUrl="",AL.setBaseUrl=function(e){AL.baseUrl=e.replace(/\/$/,"")};var ML,DL="x-authing-lang";AL.langHeader=DL,AL.tenantHeader="x-authing-app-tenant-idåå",AL.tenantId="",AL.setLangHeader=function(e){AL.langHeader=e||DL},AL.setTenantHeader=function(e){AL.tenantHeader=e||DL},AL.setTenantId=function(e){AL.tenantId=e},function(e){e.ERROR="error",e.LOGIN="login",e.REGISTER="register",e.MFA="mfa",e.FORGET_PWD="forgetPassword",e.FORCED_PASSWORD_RESET="forcedPasswordReset",e.NOTICE_PASSWORD_RESET="noticePasswordReset",e.FIRST_LOGIN_PASSWORD="firstLoginPassword",e.UNSAFE_PASSWORD_RESET="unsafePasswordReset",e.DOWNLOAD_AT="downloadAT",e.BIND_TOTP="bindTotp",e.ANY_QUESTIONS="anyQuestions",e.LOGIN_COMPLETE_INFO="loginCompleteInfo",e.REGISTER_PASSWORD="registerPassword",e.REGISTER_COMPLETE_INFO="registerCompleteInfo",e.RECOVERY_CODE="recoveryCode",e.SUBMIT_SUCCESS="submitSuccess",e.IDENTITY_BINDING_ASK="identityBindingAsk",e.IDENTITY_BINDING="identityBinding",e.IDENTITY_BINDING_NO_ASK="identityBindingNoAsk",e.SELF_UNLOCK="selfUnlock",e.FLOW_SELECT_ACCOUNT="flowSelectAccount",
|
|
17588
17588
|
/** 多租户门户选择页 */
|
|
17589
17589
|
e.TENANT_PORTAL="tenant-portal",e.New_SUBMIT_SUCCESS="newSubmitSuccess",e.SELECT_ACCOUNT_2_LOGIN="selectAccout2Login",e.RESET_ACCOUNT_NAME="resetAccountName"}(ML||(ML={}));// CONCATENATED MODULE: ./src/AuthClientProvider/context.tsx
|
|
17590
17590
|
var LL,FL=y().createContext(void 0),jL=y().useContext,BL=function(e){var t=e.children,n=e.client,r=FL.Provider;return y().createElement(r,{value:{client:n}},t)},qL=function(){var e=jL(FL);return null==e?void 0:e.client},UL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},VL=y().useEffect,$L=y().useMemo,zL=y().useState,HL=function(e,t){var n=t.appId,r=t.tenantId;if(e.options.appId!==n)throw new Error("AuthClientProvider 与 Guard AppId 初始化不同,请检查初始化时传入的 AppId 是否正确");if(r&&e.options.tenantId!==r)throw new Error("AuthClientProvider 与 Guard TenantId 初始化不同,请检查初始化时传入的 TenantId 是否正确");return!0},WL=function(){return function(){if(!LL)throw new Error("Please initialize GuardAuthClient");return LL}()},GL=function(){return GL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},GL.apply(this,arguments)},KL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},YL=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},JL=function(e,t,n){var r={},o=["__changeModule"];return Object.keys(e).filter((function(e){return e.startsWith("on")||o.includes(e)})).forEach((function(t){r[t]=e[t]})),
|
|
@@ -17609,14 +17609,14 @@ this.config={},
|
|
|
17609
17609
|
// 历史记录
|
|
17610
17610
|
this.moduleStateHistory=[],
|
|
17611
17611
|
// Log
|
|
17612
|
-
this.stateMachineLog={},this.uninstallPopstate=function(){var e;null===(e=r.globalWindow())||void 0===e||e.removeEventListener("popstate",r.onPopstate)},this.globalWindow=function(){var e=
|
|
17612
|
+
this.stateMachineLog={},this.uninstallPopstate=function(){var e;null===(e=r.globalWindow())||void 0===e||e.removeEventListener("popstate",r.onPopstate)},this.globalWindow=function(){var e=VQ();return null!=e?e:void 0},this.next=function(e,t){var n=r.globalWindow(),o={moduleName:e,initData:t};r.changeModuleEvent(e,t);var i=r.moduleStateHistory.slice(1,2)[0];r.isUseHistoryHijack()&&(null==n||n.history.pushState(e,"",null==n?void 0:n.location.href)),
|
|
17613
17613
|
// 快照history
|
|
17614
17614
|
i&&fd()(i,o)?r.back():r.historyPush(o)},this.back=function(e){if(void 0===e&&(e={}),!(r.moduleStateHistory.length<=1)){var t=r.moduleStateHistory[1];r.changeModuleEvent(t.moduleName,uF(uF({},e),t.initData)),r.moduleStateHistory.splice(0,1)}},
|
|
17615
17615
|
// 业务终点 Log 发送
|
|
17616
17616
|
this.end=function(){
|
|
17617
17617
|
// console.log('业务终点 Log', this.stateMachineLog)
|
|
17618
17618
|
// TODO 请求
|
|
17619
|
-
},this.historyPush=function(e,t){void 0===t&&(t=oF.ChangeModule),r.moduleStateHistory.unshift(e),r.stateMachineLog[r.order++]={action:t,date:(new Date).getTime(),dataSource:e},r.moduleStateHistory.length>10&&r.moduleStateHistory.splice(10,r.moduleStateHistory.length-10)},this.historyBack=function(e){r.moduleStateHistory.length<=1||(r.moduleStateHistory.splice(0,1),r.stateMachineLog[r.order++]={action:oF.Back,date:(new Date).getTime(),dataSource:e})},this.setConfig=function(e){r.config=e},this.isUseHistoryHijack=function(){var e;return"about:blank"!==(null===(e=r.globalWindow())||void 0===e?void 0:e.location.href)},this.onPopstate=function(){r.back()},this.changeModuleEvent=e,null===(n=this.globalWindow())||void 0===n||n.addEventListener("popstate",this.onPopstate),this.historyPush(t,oF.Init)},fF=function(e,t){return new dF(e,t)},pF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},hF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},vF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},gF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},yF=y().useCallback,bF=y().useEffect,wF=y().useState,CF=function(e,t){var n=gF(wF(!1),2),r=n[0],o=n[1],i=yF((function(){return mF(void 0,void 0,void 0,(function(){var n,r,i,a;return vF(this,(function(s){switch(s.label){case 0:if(!e)return[2/*return*/];s.label=1;case 1:return s.trys.push([1,3,,4]),[4/*yield*/,ma()("".concat(e,"/svg-string/guard
|
|
17619
|
+
},this.historyPush=function(e,t){void 0===t&&(t=oF.ChangeModule),r.moduleStateHistory.unshift(e),r.stateMachineLog[r.order++]={action:t,date:(new Date).getTime(),dataSource:e},r.moduleStateHistory.length>10&&r.moduleStateHistory.splice(10,r.moduleStateHistory.length-10)},this.historyBack=function(e){r.moduleStateHistory.length<=1||(r.moduleStateHistory.splice(0,1),r.stateMachineLog[r.order++]={action:oF.Back,date:(new Date).getTime(),dataSource:e})},this.setConfig=function(e){r.config=e},this.isUseHistoryHijack=function(){var e;return"about:blank"!==(null===(e=r.globalWindow())||void 0===e?void 0:e.location.href)},this.onPopstate=function(){r.back()},this.changeModuleEvent=e,null===(n=this.globalWindow())||void 0===n||n.addEventListener("popstate",this.onPopstate),this.historyPush(t,oF.Init)},fF=function(e,t){return new dF(e,t)},pF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},hF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},vF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},gF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},yF=y().useCallback,bF=y().useEffect,wF=y().useState,CF=function(e,t){var n=gF(wF(!1),2),r=n[0],o=n[1],i=yF((function(){return mF(void 0,void 0,void 0,(function(){var n,r,i,a;return vF(this,(function(s){switch(s.label){case 0:if(!e)return[2/*return*/];s.label=1;case 1:return s.trys.push([1,3,,4]),[4/*yield*/,ma()("".concat(e,"/svg-string/guard"))];case 2:return n=s.sent(),r=n.data,(i=VQ())?(function(e,t){var n=function(){var n=e.createElement("div");n.innerHTML=t;var r=n.getElementsByTagName("svg")[0];r.setAttribute("aria-hidden","true"),r.id="guard-svg-string",r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.overflow="hidden";var o=e.body;o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r)},r=e.readyState;if(["complete","loaded","interactive"].includes(r))setTimeout((function(){n()}),0);else{var o=function(){e.removeEventListener("DOMContentLoaded",o),n()};e.addEventListener("DOMContentLoaded",o)}}(i.document,r),o(!0),[3/*break*/,4]):[2/*return*/];case 3:return a=s.sent(),null==t||t(a),[3/*break*/,4];case 4:return[2/*return*/]}}))}))}),[e,t]);return bF((function(){i()}),[i]),r},EF=y().useEffect,kF=y().useMemo,SF=i(3282),xF=i.n(SF),PF=function(){return PF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PF.apply(this,arguments)},_F=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},TF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},OF=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},NF=y().useCallback,IF=y().useEffect,AF=y().useMemo,RF=y().useState,MF="__authing__multiple_accounts",DF=["email","phone","password","phone-code","email-code","ad","ldap","ldap-password","ldap-email","ldap-phone"],LF=["wechat-miniprogram-qrcode","wechatmp-qrcode","app-qrcode"],FF=LF.concat("social"),jF=function(){var e=this;
|
|
17620
17620
|
/**
|
|
17621
17621
|
* 原始的登录账号
|
|
17622
17622
|
*/this.originAccount="",this.originWay="",
|
|
@@ -17838,7 +17838,7 @@ p(t)}),[p,f]),v=NF((function(e){var t=e.getMemberState()?"multiple":"login";
|
|
|
17838
17838
|
// 根据初始值 初始化数据
|
|
17839
17839
|
m(t,e.getFirstBackFillData())}),[m]);
|
|
17840
17840
|
// 页面状态,两种 'isMultipleAccount' TODO: 改成 reducer
|
|
17841
|
-
return IF((function(){var e;if(t&&n&&!Vc()){var r=
|
|
17841
|
+
return IF((function(){var e;if(t&&n&&!Vc()){var r=eZ(t);if(null==r?void 0:r.enableLoginAccountSwitch){
|
|
17842
17842
|
// 最终支持的登录方式 用于过滤有效登录方式
|
|
17843
17843
|
var o=(null==n?void 0:n.loginMethods)||[],i=(null==n?void 0:n.passwordLoginMethods)||[],a=(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)||!1,s=(new jF).getStore();
|
|
17844
17844
|
// 输入框 邮箱/用户名/手机号 + 密码
|
|
@@ -17860,20 +17860,20 @@ this.isTenantConsole=function(){var e;return null===(e=n.$config)||void 0===e?vo
|
|
|
17860
17860
|
/** 是否为租户【单点登录】 */
|
|
17861
17861
|
this.isTenantSSO=function(){var e;return n.$tenantId&&!1===(null===(e=n.$config)||void 0===e?void 0:e.isTenantDefault)},
|
|
17862
17862
|
/** 是否为租户【单点登录面板】 */
|
|
17863
|
-
this.isTenantSSOLaunchPad=function(){var e;return n.$tenantId&&!0===(null===(e=n.$config)||void 0===e?void 0:e.isTenantDefault)},this.$tenantId=null!=e?e:null,this.$config=null!=t?t:null},$F=function(){return $F=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$F.apply(this,arguments)},zF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},HF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},WF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},GF=y().useCallback,KF=y().useEffect,YF=y().useMemo,JF=y().useReducer,QF=y().useState,ZF=y().useRef,XF=function(e){var t=e.guardProps,n=e.initState,r=e.children,o=t.tenantId,i=t.deviceId,a=t.config,s=WF(QF(Date.now()),2),c=s[0],l=s[1],u=WF(QF(),2),d=u[0],f=u[1],p=WF(QF(),2),h=p[0],m=p[1],v=WF(QF(),2),g=v[0],b=v[1],w=WF(QF(),2),C=w[0],E=w[1],k=WF(QF(),2),S=k[0],x=k[1],P=WF(QF(),2),_=P[0],T=P[1],O=WF(QF(!0),2),N=O[0],I=O[1],A=WF(QF(!1),2),R=A[0],M=A[1],D=ZF({}),L=function(e,t,n){var r=qL(),o=kF((function(){return e||(t&&t.options.appId?t.options.appId:r&&r.options.appId?r.options.appId:void 0)}),[r,e,t]);return EF((function(){o||null==n||n(new Error("appId is required"))}),[o,n]),o}(t.appId,t.authClient,T),F=WF(QF(),2),j=F[0],B=F[1],q=WF(QF(!1),2),U=q[0],V=q[1]
|
|
17863
|
+
this.isTenantSSOLaunchPad=function(){var e;return n.$tenantId&&!0===(null===(e=n.$config)||void 0===e?void 0:e.isTenantDefault)},this.$tenantId=null!=e?e:null,this.$config=null!=t?t:null},$F=function(){return $F=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$F.apply(this,arguments)},zF=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},HF=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},WF=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},GF=y().useCallback,KF=y().useEffect,YF=y().useMemo,JF=y().useReducer,QF=y().useState,ZF=y().useRef,XF=function(e){var t=e.guardProps,n=e.initState,r=e.children,o=t.tenantId,i=t.deviceId,a=t.config,s=WF(QF(Date.now()),2),c=s[0],l=s[1],u=WF(QF(),2),d=u[0],f=u[1],p=WF(QF(),2),h=p[0],m=p[1],v=WF(QF(),2),g=v[0],b=v[1],w=WF(QF(),2),C=w[0],E=w[1],k=WF(QF(),2),S=k[0],x=k[1],P=WF(QF(),2),_=P[0],T=P[1],O=WF(QF(!0),2),N=O[0],I=O[1],A=WF(QF(!1),2),R=A[0],M=A[1],D=ZF({}),L=function(e,t,n){var r=qL(),o=kF((function(){return e||(t&&t.options.appId?t.options.appId:r&&r.options.appId?r.options.appId:void 0)}),[r,e,t]);return EF((function(){o||null==n||n(new Error("appId is required"))}),[o,n]),o}(t.appId,t.authClient,T),F=WF(QF(),2),j=F[0],B=F[1],q=WF(QF(!1),2),U=q[0],V=q[1];$Q(l,L,t.appendConfig);
|
|
17864
17864
|
// 状态机
|
|
17865
17865
|
var $=WF(QF(),2),z=$[0],H=$[1],W=XD((function(){var e=tL.Provider;return{Provider:function(t){var n=t.value,r=t.children;return y().createElement(e,{value:JD(JD({},eL),n)},r)},Consumer:tL.Consumer}}),[]).Provider,G=WF(JF((function(e,t){var n=t.type,r=t.payload;return{moduleName:n,initData:null==r?void 0:r.initData}}),n),2),K=G[0],Y=G[1];
|
|
17866
17866
|
// Flow Handle init
|
|
17867
17867
|
KF((function(){var e;(null===(e=n.initData)||void 0===e?void 0:e.flowHandle)&&PL(n.initData.flowHandle)}),[n.initData]);
|
|
17868
17868
|
// Change Module
|
|
17869
|
-
var J=GF((function(e,t){return void 0===t&&(t={}),zF(void 0,void 0,void 0,(function(){var n;return HF(this,(function(r){switch(r.label){case 0:return(n=!(null==d?void 0:d.onBeforeChangeModule))?[3/*break*/,2]:[4/*yield*/,d.onBeforeChangeModule(e,t)];case 1:n=r.sent(),r.label=2;case 2:return n&&Y({type:e,payload:{initData:null!=t?t:{}}}),[2/*return*/]}}))}))}),[d]),Q=
|
|
17869
|
+
var J=GF((function(e,t){return void 0===t&&(t={}),zF(void 0,void 0,void 0,(function(){var n;return HF(this,(function(r){switch(r.label){case 0:return(n=!(null==d?void 0:d.onBeforeChangeModule))?[3/*break*/,2]:[4/*yield*/,d.onBeforeChangeModule(e,t)];case 1:n=r.sent(),r.label=2;case 2:return n&&Y({type:e,payload:{initData:null!=t?t:{}}}),[2/*return*/]}}))}))}),[d]),Q=sZ(lF(),a);
|
|
17870
17870
|
// 合并默认值
|
|
17871
17871
|
// HttpClient
|
|
17872
|
-
KF((function(){var e;if(L&&Q){var t=
|
|
17872
|
+
KF((function(){var e;if(L&&Q){var t=tQ(Q.host);t.setAppId(L),o&&t.setTenantId(o),i?t.setDeviceId(i):(null==C?void 0:C.deviceFuncEnabled)&&(null===(e=null==h?void 0:h.browserFingerprint)||void 0===e||e.createDevice().then((function(){var e=localStorage.getItem("browserId");e&&t.setDeviceId(e)}))),b(t)}}),[L,Q,o,i,C,h]);
|
|
17873
17873
|
/**
|
|
17874
17874
|
*
|
|
17875
17875
|
*/
|
|
17876
|
-
var Z=
|
|
17876
|
+
var Z=lZ(c,L,Q,g,T),X=Z.finallyConfig,ee=Z.guardPageConfig,te=BF({appId:L,finallyConfig:X}),ne=function(e,t){return UF((function(){if(t)return new VF(e,t)}),[t,e])}(o,C),re=function(e){var t=e.config,n=e.appId,r=e.setError,o=e.tenantId,i=qL(),a=UL(zL(),2),s=a[0],c=a[1];return VL((function(){if(t&&n){var a=t.host,s=t.lang,l=null==e?void 0:e.authClient;
|
|
17877
17877
|
// 优先检测 props 中的 authClient 对象
|
|
17878
17878
|
if(l)try{return HL(l,{appId:n,tenantId:o}),void c(l)}catch(e){r(e)}
|
|
17879
17879
|
// 如果 props 中的 authClient 对象不存在,则检测全局的 authClient 对象
|
|
@@ -17881,11 +17881,11 @@ if(i)try{return HL(i,{appId:n,tenantId:o}),void c(i)}catch(e){r(e)}
|
|
|
17881
17881
|
// 如果全局的 authClient 对象也不存在,则初始化一个新的 authClient 对象
|
|
17882
17882
|
try{var u=kL(),d=new _c({appHost:a,tenantId:o,appId:n,lang:s,requestFrom:"Guard@".concat(u),onError:function(e,t){}});c(d)}catch(e){r(e)}}}),[n,t,i,null==e?void 0:e.authClient,r,o]),$L((function(){s&&(LL=s)}),[s]),s}({config:X,appId:L,tenantId:o,setError:T,authClient:t.authClient}),oe=CF(S);
|
|
17883
17883
|
// SSO 登录
|
|
17884
|
-
KF((function(){(null==a?void 0:a.isSSO)&&h&&d&&g&&pF(void 0,void 0,void 0,(function(){return hF(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,
|
|
17884
|
+
KF((function(){(null==a?void 0:a.isSSO)&&h&&d&&g&&pF(void 0,void 0,void 0,(function(){return hF(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,nQ().get)("/cas/session",{})];case 1:return[2/*return*/,e.sent()]}}))})).then((function(e){var t,n=e;
|
|
17885
17885
|
// 这个接口没有 code, data, 直接返回了数据
|
|
17886
17886
|
n.userInfo&&(null===(t=null==d?void 0:d.onLogin)||void 0===t||t.call(d,n.userInfo,h))}))}),[L,h,null==a?void 0:a.isSSO,d,g]),KF((function(){
|
|
17887
17887
|
// 优先使用用户自定义 host
|
|
17888
|
-
g&&X&&!(null==a?void 0:a.host)&&(null==g||g.setBaseUrl(X.host))}),[X,g]),KF((function(){if(L){var e=
|
|
17888
|
+
g&&X&&!(null==a?void 0:a.host)&&(null==g||g.setBaseUrl(X.host))}),[X,g]),KF((function(){if(L){var e=eZ(L);e&&(E(e),x(e.cdnBase))}}),[L,X]),
|
|
17889
17889
|
// 特殊脚本注入
|
|
17890
17890
|
KF((function(){var e,t,n,r;if(C){var o=id();
|
|
17891
17891
|
// TODO: 脚本后续上传到 oss
|
|
@@ -17907,7 +17907,7 @@ fallbackLng:ud,debug:!1,interpolation:{escapeValue:!1}},[4/*yield*/,su.use(Hu).u
|
|
|
17907
17907
|
// 开始初始化了嗷~
|
|
17908
17908
|
return s.sent(),
|
|
17909
17909
|
// 告知外部i18n初始化完成
|
|
17910
|
-
n(!0),[2/*return*/]}}))})),B(su.
|
|
17910
|
+
n(!0),[2/*return*/]}}))})),B(su.resolvedLanguage)}}),[Q,ee,C,M]),
|
|
17911
17911
|
// AuthClient
|
|
17912
17912
|
KF((function(){m(re)}),[re]),
|
|
17913
17913
|
// initEvents
|
|
@@ -17915,7 +17915,7 @@ KF((function(){if(Q){var e=JL($F({},t),te.instance,null==Q?void 0:Q.openEventsMa
|
|
|
17915
17915
|
// 状态机相关
|
|
17916
17916
|
KF((function(){var e=fF(J,n);return H(e),function(){e.uninstallPopstate()}}),[n,J]),
|
|
17917
17917
|
// 自定义 CSS 处理
|
|
17918
|
-
KF((function(){return X&&X.contentCss&&
|
|
17918
|
+
KF((function(){return X&&X.contentCss&&vQ(X.contentCss,"appConfig"),function(){return gQ("appConfig")}}),[X]),
|
|
17919
17919
|
// 是否使用 Guard auth flow
|
|
17920
17920
|
KF((function(){X&&I(!Boolean(null==X?void 0:X.__unAuthFlow__))}),[X]),
|
|
17921
17921
|
// 是否是国外用户池
|
|
@@ -17923,7 +17923,7 @@ KF((function(){var e=null==X?void 0:X.host;if(L&&e)try{ma().get("".concat(e,"/ap
|
|
|
17923
17923
|
// 保证 store 加载完成
|
|
17924
17924
|
te,
|
|
17925
17925
|
// 保证 i18n 初始化完成
|
|
17926
|
-
R,j,ne];return!e.includes(void 0)&&!e.includes(!1)}),[L,d,Q,X,g,ie,C,h,ee,oe,te,R,j,ne]),se=YF((function(){var e,t,n,r=null!==(n=null===(t=null===(e=null==C?void 0:C.regexRules)||void 0===e?void 0:e.find((function(e){return"phone"===e.key})))||void 0===t?void 0:t.userpoolLevel)&&void 0!==n?n:"";if(r)try{return
|
|
17926
|
+
R,j,ne];return!e.includes(void 0)&&!e.includes(!1)}),[L,d,Q,X,g,ie,C,h,ee,oe,te,R,j,ne]),se=YF((function(){var e,t,n,r=null!==(n=null===(t=null===(e=null==C?void 0:C.regexRules)||void 0===e?void 0:e.find((function(e){return"phone"===e.key})))||void 0===t?void 0:t.userpoolLevel)&&void 0!==n?n:"";if(r)try{return DQ(r)}catch(e){}return null}),[null==C?void 0:C.regexRules]);
|
|
17927
17927
|
// TODO 触发 onLoad 事件
|
|
17928
17928
|
KF((function(){var e;ae&&!_&&(null===(e=null==d?void 0:d.onLoad)||void 0===e||e.call(d,h))}),[h,ae,_,d]);var ce=YF((function(){return ae?$F($F({contextLoaded:ae,isAuthFlow:N,defaultMergedConfig:Q,finallyConfig:X,publicConfig:C,httpClient:g,appId:L,tenantId:o,events:d},ie),{initData:K.initData,currentModule:K,guardPageConfig:ee,
|
|
17929
17929
|
// 多账号相关信息 store 实例
|
|
@@ -17980,7 +17980,7 @@ c=c.filter((function(e){return!aj(aj([],ij(p),!1),ij(k),!1).includes(e.provider)
|
|
|
17980
17980
|
// pc 浏览器
|
|
17981
17981
|
default:var S=[Hs.WECHATMP,"wechatwork:mobile"],x=[Hs.WECHATMP];
|
|
17982
17982
|
// 各个浏览器下特殊的身份源隐藏规则
|
|
17983
|
-
c=c.filter((function(e){return!aj(aj([],ij(p),!1),ij(x),!1).includes(e.provider)})).map((function(e){return S.includes(e.provider)?e.action=tj.Message:e.action=tj.Auth,e})),s=s.filter((function(e){return!((null==e?void 0:e.provider)&&p.includes(e.provider))})).map((function(e){return S.includes(e.provider)?e.action=tj.Message:e.action=tj.Auth,e}))}var P=
|
|
17983
|
+
c=c.filter((function(e){return!aj(aj([],ij(p),!1),ij(x),!1).includes(e.provider)})).map((function(e){return S.includes(e.provider)?e.action=tj.Message:e.action=tj.Auth,e})),s=s.filter((function(e){return!((null==e?void 0:e.provider)&&p.includes(e.provider))})).map((function(e){return S.includes(e.provider)?e.action=tj.Message:e.action=tj.Auth,e}))}var P=VQ();if(P){(null==l?void 0:l.isHost)||!Uc()&&P.postMessage||(
|
|
17984
17984
|
// 嵌入模式下特殊浏览器不显示所有身份源登录
|
|
17985
17985
|
c=[],s=[])
|
|
17986
17986
|
/** 过滤掉企业身份源中开启内嵌模式的身份源连接 如:企业微信自建 钉钉 */,s=s.filter((function(e){return!(null==e?void 0:e.embedded)}));var _=d&&(!(null==u?void 0:u.ssoPageComponentDisplay.socialLoginBtns)||!c.length)&&(!(null==u?void 0:u.ssoPageComponentDisplay.idpBtns)||!s.length);return[c,s,_]}},fj=function(){return fj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fj.apply(this,arguments)},pj=y().useMemo,hj=function(e){var t=rL().spin,n=e.type,r=pj((function(){return t}),[t]),o=pj((function(){var t=e.className;return n&&(t+=" guard-button-link-like"),r&&(t+=" guard-button-disabled"),t}),[r,e,n]);return y().createElement(cy,fj({},e,{className:o,onClick:function(t){r||e.onClick&&e.onClick(t)}}))},mj=function(){return mj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mj.apply(this,arguments)},vj=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},gj=y().forwardRef,yj=y().useState,bj=y().useImperativeHandle,wj=y().useEffect;
|
|
@@ -17988,7 +17988,7 @@ c=[],s=[])
|
|
|
17988
17988
|
wj((function(){var e;return!0===g&&(e=setTimeout((function(){E()}),820)),function(){clearTimeout(e)}}),[E,g]),bj(t,(function(){return{onError:function(e){var t;m(!1),b(!0),d(!1),t=setTimeout((function(){C(),clearTimeout(t)}))},onSpin:function(e){m(e),d(e)}}}));var k=e.className?e.className:"";
|
|
17989
17989
|
// let shakingCls = shaking ? 'shaking' : ''
|
|
17990
17990
|
return y().createElement(hj,mj({},e,{size:null!==(n=null==e?void 0:e.size)&&void 0!==n?n:"large",type:null!==(r=null==e?void 0:e.type)&&void 0!==r?r:"primary",htmlType:null!==(o=null==e?void 0:e.htmlType)&&void 0!==o?o:"submit",loading:h,disabled:!!f||(null!==(i=null==e?void 0:e.disabled)&&void 0!==i?i:h),onClick:e.onClick?e.onClick:function(){},className:"authing-g2-submit-button ".concat(k," ").concat("")}),e.text)}));// CONCATENATED MODULE: ./src/BindTotp/businessRequest.ts
|
|
17991
|
-
var Ej,kj=function(){return kj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kj.apply(this,arguments)},Sj=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},xj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.VerifyTotpFirstTime="verify-totp-first-time",e.ConfirmTotpRecoveryCode="confirm-totp-recovery-code"}(Ej||(Ej={}));var Pj,_j=function(e,t){return Sj(void 0,void 0,void 0,(function(){return xj(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,
|
|
17991
|
+
var Ej,kj=function(){return kj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kj.apply(this,arguments)},Sj=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},xj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.VerifyTotpFirstTime="verify-totp-first-time",e.ConfirmTotpRecoveryCode="confirm-totp-recovery-code"}(Ej||(Ej={}));var Pj,_j=function(e,t){return Sj(void 0,void 0,void 0,(function(){return xj(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(e,kj({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},Tj=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Oj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Nj=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ij=y().useRef,Aj=hM.Paragraph,Rj=function(e){var t=e.secret,n=e.onBind,r=Ij(null),o=Nj(sT.useForm(),1)[0],i=Pu().t,a=pL();
|
|
17992
17992
|
// const [isSaved, setIsSaved] = useState(false)
|
|
17993
17993
|
return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},i("common.totpText1")),y().createElement("p",{className:"authing-g2-mfa-tips"},i("common.totpText2")),y().createElement("div",{className:"g2-mfa-bindTotp-copySecret"},y().createElement(Aj,{copyable:!0},t)),y().createElement(sT,{form:o,onFinish:function(){return Tj(void 0,void 0,void 0,(function(){var e,t,i,s,c,l,u,d;return Oj(this,(function(f){switch(f.label){case 0:return null===(c=r.current)||void 0===c||c.onSpin(!0),[4/*yield*/,o.validateFields()];case 1:return f.sent(),a?[4/*yield*/,_j(Ej.ConfirmTotpRecoveryCode,{})]:[3/*break*/,3];case 2:return e=f.sent(),t=e.data,i=e.isFlowEnd,s=e.onGuardHandling,null===(l=r.current)||void 0===l||l.onSpin(!1),i?n(t):(
|
|
17994
17994
|
// TODO 需要 onError 抖动吗 当 from 表单校验通过的时候 onError 是没有意义的
|
|
@@ -17996,11 +17996,11 @@ null===(u=r.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,4];case
|
|
|
17996
17996
|
// size 存在,说明是正方形,让宽高等于 size
|
|
17997
17997
|
l=e.size,u=e.size):(
|
|
17998
17998
|
// 如果 size 不存在,说明长方形,尝试读取宽高
|
|
17999
|
-
l=e.width?e.width:"auto",u=e.height?e.height:"auto"),y().createElement("div",{style:{width:l,height:u},className:
|
|
17999
|
+
l=e.width?e.width:"auto",u=e.height?e.height:"auto"),y().createElement("div",{style:{width:l,height:u},className:yQ(["g2-base-imagepro-container","g2-base-image-background-animation",s?"loaded":"unload",null==e?void 0:e.className])},y().createElement("img",Mj({},i,{style:Mj({width:l,height:"100%",borderRadius:t},o),className:"g2-base-imagepro",draggable:!1,alt:r||"image",onLoad:function(){return c(!0)}})))},qj=function(e){var t=e.borderRadius,n=e.noSpin,r=e.alt,o=e.style,i=Dj(e,["borderRadius","noSpin","alt","style"]),a=Lj(jj(!0===n),2),s=a[0],c=a[1],l=Fj(null),u=0,d=0;return e.size?(
|
|
18000
18000
|
// size 存在,说明是正方形,让宽高等于 size
|
|
18001
18001
|
u=e.size,d=e.size):(
|
|
18002
18002
|
// 如果 size 不存在,说明长方形,尝试读取宽高
|
|
18003
|
-
u=e.width?e.width:"auto",d=e.height?e.height:"auto"),y().createElement("div",{style:{width:u,height:d},className:
|
|
18003
|
+
u=e.width?e.width:"auto",d=e.height?e.height:"auto"),y().createElement("div",{style:{width:u,height:d},className:yQ(["g2-base-imagepro-container","g2-base-imagepro-container2","g2-base-image-background-animation",s?"loaded":"unload",null==e?void 0:e.className]),onClick:function(t){c(!1),(null==e?void 0:e.onClick)&&(null==e||e.onClick(t)),l.current&&l.current.classList.remove("g2-base-imagepro-mask-show")},id:"g2-base-imagepro-container",onMouseMove:function(){l.current&&l.current.classList.add("g2-base-imagepro-mask-show")}},y().createElement("img",Mj({},i,{style:Mj({width:u,height:"100%",borderRadius:t},o),className:"g2-base-imagepro",draggable:!1,alt:r||"image",onLoad:function(){return c(!0)}})),s&&y().createElement("div",{className:"g2-base-imagepro-mask",ref:l},y().createElement("span",{style:{marginRight:4}},su.t("login.verifyCodeTip")),y().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y().createElement("g",{"clip-path":"url(#clip0_968_21911)"},y().createElement("path",{d:"M3.64204 2.95599C4.85175 1.90776 6.39937 1.33176 8.00004 1.33399C11.682 1.33399 14.6667 4.31866 14.6667 8.00066C14.6667 9.42466 14.22 10.7447 13.46 11.8273L11.3334 8.00066H13.3334C13.3335 6.95507 13.0262 5.93253 12.4498 5.06016C11.8734 4.1878 11.0533 3.5041 10.0915 3.09407C9.12966 2.68405 8.06852 2.56579 7.04001 2.754C6.01151 2.94221 5.06101 3.42859 4.30671 4.15266L3.64204 2.95599ZM12.358 13.0453C11.1483 14.0935 9.60072 14.6696 8.00004 14.6673C4.31804 14.6673 1.33337 11.6827 1.33337 8.00066C1.33337 6.57666 1.78004 5.25666 2.54004 4.17399L4.66671 8.00066H2.66671C2.66662 9.04624 2.97388 10.0688 3.55027 10.9412C4.12665 11.8135 4.94675 12.4972 5.90859 12.9072C6.87042 13.3173 7.93156 13.4355 8.96007 13.2473C9.98857 13.0591 10.9391 12.5727 11.6934 11.8487L12.358 13.0453Z",fill:"white"})),y().createElement("defs",null,y().createElement("clipPath",{id:"clip0_968_21911"},y().createElement("rect",{width:"16",height:"16",fill:"white"}))))),!s&&y().createElement(hj,{className:"g2-base-imagepro-mask g2-base-imagepro-loading",loading:!0}))},Uj=function(){return Uj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Uj.apply(this,arguments)},Vj=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},$j=function(e){var t=Pu().t,n=e.codeLength,r=e.ruleKeyword,o=void 0===r?t("common.captchaCode"):r,i=Vj(e,["codeLength","ruleKeyword"]);return y().createElement(sT.Item,Uj({validateTrigger:["onChange"],name:"mfaCode",className:"g2-mfa-totp-verify-input",validateFirst:!0,rules:[{type:"array",validateTrigger:["onChange"],message:t("common.isMissing",{name:o}),required:!0},{type:"array",validateTrigger:[""],message:t("common.fullCaptchaCode",{name:o}),min:n}]},i))},zj=function(){return zj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zj.apply(this,arguments)},Hj=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Wj=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Gj=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Kj=y().Fragment,Yj=y().useCallback,Jj=y().useEffect,Qj=y().useRef,Zj=y().useState,Xj=function(e){var t=e.length,n=void 0===t?4:t,r=e.size,o=void 0===r?"46px":r,i=e.gutter,a=void 0===i?n>4?"14px":"24px":i,s=(e.className,e.onEenter),c=e.showDivider,l=e.onChange,u=e.value,d=e.onFinish,f=Hj(e,["length","size","gutter","className","onEenter","showDivider","onChange","value","onFinish"]),p=Qj([]),h=Qj(null),m=Qj(!1),v=Wj(Zj(null!=u?u:[]),2),g=v[0],b=v[1],w=Wj(Zj(0),2),C=w[0],E=w[1];
|
|
18004
18004
|
// 聚焦控制
|
|
18005
18005
|
Jj((function(){p.current[C].focus()}),[C]);var k=Yj((function(e){
|
|
18006
18006
|
// const filteredCodes = codes.filter((code) => !!code)
|
|
@@ -18014,7 +18014,7 @@ if(!e.nativeEvent.isComposing){var r=e.target.value;
|
|
|
18014
18014
|
* ios 下 otp 自动填充在chrome内核浏览器下会触发两次 并且第一次会直接塞otp复制的值(maxlength 限制无效) 如 1246 第二次则根据maxlength 截取塞 12
|
|
18015
18015
|
* 针对这种情况取第一次值隔离第二次调用
|
|
18016
18016
|
* safari 是单个input 塞对应的值
|
|
18017
|
-
*/if(r.length===n)return m.current=!0,k(r.split("")),void E(n-1);var o=g[t]||"",i=r.split("").filter((function(e){return e!==o}))[0]||r.slice(-1);S(i,t)}},pattern:"[0-9]*",type:"tel"}),c&&t===Math.floor(n/2-1)&&y().createElement(wS,{className:"authing-g2-code-input-divider"}))})))},eB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},nB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rB=y().useRef,oB=function(e){var t=e.mfaToken,n=e.qrcode,r=e.onNext,o=e.changeModule,i=nB(sT.useForm(),1)[0],a=rB(null),s=Pu().t,c=
|
|
18017
|
+
*/if(r.length===n)return m.current=!0,k(r.split("")),void E(n-1);var o=g[t]||"",i=r.split("").filter((function(e){return e!==o}))[0]||r.slice(-1);S(i,t)}},pattern:"[0-9]*",type:"tel"}),c&&t===Math.floor(n/2-1)&&y().createElement(wS,{className:"authing-g2-code-input-divider"}))})))},eB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},nB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rB=y().useRef,oB=function(e){var t=e.mfaToken,n=e.qrcode,r=e.onNext,o=e.changeModule,i=nB(sT.useForm(),1)[0],a=rB(null),s=Pu().t,c=rQ().post,l=pL(),u=nB(ej((function(){return eB(void 0,void 0,void 0,(function(){var e,n,o,s,u,d,f,p,h,m,v,g;return tB(this,(function(y){switch(y.label){case 0:return null===(p=a.current)||void 0===p||p.onSpin(!0),[4/*yield*/,i.validateFields()];case 1:return y.sent(),e=i.getFieldValue("saftyCode"),l?[4/*yield*/,_j(Ej.VerifyTotpFirstTime,{totp:e.join("")})]:[3/*break*/,3];case 2:return n=y.sent(),o=n.statusCode,f=n.onGuardHandling,null===(h=a.current)||void 0===h||h.onSpin(!1),200===o?r():(null===(m=a.current)||void 0===m||m.onError(),null==f||f()),[3/*break*/,5];case 3:return[4/*yield*/,c("/api/v2/mfa/totp/associate/confirm",{authenticator_type:"totp",totp:e.join(""),source:"APPLICATION"},{headers:{authorization:t}})];case 4:s=y.sent(),u=s.code,d=s.data,f=s.onGuardHandling,null===(v=a.current)||void 0===v||v.onSpin(!1),200===u?r(d):(null===(g=a.current)||void 0===g||g.onError(),null==f||f()),y.label=5;case 5:return[2/*return*/]}}))}))}),[t]),2),d=u[1];return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},s("user.mfaBind")),y().createElement("p",{className:"authing-g2-mfa-tips",style:{textAlign:"left"}},s("common.usePhoneOpen"),"(",s("common.noValidator")," ",y().createElement("span",{style:{color:"#215AE5",cursor:"pointer"},onClick:function(){null==o||o(ML.DOWNLOAD_AT)}},s("common.clickTodownload")),") ",s("common.mfaText1")),y().createElement(Bj,{className:"g2-mfa-bindTotp-qrcode",src:n,alt:"qrcode"}),y().createElement(sT,{className:"g2-mfa-bindTotp-securityCode-form",form:i,onSubmitCapture:function(){},onFinish:d,onFinishFailed:function(){a.current.onError()}},y().createElement($j,{codeLength:6,name:"saftyCode",ruleKeyword:s("user.numberSafteyCode")},y().createElement(Xj,{length:6,showDivider:!1,gutter:"10px",onFinish:d})),y().createElement(Cj,{text:s("user.nextStep"),ref:a})))},iB=function(){return iB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},iB.apply(this,arguments)};iB(iB({},Ac()),{autoRegister:!1});!function(e){e.SMS="SMS",e.EMAIL="EMAIL",e.TOTP="OTP",e.FACE="FACE"}(Pj||(Pj={}));// CONCATENATED MODULE: ./src/Back/index.tsx
|
|
18018
18018
|
var aB=y().useCallback,sB=y().useMemo,cB=function(e){var t=dL().changeModule,n=fL(),r=Pu().t,o=aB((function(){return null==t?void 0:t(ML.LOGIN)}),[t]),i=e.isRender,a=void 0===i||i,s=sB((function(){if(!a)return null;var e=[ML.LOGIN,ML.REGISTER];
|
|
18019
18019
|
// 初始场景不是 登录 或者注册时候,不显示返回按钮
|
|
18020
18020
|
return n.defaultScenes&&!e.includes(n.defaultScenes)?null:y().createElement(hj,{type:"link",onClick:o,className:"g2-view-mfa-back-hover"},y().createElement(YD,{type:"authing-arrow-left-s-line",style:{fontSize:24}}),y().createElement("span",null,r("common.backLoginPage")))}),[a,n.defaultScenes,o,r]);return y().createElement("div",{className:"g2-view-back",style:{display:"inherit"}},s)},lB=function(e){var t=dL().changeModule,n=Pu().t,r=e.onBack,o=void 0===r?function(){return null==t?void 0:t(ML.LOGIN)}:r,i=e.isRender,a=void 0===i||i,s=e.children,c=void 0===s?n("common.backLoginPage"):s,l=sB((function(){return a?y().createElement(hj,{type:"link",onClick:o,className:"g2-view-mfa-back-hover"},y().createElement(YD,{type:"authing-arrow-left-s-line",style:{fontSize:24}}),y().createElement("span",null,c)):null}),[c,a,o]);return y().createElement("div",{className:"g2-view-back",style:{display:"inherit"}},l)},uB=function(){return uB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uB.apply(this,arguments)},dB=y().useEffect;function fB(e){void 0===e&&(e={});var t=e.currentTab,n=e.changeTab,r=dL(),o=r.changeModule,i=r.currentModule,a=uL(),s=hL().isMultipleAccount;
|
|
@@ -18022,53 +18022,51 @@ return n.defaultScenes&&!e.includes(n.defaultScenes)?null:y().createElement(hj,{
|
|
|
18022
18022
|
// 为避免 Guard 组件多次渲染及复杂的依赖创建及销毁判断
|
|
18023
18023
|
// 直接将其挂载到 window 上最方便
|
|
18024
18024
|
dB((function(){var e;window.$$guard=Object.assign({},window.$$guard,{viewContext:uB(uB({},null===(e=window.$$guard)||void 0===e?void 0:e.viewContext),{changeModule:o,changeTab:n})})}),[o,n]),dB((function(){var e,n=i.moduleName;t&&(n+=":".concat(t)),window.$$guard=Object.assign({},window.$$guard,{viewContext:uB(uB({},null===(e=window.$$guard)||void 0===e?void 0:e.viewContext),{currentModule:i.moduleName,currentTab:t,currentView:n})}),(null==a?void 0:a.onAfterChangeModule)&&!s&&i&&a.onAfterChangeModule({currentView:n,currentModule:i.moduleName,currentTab:t,data:i.initData})}),[i,t,a,s])}// CONCATENATED MODULE: ./src/BindTotp/index.tsx
|
|
18025
|
-
var pB,hB=function(){return hB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hB.apply(this,arguments)},mB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},vB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},gB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};!function(e){e.SECURITY_CODE="securityCode",e.BIND_SUCCESS="bindSuccess"}(pB||(pB={}));var yB=y().useEffect,bB=y().useMemo,wB=y().useState,CB=function(){var e=cL(),t=uL(),n=dL().changeModule,r=
|
|
18025
|
+
var pB,hB=function(){return hB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hB.apply(this,arguments)},mB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},vB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},gB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};!function(e){e.SECURITY_CODE="securityCode",e.BIND_SUCCESS="bindSuccess"}(pB||(pB={}));var yB=y().useEffect,bB=y().useMemo,wB=y().useState,CB=function(){var e=cL(),t=uL(),n=dL().changeModule,r=rQ(),o=r.get,i=r.post,a=pL();fB();var s=Pu().t,c=gB(wB(""),2),l=c[0],u=c[1],d=gB(wB(""),2),f=d[0],p=d[1],h=gB(wB(),2),m=h[0],v=h[1],g=gB(wB(pB.SECURITY_CODE),2),b=g[0],w=g[1],C=WL(),E=gB(ej((function(){return mB(void 0,void 0,void 0,(function(){var t,r,a,s,c,l,d,f,h,m;return vB(this,(function(v){switch(v.label){case 0:t={
|
|
18026
18026
|
// type: 'totp',
|
|
18027
18027
|
source:"APPLICATION"},r={headers:{authorization:e.mfaToken}},v.label=1;case 1:return v.trys.push([1,3,,4]),[4/*yield*/,o("/api/v2/mfa/authenticator",t,r)];case 2:return a=v.sent(),f=a.code,s=a.message,f===qF.LOGIN_INVALID?(vC.error(s),null==n||n(ML.LOGIN,{}),[2/*return*/]):[3/*break*/,4];case 3:return c=v.sent(),vC.error(null==c?void 0:c.message),[3/*break*/,4];case 4:return v.trys.push([4,6,,7]),[4/*yield*/,i("/api/v2/mfa/totp/associate",t,r)];case 5:return l=v.sent(),d=l.data,f=l.code,h=l.onGuardHandling,200===f?(u(d.recovery_code),p(d.qrcode_data_url)):null==h||h(),[3/*break*/,7];case 6:return m=v.sent(),vC.error(null==m?void 0:m.message),[3/*break*/,7];case 7:return[2/*return*/]}}))}))}),[]),2),k=E[0],S=E[1];yB((function(){S()}),[S]);var x=bB((function(){var e;return(e={})[pB.SECURITY_CODE]=function(e){return y().createElement(oB,hB({},e))},e[pB.BIND_SUCCESS]=function(e){return y().createElement(Rj,hB({},e))},e}),[]),P=bB((function(){return y().createElement(lB,{onBack:function(){null==n||n(ML.MFA,hB(hB({},e),{current:Pj.TOTP}))}},s("common.backToVerify"))}),[n,e,s]);return y().createElement(y().Fragment,null,k.loading?y().createElement(aF,null):y().createElement("div",{className:"g2-view-container g2-bind-totp"},P,y().createElement("div",{className:"g2-mfa-content g2-mfa-bindTotp"},k.loading?y().createElement(iF,null):x[b]({mfaToken:e.mfaToken,qrcode:f,secret:l,onBind:function(e){var n,r;a&&e?null===(n=null==t?void 0:t.onLogin)||void 0===n||n.call(t,e,C):m&&(null===(r=null==t?void 0:t.onLogin)||void 0===r||r.call(t,m,C))},onNext:function(e){a||v(e),w(pB.BIND_SUCCESS)},changeModule:n}))))},EB=function(){return EB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},EB.apply(this,arguments)},kB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},SB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xB=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},PB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_B=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},TB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},OB=y().useCallback,NB=y().useState,IB=function(e){var t=TB(NB(),2),n=t[0],r=t[1];return OB((function(t,o){return PB(void 0,void 0,void 0,(function(){return _B(this,(function(t){return n&&clearTimeout(n),[2/*return*/,new Promise((function(t,n){var i=setTimeout((function(){e(o,t,n)}),500);r(i)}))]}))}))}),[e,n])},AB=function(){return AB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},AB.apply(this,arguments)},RB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},MB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},DB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},LB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},FB=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},jB=y().useMemo,BB=function(e){var t,n,r,o=e.checkRepeat,i=void 0!==o&&o,a=e.checkExist,s=void 0!==a&&a,c=e.method,l=e.name,u=e.required,d=e.areaCode,//国际化区号
|
|
18028
18028
|
f=e.isCheckPattern,//国际化区号
|
|
18029
|
-
p=void 0===f||f,h=DB(e,["checkRepeat","checkExist","method","name","required","areaCode","isCheckPattern"]),m=oL(),v=
|
|
18029
|
+
p=void 0===f||f,h=DB(e,["checkRepeat","checkExist","method","name","required","areaCode","isCheckPattern"]),m=oL(),v=rQ().get,g=Pu().t,b=jB((function(){var e;return(null===(e=m.internationalSmsConfig)||void 0===e?void 0:e.enabled)&&"phone"===c&&p}),[p,c,null===(t=m.internationalSmsConfig)||void 0===t?void 0:t.enabled]),w=mL(),C=jB((function(){var e;return"email"===c?{field:g("common.emailLabel"),checkRepeatErrorMessage:g("common.checkEmail"),formatErrorMessage:g("common.emailFormatError"),checkExistErrorMessage:g("common.noFindEmail"),pattern:dQ.email}:"username"===c?{field:g("common.username"),checkRepeatErrorMessage:g("common.checkUserName"),checkExistErrorMessage:g("common.noFindUsername"),formatErrorMessage:g("common.usernameFormatError"),pattern:dQ.username}:"phone"===c?{field:g("common.phone"),checkRepeatErrorMessage:g("common.checkPhone"),checkExistErrorMessage:g("common.noFindPhone"),formatErrorMessage:g("common.phoneFormateError"),pattern:!p&&(null===(e=m.internationalSmsConfig)||void 0===e?void 0:e.enabled)?/^[0-9]*$/:w||dQ.phone}:{field:g("common.account"),checkRepeatErrorMessage:g("common.checkCustomName"),checkExistErrorMessage:g("common.noFindUsername"),formatErrorMessage:g("common.customNameFormatError"),pattern:dQ.username};
|
|
18030
18030
|
// 自定义字段
|
|
18031
18031
|
}),[p,c,null===(n=m.internationalSmsConfig)||void 0===n?void 0:n.enabled,g,w]),E=IB((function(e,t,n){v("/api/v2/users/find",{userPoolId:null==m?void 0:m.userPoolId,key:e,type:c}).then((function(e){var r=e.data;s&&(Boolean(r)?t(!0):n(C.checkExistErrorMessage)),i&&(Boolean(r)?n(C.checkRepeatErrorMessage):t(!0))}))})),k=jB((function(){return b?{validateTrigger:"onBlur",validator:function(e,t){return RB(void 0,void 0,void 0,(function(){return MB(this,(function(e){return!t||(0,rj.phone)(t,{country:d}).isValid?[2/*return*/,Promise.resolve()]:[2/*return*/,Promise.reject(g("common.internationPhoneMessage"))]}))}))}}:{validateTrigger:"onBlur",pattern:C.pattern,message:C.formatErrorMessage}}),[d,b,C.formatErrorMessage,C.pattern,g]),S=jB((function(){
|
|
18032
18032
|
// 如果不是必填就不校验
|
|
18033
18033
|
if(!1===u)return[];
|
|
18034
18034
|
// 必填项的默认校验规则
|
|
18035
|
-
var e=FB([],LB(
|
|
18035
|
+
var e=FB([],LB(pQ(C.field)),!1);
|
|
18036
18036
|
// 格式校验
|
|
18037
18037
|
return e.push(k),
|
|
18038
18038
|
// 是否校验重复
|
|
18039
|
-
(i||s)&&e.push({validator:E,validateTrigger:[]}),e}),[u,C.field,k,i,s,E]);return y().createElement(sT.Item,AB({validateFirst:!0,validateTrigger:["onBlur","onChange"],rules:FB(FB([],LB(S),!1),LB(null!==(r=null==h?void 0:h.rules)&&void 0!==r?r:[]),!1),name:null!=l?l:c},h))},qB=sT.Item;qB.Password=function(e){var t,n=e.rules,r=e.fieldRequiredRuleMessage,o=kB(e,["rules","fieldRequiredRuleMessage"]),i=oL(),a=cL(),s=i.passwordStrength,c=i.customPasswordStrength,l=a.passwordStrength,u=a.customPasswordStrength,d=a.userId;return(l||u)&&(s=l,c=u),i?y().createElement(sT.Item,EB({validateTrigger:["onChange","onBlur"],validateFirst:!0,name:"password",rules:xB(xB([],SB(null!==(t=
|
|
18039
|
+
(i||s)&&e.push({validator:E,validateTrigger:[]}),e}),[u,C.field,k,i,s,E]);return y().createElement(sT.Item,AB({validateFirst:!0,validateTrigger:["onBlur","onChange"],rules:FB(FB([],LB(S),!1),LB(null!==(r=null==h?void 0:h.rules)&&void 0!==r?r:[]),!1),name:null!=l?l:c},h))},qB=sT.Item;qB.Password=function(e){var t,n=e.rules,r=e.fieldRequiredRuleMessage,o=kB(e,["rules","fieldRequiredRuleMessage"]),i=oL(),a=cL(),s=i.passwordStrength,c=i.customPasswordStrength,l=a.passwordStrength,u=a.customPasswordStrength,d=a.userId;return(l||u)&&(s=l,c=u),i?y().createElement(sT.Item,EB({validateTrigger:["onChange","onBlur"],validateFirst:!0,name:"password",rules:xB(xB([],SB(null!==(t=SQ(s,c,r,d))&&void 0!==t?t:[]),!1),SB(null!=n?n:[]),!1)},o)):y().createElement(sT.Item,EB({},e))},qB.Email=function(e){return y().createElement(BB,AB({required:!0,method:"email"},e))},qB.Phone=function(e){return y().createElement(BB,AB({required:!0,method:"phone"},e))},qB.UserName=function(e){return y().createElement(BB,AB({required:!0,method:"username"},e))},qB.CustomName=function(e){return y().createElement(BB,AB({required:!0},e))};
|
|
18040
18040
|
/* harmony default export */const UB=qB;// CONCATENATED MODULE: ./src/InputPassword/index.tsx
|
|
18041
|
-
var VB,$B=function(){return $B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$B.apply(this,arguments)},zB=function(e){return y().createElement(rO.Password,$B({autoComplete:"off"},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(YD,{type:"authing-a-eye-line1"}):y().createElement(YD,{type:"authing-a-eye-close-line1"}))}}))},HB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},WB=y().useState,GB=function(){var e=Pu().t,t=HB(WB(!1),2),n=t[0];return{setPasswordErrorTextShow:t[1],getPassWordUnsafeText:function(){return y().createElement(y().Fragment,null,n?y().createElement("div",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},e("common.passwordUnsafeTip")):y().createElement(y().Fragment,null))}}},KB=function(){return KB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KB.apply(this,arguments)},YB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZB=y().useRef,XB=y().useCallback,eq=function(){var e=Pu().t,t=uL(),n=QB(sT.useForm(),1)[0],r=lj().isPhoneMedia,o=
|
|
18041
|
+
var VB,$B=function(){return $B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$B.apply(this,arguments)},zB=function(e){return y().createElement(rO.Password,$B({autoComplete:"off"},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(YD,{type:"authing-a-eye-line1"}):y().createElement(YD,{type:"authing-a-eye-close-line1"}))}}))},HB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},WB=y().useState,GB=function(){var e=Pu().t,t=HB(WB(!1),2),n=t[0];return{setPasswordErrorTextShow:t[1],getPassWordUnsafeText:function(){return y().createElement(y().Fragment,null,n?y().createElement("div",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},e("common.passwordUnsafeTip")):y().createElement(y().Fragment,null))}}},KB=function(){return KB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KB.apply(this,arguments)},YB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JB=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZB=y().useRef,XB=y().useCallback,eq=function(){var e=Pu().t,t=uL(),n=QB(sT.useForm(),1)[0],r=lj().isPhoneMedia,o=nQ().post,i=cL(),a=i.businessRequestName,s=i.content,c=i.isChangeComplete,l=i.onRegisterSuccess,u=i.onRegisterFailed,d=ZB(null),f=dL().changeModule,p=oL().publicKey,h=WL().options.encryptFunction,m=GB(),v=m.getPassWordUnsafeText,g=m.setPasswordErrorTextShow,b=XB((function(e){return YB(void 0,void 0,void 0,(function(){var n,r,i,m,v,y,b,w,C,E,k,S,x,P;return JB(this,(function(_){switch(_.label){case 0:return[4/*yield*/,h(e.password,p)];case 1:return n=_.sent(),null===(C=d.current)||void 0===C||C.onSpin(!0),c?(
|
|
18042
18042
|
// 需要进行信息补全
|
|
18043
|
-
null==f||f(ML.REGISTER_COMPLETE_INFO,{businessRequestName:a,content:KB(KB({},s),{password:n}),onRegisterSuccess:l,onRegisterFailed:u}),[2/*return*/]):[3/*break*/,2];case 2:return _.trys.push([2,7,,8]),"registerByEmailCode"!==a?[3/*break*/,4]:[4/*yield*/,o("/api/v2/register-email-code",KB(KB({},s),{password:n,postUserInfoPipeline:!1}))];case 3:return r=_.sent(),v=r.statusCode,y=r.apiCode,m=r.data,b=r.onGuardHandling,w=r.message,d.current.onSpin(!1),200===v?l(m):(v===lQ.UNSAFE_PASSWORD_TIP&&g(!0),null==b||b(),u(y,m,w),null===(E=null==t?void 0:t.onRegisterError)||void 0===E||E.call(t,{code:y,data:m,message:w})),[3/*break*/,6];case 4:return"registerByPhoneCode"!==a?[3/*break*/,6]:[4/*yield*/,o("/api/v2/register-phone-code",KB(KB({},s),{password:n,postUserInfoPipeline:!1}))];case 5:i=_.sent(),m=i.data,v=i.statusCode,y=i.apiCode,b=i.onGuardHandling,w=i.message,200===v?(null===(k=d.current)||void 0===k||k.onSpin(!1),l(m)):(y===lQ.UNSAFE_PASSWORD_TIP&&g(!0),null==b||b(),null===(S=d.current)||void 0===S||S.onSpin(!1),u(y,m,w),null===(x=null==t?void 0:t.onRegisterError)||void 0===x||x.call(t,{apiCode:y,data:m,message:w})),_.label=6;case 6:return[3/*break*/,8];case 7:return _.sent(),null===(P=d.current)||void 0===P||P.onSpin(!1),[3/*break*/,8];case 8:return[2/*return*/]}}))}))}),[a,f,s,h,t,c,u,l,o,p,g]);return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:n,onFinish:b,onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!r,className:"authing-g2-input",size:"large",placeholder:e("login.inputPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(t,r){var o=n.getFieldValue("password");return r?r!==o?Promise.reject(e("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(e("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:e("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),v(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:e("common.confirm"),ref:d}))))},tq=function(){return tq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tq.apply(this,arguments)},nq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.ResetPassword="reset-password-first-time",e.FirstLoginReset="reset-password-forced",e.ResetPasswordStrengthDetection="reset-password-strength-detection"}(VB||(VB={}));var oq,iq,aq,sq,cq=function(e,t){return nq(void 0,void 0,void 0,(function(){return rq(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,RQ().authFlow)(e,tq({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},lq=i(5996),uq=i.n(lq),dq=function(){return dq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dq.apply(this,arguments)},fq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},pq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},hq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},mq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},vq=y().useState,gq=y().useRef,yq=y().useEffect,bq=y().useMemo,wq=function(e){var t,n=Pu().t,r=e.sendDesc,o=void 0===r?n("login.reSent"):r,i=e.beforeSend,a=e.btnRef,s=e.setSent,c=hq(e,["sendDesc","beforeSend","btnRef","setSent"]),l=function(e){var t=mq(vq(0),2),n=t[0],r=t[1],o=gq(0);return yq((function(){return function(){return clearInterval(o.current)}}),[]),yq((function(){n<=0?(clearInterval(o.current),null==e||e(!1)):null==e||e(!0)}),[n,e]),{enabled:bq((function(){return n<=0}),[n]),send:function(){r(60),o.current=setInterval((function(){r((function(e){return e-1}))}),1e3)},countDown:n}}(s),u=l.enabled,d=l.send,f=l.countDown,p=mq(vq(!1),2),h=p[0],m=p[1],v=bq((function(){return!u||h}),[u,h]);return y().createElement(cy,dq({},c,{className:uq()("".concat(null!==(t=c.type)&&void 0!==t?t:"authing-g2-send-code-btn g2-loading-btn-center"," ").concat("ja-JP"===su.language?"send-code-btn-jp":""),e.className),disabled:v,loading:h,onClick:function(e){return fq(void 0,void 0,void 0,(function(){return pq(this,(function(e){switch(e.label){case 0:return m(!0),v?[2/*return*/]:[4/*yield*/,i()];case 1:return!e.sent()?(m(!1),[2/*return*/]):(m(!1),d(),[2/*return*/])}}))}))},ref:a}),!0===h&&y().createElement("span",null),!1===h&&y().createElement("span",null,u?o:n("common.retryAfterTime",{time:f})))},Cq=function(){return Cq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Cq.apply(this,arguments)},Eq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},kq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Sq=y().useEffect,xq=y().useState,Pq=function(e){return/^[0-9]*$/.test(String(e))},_q=y().forwardRef((function(e,t){var n=e.onChange,r=e.value,o=Eq(e,["onChange","value"]),i=kq(xq(Pq(r)?r:""),2),a=i[0],s=i[1];return Sq((function(){s(Pq(r)?r:"")}),[r]),y().createElement(rO,Cq({autoComplete:"off"},o,{ref:t,value:a,type:"tel",pattern:"[0-9]*",onChange:function(e){var t=e.target.value;/^[0-9]*$/.test(t)&&function(e){s(e.target.value),null==n||n(e)}(e)}}))})),Tq=function(){return Tq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Tq.apply(this,arguments)},Oq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Nq=function(e){var t=e.value,n=e.onChange,r=e.autoSubmit,o=void 0!==r&&r,i=e.form,a=e.beforeSend,s=e.maxLength,c=Oq(e,["value","onChange","autoSubmit","form","beforeSend","maxLength"]),l=Pu().t;return y().createElement(y().Fragment,null,y().createElement(LA,{justify:"space-between",align:"middle"},y().createElement(aw,{span:/ja/.test(su.language)?9:15,className:"g2-send-code-input-col"},y().createElement(_q,Tq({value:t,onChange:function(e){null==n||n(e),o&&s&&e.target.value.length>=s&&(null==i||i.submit())}},c,{maxLength:s}))),y().createElement(aw,{offset:1,span:/ja/.test(su.language)?14:8},y().createElement(wq,{beforeSend:a,sendDesc:l("common.sendVerifyCode")}))))},Iq=function(){return Iq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Iq.apply(this,arguments)},Aq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Rq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Mq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Dq=function(e){var t=e.scene,n=e.data,r=e.form,o=e.areaCode,i=e.onSendCodeBefore,a=e.fieldName,s=e.isInternationSms,c=void 0!==s&&s,l=e.codeFieldName,u=e.captchaCode,d=Mq(e,["scene","data","form","areaCode","onSendCodeBefore","fieldName","isInternationSms","codeFieldName","captchaCode"]),f=Pu().t,p=WL(),h=uL(),m=MQ().post,v=function(e,n,r){return Aq(void 0,void 0,void 0,(function(){var o,i,a,s,c;return Rq(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4/*yield*/,m("/api/v2/sms/send",{phone:e,phoneCountryCode:n,scene:t,captchaCode:r})];case 1:
|
|
18043
|
+
null==f||f(ML.REGISTER_COMPLETE_INFO,{businessRequestName:a,content:KB(KB({},s),{password:n}),onRegisterSuccess:l,onRegisterFailed:u}),[2/*return*/]):[3/*break*/,2];case 2:return _.trys.push([2,7,,8]),"registerByEmailCode"!==a?[3/*break*/,4]:[4/*yield*/,o("/api/v2/register-email-code",KB(KB({},s),{password:n,postUserInfoPipeline:!1}))];case 3:return r=_.sent(),v=r.statusCode,y=r.apiCode,m=r.data,b=r.onGuardHandling,w=r.message,d.current.onSpin(!1),200===v?l(m):(v===AJ.UNSAFE_PASSWORD_TIP&&g(!0),null==b||b(),u(y,m,w),null===(E=null==t?void 0:t.onRegisterError)||void 0===E||E.call(t,{code:y,data:m,message:w})),[3/*break*/,6];case 4:return"registerByPhoneCode"!==a?[3/*break*/,6]:[4/*yield*/,o("/api/v2/register-phone-code",KB(KB({},s),{password:n,postUserInfoPipeline:!1}))];case 5:i=_.sent(),m=i.data,v=i.statusCode,y=i.apiCode,b=i.onGuardHandling,w=i.message,200===v?(null===(k=d.current)||void 0===k||k.onSpin(!1),l(m)):(y===AJ.UNSAFE_PASSWORD_TIP&&g(!0),null==b||b(),null===(S=d.current)||void 0===S||S.onSpin(!1),u(y,m,w),null===(x=null==t?void 0:t.onRegisterError)||void 0===x||x.call(t,{apiCode:y,data:m,message:w})),_.label=6;case 6:return[3/*break*/,8];case 7:return _.sent(),null===(P=d.current)||void 0===P||P.onSpin(!1),[3/*break*/,8];case 8:return[2/*return*/]}}))}))}),[a,f,s,h,t,c,u,l,o,p,g]);return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:n,onFinish:b,onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!r,className:"authing-g2-input",size:"large",placeholder:e("login.inputPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(t,r){var o=n.getFieldValue("password");return r?r!==o?Promise.reject(e("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(e("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:e("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),v(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:e("common.confirm"),ref:d}))))},tq=function(){return tq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tq.apply(this,arguments)},nq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.ResetPassword="reset-password-first-time",e.FirstLoginReset="reset-password-forced",e.ResetPasswordStrengthDetection="reset-password-strength-detection"}(VB||(VB={}));var oq,iq,aq,sq,cq=function(e,t){return nq(void 0,void 0,void 0,(function(){return rq(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(e,tq({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},lq=function(){return lq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lq.apply(this,arguments)},uq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},dq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},fq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},pq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hq=y().useState,mq=y().useRef,vq=y().useEffect,gq=y().useMemo,yq=function(e){var t,n=Pu().t,r=e.sendDesc,o=void 0===r?n("login.reSent"):r,i=e.beforeSend,a=e.btnRef,s=e.setSent,c=fq(e,["sendDesc","beforeSend","btnRef","setSent"]),l=function(e){var t=pq(hq(0),2),n=t[0],r=t[1],o=mq(0);return vq((function(){return function(){return clearInterval(o.current)}}),[]),vq((function(){n<=0?(clearInterval(o.current),null==e||e(!1)):null==e||e(!0)}),[n,e]),{enabled:gq((function(){return n<=0}),[n]),send:function(){r(60),o.current=setInterval((function(){r((function(e){return e-1}))}),1e3)},countDown:n}}(s),u=l.enabled,d=l.send,f=l.countDown,p=pq(hq(!1),2),h=p[0],m=p[1],v=gq((function(){return!u||h}),[u,h]);return y().createElement(cy,lq({},c,{className:"".concat(null!==(t=c.type)&&void 0!==t?t:"authing-g2-send-code-btn g2-loading-btn-center"," ").concat("ja-JP"===su.resolvedLanguage?"send-code-btn-jp":""),disabled:v,loading:h,onClick:function(e){return uq(void 0,void 0,void 0,(function(){return dq(this,(function(e){switch(e.label){case 0:return m(!0),v?[2/*return*/]:[4/*yield*/,i()];case 1:return!e.sent()?(m(!1),[2/*return*/]):(m(!1),d(),[2/*return*/])}}))}))},ref:a}),!0===h&&y().createElement("span",null),!1===h&&y().createElement("span",null,u?o:n("common.retryAfterTime",{time:f})))},bq=function(){return bq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bq.apply(this,arguments)},wq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Cq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Eq=y().useEffect,kq=y().useState,Sq=function(e){return/^[0-9]*$/.test(String(e))},xq=y().forwardRef((function(e,t){var n=e.onChange,r=e.value,o=wq(e,["onChange","value"]),i=Cq(kq(Sq(r)?r:""),2),a=i[0],s=i[1];return Eq((function(){s(Sq(r)?r:"")}),[r]),y().createElement(rO,bq({autoComplete:"off"},o,{ref:t,value:a,type:"tel",pattern:"[0-9]*",onChange:function(e){var t=e.target.value;/^[0-9]*$/.test(t)&&function(e){s(e.target.value),null==n||n(e)}(e)}}))})),Pq=function(){return Pq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pq.apply(this,arguments)},_q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Tq=function(e){var t=e.value,n=e.onChange,r=e.autoSubmit,o=void 0!==r&&r,i=e.form,a=e.beforeSend,s=e.maxLength,c=_q(e,["value","onChange","autoSubmit","form","beforeSend","maxLength"]),l=Pu().t;return y().createElement(y().Fragment,null,y().createElement(LA,{justify:"space-between",align:"middle"},y().createElement(aw,{span:/ja/.test(su.resolvedLanguage)?9:15,className:"g2-send-code-input-col"},y().createElement(xq,Pq({value:t,onChange:function(e){null==n||n(e),o&&s&&e.target.value.length>=s&&(null==i||i.submit())}},c,{maxLength:s}))),y().createElement(aw,{offset:1,span:/ja/.test(su.resolvedLanguage)?14:8},y().createElement(yq,{beforeSend:a,sendDesc:l("common.sendVerifyCode")}))))},Oq=function(){return Oq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oq.apply(this,arguments)},Nq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Iq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Aq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Rq=function(e){var t=e.scene,n=e.data,r=e.form,o=e.areaCode,i=e.onSendCodeBefore,a=e.fieldName,s=e.isInternationSms,c=void 0!==s&&s,l=e.codeFieldName,u=e.captchaCode,d=Aq(e,["scene","data","form","areaCode","onSendCodeBefore","fieldName","isInternationSms","codeFieldName","captchaCode"]),f=Pu().t,p=WL(),h=uL(),m=rQ().post,v=function(e,n,r){return Nq(void 0,void 0,void 0,(function(){var o,i,a,s,c;return Iq(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4/*yield*/,m("/api/v2/sms/send",{phone:e,phoneCountryCode:n,scene:t,captchaCode:r})];case 1:
|
|
18044
18044
|
// 200 表示请求成功,不报错
|
|
18045
18045
|
return o=l.sent(),i=o.code,a=o.statusCode,c=o.message,200===a||200===i?[2/*return*/,{status:!0}]:
|
|
18046
18046
|
// 由于使用项目中 post 方法进行请求,外层进行了处理,不会抛错,catch 不会走,在这对 code 进行针对处理
|
|
18047
18047
|
// 'ECONNABORTED' 不知道是不是只有 sdk 报错,所以我在接口这也写了,防止接口也会1报这个错
|
|
18048
18048
|
"ECONNABORTED"===i?(vC.error(f("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:o}]):(
|
|
18049
18049
|
// code 不是 -1、-2 时,并且 msg 存在, 那么进行报错
|
|
18050
|
-
-1!==i&&-2!==i&&c&&vC.error(c),[2/*return*/,{status:!1,error:o}]);case 2:return"ECONNABORTED"===(s=l.sent()).code?(vC.error(f("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:s}]):(c=JSON.parse(s.message).message,vC.error(c),[2/*return*/,{status:!1,error:s}]);case 3:return[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement(Nq,Iq({beforeSend:function(){return i().then((function(e){return Aq(void 0,void 0,void 0,(function(){var e,i,s,d,f,m,g,y,b,w;return Rq(this,(function(C){switch(C.label){case 0:return e=r?r.getFieldValue(a||"phone"):n,i=uj(c,e,o),s=i.phoneNumber,d=i.countryCode,f=r?null==r?void 0:r.getFieldValue(l||"captchaCode"):u,[4/*yield*/,v(s,d,f)];case 1:return m=C.sent(),g=m.status,y=m.error,g?null===(b=null==h?void 0:h.onPhoneSend)||void 0===b||b.call(h,p,t):null===(w=null==h?void 0:h.onPhoneSendError)||void 0===w||w.call(h,y,p,t),[2/*return*/,g]}}))}))})).catch((function(e){var n;return null===(n=null==h?void 0:h.onPhoneSendError)||void 0===n||n.call(h,e,p,t),!1}))},form:r},d)))},Lq=function(){return Lq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lq.apply(this,arguments)},Fq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},jq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Bq=function(e){var t,n,r=Pu().t,o=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,i=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,a=cL().phone;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(Dq,Lq({},e,{isInternationSms:i,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:o}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_RESET,maxLength:o,data:a,onSendCodeBefore:function(){return Fq(void 0,void 0,void 0,(function(){return jq(this,(function(e){return[2/*return*/]}))}))}})))},qq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Uq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Vq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$q=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},zq=y().useRef,Hq=function(e){var t=e.onReset,n=Pu().t,r=cL(),o=pL(),i=oL(),a=i.publicKey,s=Vq(sT.useForm(),1)[0],c=WL(),l=c.options.encryptFunction,u=lj().isPhoneMedia,d=zq(null),f=GB(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:s,onFinish:function(e){return qq(void 0,void 0,void 0,(function(){var n,i,s,u,f,p,m,v,g,y,b,w,C,E;return Uq(this,(function(k){switch(k.label){case 0:return n=e.password,null===(y=d.current)||void 0===y||y.onSpin(!0),o?(g={},[4/*yield*/,l(n,a)]):[3/*break*/,3];case 1:return g.password=k.sent(),i=g,e.code&&(i.code=e.code),[4/*yield*/,cq(VB.FirstLoginReset,i)];case 2:return s=k.sent(),u=s.apiCode,f=s.onGuardHandling,p=s.message,null===(b=d.current)||void 0===b||b.onSpin(!1),u===lQ.ABORT_FLOW?t():u===lQ.UNSAFE_PASSWORD_TIP?(vC.error(p),h(!0)):(null===(w=d.current)||void 0===w||w.onError(),null==f||f()),[3/*break*/,7];case 3:return k.trys.push([3,5,6,7]),[4/*yield*/,c.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return m=k.sent(),t(m),[3/*break*/,7];case 5:return v=k.sent(),vC.error(v.message),null===(C=null==d?void 0:d.current)||void 0===C||C.onError(),[3/*break*/,7];case 6:return null===(E=d.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},(null==r?void 0:r.enableFirstLoginResetPasswordVerifyPhone)&&(null==r?void 0:r.phone)&&y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:$q([],Vq(zQ(n("common.captchaCode"))),!1)},y().createElement(Bq,{publicConfig:i})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!u,className:"authing-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=s.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),p(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:n("common.confirm"),ref:d}))))},Wq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Gq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Kq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Yq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Jq=y().useRef,Qq=function(e){var t=Pu().t,n=e.onReset,r=e.onFinishCallBack,o=Kq(sT.useForm(),1)[0],i=oL().publicKey,a=WL(),s=lj().isPhoneMedia,c=a.options.encryptFunction,l=pL(),u=Jq(null),d=cL(),f=GB(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:o,onFinish:function(t){return Wq(void 0,void 0,void 0,(function(){var o,s,f,p,m,v,g,y,b,w,C,E,k,S,x,P,_;return Gq(this,(function(T){switch(T.label){case 0:return r instanceof Function?[4/*yield*/,r(t)]:[3/*break*/,2];case 1:return(o=T.sent()).code===lQ.UNSAFE_PASSWORD_TIP&&(vC.error(o.message),h(!0)),[2/*return*/];case 2:return s=t.password,f=t.oldPassword,null===(k=null==u?void 0:u.current)||void 0===k||k.onSpin(!0),l?(y=cq,b=[VB.ResetPassword],E={},[4/*yield*/,c(s,i)]):[3/*break*/,6];case 3:return E.password=T.sent(),[4/*yield*/,c(f,i)];case 4:return[4/*yield*/,y.apply(void 0,b.concat([(E.oldPassword=T.sent(),E)]))];case 5:return p=T.sent(),m=p.apiCode,v=p.onGuardHandling,g=p.message,null===(S=null==u?void 0:u.current)||void 0===S||S.onSpin(!1),
|
|
18050
|
+
-1!==i&&-2!==i&&c&&vC.error(c),[2/*return*/,{status:!1,error:o}]);case 2:return"ECONNABORTED"===(s=l.sent()).code?(vC.error(f("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:s}]):(c=JSON.parse(s.message).message,vC.error(c),[2/*return*/,{status:!1,error:s}]);case 3:return[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement(Tq,Oq({beforeSend:function(){return i().then((function(e){return Nq(void 0,void 0,void 0,(function(){var e,i,s,d,f,m,g,y,b,w;return Iq(this,(function(C){switch(C.label){case 0:return e=r?r.getFieldValue(a||"phone"):n,i=uj(c,e,o),s=i.phoneNumber,d=i.countryCode,f=r?null==r?void 0:r.getFieldValue(l||"captchaCode"):u,[4/*yield*/,v(s,d,f)];case 1:return m=C.sent(),g=m.status,y=m.error,g?null===(b=null==h?void 0:h.onPhoneSend)||void 0===b||b.call(h,p,t):null===(w=null==h?void 0:h.onPhoneSendError)||void 0===w||w.call(h,y,p,t),[2/*return*/,g]}}))}))})).catch((function(e){var n;return null===(n=null==h?void 0:h.onPhoneSendError)||void 0===n||n.call(h,e,p,t),!1}))},form:r},d)))},Mq=function(){return Mq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mq.apply(this,arguments)},Dq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Lq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Fq=function(e){var t,n,r=Pu().t,o=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,i=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,a=cL().phone;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(Rq,Mq({},e,{isInternationSms:i,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:o}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_RESET,maxLength:o,data:a,onSendCodeBefore:function(){return Dq(void 0,void 0,void 0,(function(){return Lq(this,(function(e){return[2/*return*/]}))}))}})))},jq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Bq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Uq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Vq=y().useRef,$q=function(e){var t=e.onReset,n=Pu().t,r=cL(),o=pL(),i=oL(),a=i.publicKey,s=qq(sT.useForm(),1)[0],c=WL(),l=c.options.encryptFunction,u=lj().isPhoneMedia,d=Vq(null),f=GB(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:s,onFinish:function(e){return jq(void 0,void 0,void 0,(function(){var n,i,s,u,f,p,m,v,g,y,b,w,C,E;return Bq(this,(function(k){switch(k.label){case 0:return n=e.password,null===(y=d.current)||void 0===y||y.onSpin(!0),o?(g={},[4/*yield*/,l(n,a)]):[3/*break*/,3];case 1:return g.password=k.sent(),i=g,e.code&&(i.code=e.code),[4/*yield*/,cq(VB.FirstLoginReset,i)];case 2:return s=k.sent(),u=s.apiCode,f=s.onGuardHandling,p=s.message,null===(b=d.current)||void 0===b||b.onSpin(!1),u===AJ.ABORT_FLOW?t():u===AJ.UNSAFE_PASSWORD_TIP?(vC.error(p),h(!0)):(null===(w=d.current)||void 0===w||w.onError(),null==f||f()),[3/*break*/,7];case 3:return k.trys.push([3,5,6,7]),[4/*yield*/,c.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return m=k.sent(),t(m),[3/*break*/,7];case 5:return v=k.sent(),vC.error(v.message),null===(C=null==d?void 0:d.current)||void 0===C||C.onError(),[3/*break*/,7];case 6:return null===(E=d.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},(null==r?void 0:r.enableFirstLoginResetPasswordVerifyPhone)&&(null==r?void 0:r.phone)&&y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:Uq([],qq(pQ(n("common.captchaCode"))),!1)},y().createElement(Fq,{publicConfig:i})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!u,className:"authing-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=s.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),p(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:n("common.confirm"),ref:d}))))},zq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Hq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Wq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Gq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Kq=y().useRef,Yq=function(e){var t=Pu().t,n=e.onReset,r=e.onFinishCallBack,o=Wq(sT.useForm(),1)[0],i=oL().publicKey,a=WL(),s=lj().isPhoneMedia,c=a.options.encryptFunction,l=pL(),u=Kq(null),d=cL(),f=GB(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:o,onFinish:function(t){return zq(void 0,void 0,void 0,(function(){var o,s,f,p,m,v,g,y,b,w,C,E,k,S,x,P,_;return Hq(this,(function(T){switch(T.label){case 0:return r instanceof Function?[4/*yield*/,r(t)]:[3/*break*/,2];case 1:return(o=T.sent()).code===AJ.UNSAFE_PASSWORD_TIP&&(vC.error(o.message),h(!0)),[2/*return*/];case 2:return s=t.password,f=t.oldPassword,null===(k=null==u?void 0:u.current)||void 0===k||k.onSpin(!0),l?(y=cq,b=[VB.ResetPassword],E={},[4/*yield*/,c(s,i)]):[3/*break*/,6];case 3:return E.password=T.sent(),[4/*yield*/,c(f,i)];case 4:return[4/*yield*/,y.apply(void 0,b.concat([(E.oldPassword=T.sent(),E)]))];case 5:return p=T.sent(),m=p.apiCode,v=p.onGuardHandling,g=p.message,null===(S=null==u?void 0:u.current)||void 0===S||S.onSpin(!1),
|
|
18051
18051
|
// 重置密码 返回的是流程终止
|
|
18052
|
-
m===lQ.ABORT_FLOW?n():m===lQ.UNSAFE_PASSWORD_TIP?(vC.error(g),h(!0)):(null===(x=null==u?void 0:u.current)||void 0===x||x.onError(),null==v||v()),[3/*break*/,10];case 6:return T.trys.push([6,8,9,10]),[4/*yield*/,a.resetPasswordByForceResetToken({token:d.token,newPassword:s,oldPassword:f})];case 7:return w=T.sent(),e.onReset({code:200,data:w}),[3/*break*/,10];case 8:return C=T.sent(),vC.error(C.message),null===(P=null==u?void 0:u.current)||void 0===P||P.onError(),[3/*break*/,10];case 9:return null===(_=null==u?void 0:u.current)||void 0===_||_.onSpin(!1),[7/*endfinally*/];case 10:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"oldPassword",rules:Yq([],Kq(zQ(t("common.password"))),!1)},y().createElement(zB,{autoFocus:!s,className:"authing-g2-input",size:"large",placeholder:t("user.inputCurrPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password"},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:t("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,n){var r=o.getFieldValue("password");return n?n!==r?Promise.reject(t("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(t("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:t("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),p(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:t("common.confirm"),ref:u}))))},Zq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Xq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},eU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},tU=y().useRef,nU=function(e){var t=e.onReset,n=Pu().t,r=cL(),o=pL(),i=oL().publicKey,a=eU(sT.useForm(),1)[0],s=WL(),c=s.options.encryptFunction,l=lj().isPhoneMedia,u=tU(null),d=GB(),f=d.getPassWordUnsafeText,p=d.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:a,onFinish:function(e){return Zq(void 0,void 0,void 0,(function(){var n,a,l,d,f,h,m,v,g,y,b,w,C,E,k;return Xq(this,(function(S){switch(S.label){case 0:return n=e.password,null===(b=u.current)||void 0===b||b.onSpin(!0),o?(h=cq,m=[VB.ResetPasswordStrengthDetection],y={},[4/*yield*/,c(n,i)]):[3/*break*/,3];case 1:return[4/*yield*/,h.apply(void 0,m.concat([(y.password=S.sent(),y)]))];case 2:return a=S.sent(),l=a.apiCode,d=a.onGuardHandling,f=a.message,null===(w=u.current)||void 0===w||w.onSpin(!1),l===lQ.ABORT_FLOW?t():l===lQ.UNSAFE_PASSWORD_TIP?(vC.error(f),p(!0)):(null===(C=u.current)||void 0===C||C.onError(),null==d||d()),[3/*break*/,7];case 3:return S.trys.push([3,5,6,7]),[4/*yield*/,s.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return v=S.sent(),t(v),[3/*break*/,7];case 5:return g=S.sent(),vC.error(g.message),null===(E=null==u?void 0:u.current)||void 0===E||E.onError(),[3/*break*/,7];case 6:return null===(k=u.current)||void 0===k||k.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!l,className:"authing-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=a.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),f(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:n("common.confirm"),ref:u}))))},rU=y().useMemo,oU=function(e){var t=e.title,n=e.explain,r=e.children,o=fL(),i=rU((function(){return{title:t,explain:n}}),[n,t]);return fB(),y().createElement("div",{className:"g2-view-container g2-change-password"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},i.title),y().createElement("div",{className:"title-explain"},i.explain)),y().createElement("div",{className:"g2-view-tabs"},r))},iU=function(){var e=Pu().t,t=dL().changeModule,n=fL(),r=y().createElement(Hq,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(oU,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.initPasswordText")},r)},aU=function(){var e=Pu().t,t=dL().changeModule,n=fL(),r=y().createElement(nU,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(oU,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.unsafePasswordChangeText")},r)},sU=function(){var e=Pu().t,t=dL().changeModule,n=cL(),r=y().createElement(Qq,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(oU,{title:e("user.modifyPwd"),explain:e("user.modifyPwdText",{number:n.forcedCycle})},r)},cU=function(){var e=Pu().t,t=dL().changeModule,n=cL(),r=y().createElement(Qq,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)},onFinishCallBack:n.onFinishCallBack});return y().createElement(oU,{title:e("user.modifyPwd"),explain:e("user.modifyNoticePwdText",{number:n.forcedCycle})},r)},lU=function(){var e=Pu().t,t=fL();return y().createElement(oU,{title:"".concat(e("common.welcome")," ").concat(t.title),explain:e("common.registerCompletePasswordDesc")},y().createElement(eq,null))},uU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},dU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},fU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},pU=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},hU=y().useCallback,mU=function(){var e,t,n=fL(),r=uL(),o=Pu().t,i=WL(),a=iL().post,s=cL(),c=null!==(e=null==s?void 0:s.accounts)&&void 0!==e?e:[],l=null!==(t=null==s?void 0:s.myself)&&void 0!==t?t:{},u=null==s?void 0:s.i18n,d=pU([l],fU(c),!1);fB();var f=RQ().authFlow,p=hU((function(e){return uU(void 0,void 0,void 0,(function(){var t,n,o,a,s;return dU(this,(function(c){switch(c.label){case 0:return[4/*yield*/,f("public-account-login-selection",{userId:e.userId})];case 1:return t=c.sent(),n=t.isFlowEnd,o=t.data,a=t.onGuardHandling,n?null===(s=null==r?void 0:r.onLogin)||void 0===s||s.call(r,o,i):null==a||a(),[2/*return*/]}}))}))}),[i,a,r]);return y().createElement(y().Fragment,null,s?y().createElement("div",{className:"g2-view-container g2-view-container-2-login"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==n?void 0:n.logo,size:42,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},u)),y().createElement("div",{className:"g2-view-tabs"},y().createElement("ul",{className:"g2-select-account-2-login_wrapper"},d.map((function(e,t){return y().createElement("li",{className:"g2-select-account-2-login__li",key:t,onClick:function(){return p(e)}},y().createElement("img",{className:"g2-select-account-2-login__avatar",alt:e.userId,src:e.avatar||""}),y().createElement("div",{className:"g2-select-account-2-login__body"},e.displayName&&y().createElement(h_,{className:"g2-select-account-2-login__title"},e.displayName,2==+e.usertype&&y().createElement(h_,{className:"g2-select-account-2-login__des"},o("common.publicAccount"))),y().createElement(h_,{className:"g2-multiple__tel"},(null==e?void 0:e.phone)||"-")))}))))):n.loadingComponent)},vU=function(){return vU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vU.apply(this,arguments)};
|
|
18053
|
-
|
|
18054
|
-
vU({},Ac());!function(e){e.NONE="none",e.EMAIL="email",e.PHONE="phone",e.IS_NUMBER="isNumber",e.REG_EXP="regExp"}(oq||(oq={})),function(e){e.USERNAME="username",e.PHONE="phone",e.EMAIL="email"}(iq||(iq={})),function(e){e.IMAGE="image",e.NUMBER="number",e.DATE="date",e.DATE_TIME="datetime",e.SELECT="select",e.DROPDOWN="dropdown",e.BOOLEAN="boolean",e.STRING="string",e.TEXT="text",e.GENDER="gender",e.COUNTRY="country"}(aq||(aq={})),function(e){e.registerByEmail="email",e.registerByPhoneCode="phone",e.registerByEmailCode="email",e["phone-password"]="phone"}(sq||(sq={}));// CONCATENATED MODULE: ./src/SendCode/SendCodeByEmail.tsx
|
|
18055
|
-
var gU,yU=function(){return yU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yU.apply(this,arguments)},bU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},wU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},CU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},EU=function(e){var t=e.scene,n=e.data,r=e.form,o=e.onSendCodeBefore,i=e.fieldName,a=CU(e,["scene","data","form","onSendCodeBefore","fieldName"]),s=Pu().t,c=uL(),l=WL(),u=RQ().post,d=function(e){return bU(void 0,void 0,void 0,(function(){var n,r,o,i,a;return wU(this,(function(c){switch(c.label){case 0:if(!e)return vC.error(s("login.inputEmail")),[2/*return*/,{status:!1,error:{code:400,message:s("login.inputEmail")}}];if(!$Q("email",e))return vC.error(s("common.emailFormatError")),[2/*return*/,{status:!1,error:{code:400,message:s("common.emailFormatError")}}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4/*yield*/,u("/api/v2/email/send",{email:e,scene:t})];case 2:return n=c.sent(),r=n.code,o=n.message,2080===(i=n.apiCode)?(
|
|
18052
|
+
m===AJ.ABORT_FLOW?n():m===AJ.UNSAFE_PASSWORD_TIP?(vC.error(g),h(!0)):(null===(x=null==u?void 0:u.current)||void 0===x||x.onError(),null==v||v()),[3/*break*/,10];case 6:return T.trys.push([6,8,9,10]),[4/*yield*/,a.resetPasswordByForceResetToken({token:d.token,newPassword:s,oldPassword:f})];case 7:return w=T.sent(),e.onReset({code:200,data:w}),[3/*break*/,10];case 8:return C=T.sent(),vC.error(C.message),null===(P=null==u?void 0:u.current)||void 0===P||P.onError(),[3/*break*/,10];case 9:return null===(_=null==u?void 0:u.current)||void 0===_||_.onSpin(!1),[7/*endfinally*/];case 10:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"oldPassword",rules:Gq([],Wq(pQ(t("common.password"))),!1)},y().createElement(zB,{autoFocus:!s,className:"authing-g2-input",size:"large",placeholder:t("user.inputCurrPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password"},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:t("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,n){var r=o.getFieldValue("password");return n?n!==r?Promise.reject(t("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(t("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:t("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),p(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:t("common.confirm"),ref:u}))))},Jq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Qq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Zq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Xq=y().useRef,eU=function(e){var t=e.onReset,n=Pu().t,r=cL(),o=pL(),i=oL().publicKey,a=Zq(sT.useForm(),1)[0],s=WL(),c=s.options.encryptFunction,l=lj().isPhoneMedia,u=Xq(null),d=GB(),f=d.getPassWordUnsafeText,p=d.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:a,onFinish:function(e){return Jq(void 0,void 0,void 0,(function(){var n,a,l,d,f,h,m,v,g,y,b,w,C,E,k;return Qq(this,(function(S){switch(S.label){case 0:return n=e.password,null===(b=u.current)||void 0===b||b.onSpin(!0),o?(h=cq,m=[VB.ResetPasswordStrengthDetection],y={},[4/*yield*/,c(n,i)]):[3/*break*/,3];case 1:return[4/*yield*/,h.apply(void 0,m.concat([(y.password=S.sent(),y)]))];case 2:return a=S.sent(),l=a.apiCode,d=a.onGuardHandling,f=a.message,null===(w=u.current)||void 0===w||w.onSpin(!1),l===AJ.ABORT_FLOW?t():l===AJ.UNSAFE_PASSWORD_TIP?(vC.error(f),p(!0)):(null===(C=u.current)||void 0===C||C.onError(),null==d||d()),[3/*break*/,7];case 3:return S.trys.push([3,5,6,7]),[4/*yield*/,s.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return v=S.sent(),t(v),[3/*break*/,7];case 5:return g=S.sent(),vC.error(g.message),null===(E=null==u?void 0:u.current)||void 0===E||E.onError(),[3/*break*/,7];case 6:return null===(k=u.current)||void 0===k||k.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(UB.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(zB,{autoFocus:!l,className:"authing-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=a.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),f(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:n("common.confirm"),ref:u}))))},tU=y().useMemo,nU=function(e){var t=e.title,n=e.explain,r=e.children,o=fL(),i=tU((function(){return{title:t,explain:n}}),[n,t]);return fB(),y().createElement("div",{className:"g2-view-container g2-change-password"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},i.title),y().createElement("div",{className:"title-explain"},i.explain)),y().createElement("div",{className:"g2-view-tabs"},r))},rU=function(){var e=Pu().t,t=dL().changeModule,n=fL(),r=y().createElement($q,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(nU,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.initPasswordText")},r)},oU=function(){var e=Pu().t,t=dL().changeModule,n=fL(),r=y().createElement(eU,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(nU,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.unsafePasswordChangeText")},r)},iU=function(){var e=Pu().t,t=dL().changeModule,n=cL(),r=y().createElement(Yq,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)}});return y().createElement(nU,{title:e("user.modifyPwd"),explain:e("user.modifyPwdText",{number:n.forcedCycle})},r)},aU=function(){var e=Pu().t,t=dL().changeModule,n=cL(),r=y().createElement(Yq,{onReset:function(){vC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(ML.LOGIN)}),500)},onFinishCallBack:n.onFinishCallBack});return y().createElement(nU,{title:e("user.modifyPwd"),explain:e("user.modifyNoticePwdText",{number:n.forcedCycle})},r)},sU=function(){var e=Pu().t,t=fL();return y().createElement(nU,{title:"".concat(e("common.welcome")," ").concat(t.title),explain:e("common.registerCompletePasswordDesc")},y().createElement(eq,null))},cU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},lU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},uU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},dU=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},fU=y().useCallback,pU=function(){var e,t,n=fL(),r=uL(),o=Pu().t,i=WL(),a=iL().post,s=cL(),c=null!==(e=null==s?void 0:s.accounts)&&void 0!==e?e:[],l=null!==(t=null==s?void 0:s.myself)&&void 0!==t?t:{},u=null==s?void 0:s.i18n,d=dU([l],uU(c),!1);fB();var f=nQ().authFlow,p=fU((function(e){return cU(void 0,void 0,void 0,(function(){var t,n,o,a,s;return lU(this,(function(c){switch(c.label){case 0:return[4/*yield*/,f("public-account-login-selection",{userId:e.userId})];case 1:return t=c.sent(),n=t.isFlowEnd,o=t.data,a=t.onGuardHandling,n?null===(s=null==r?void 0:r.onLogin)||void 0===s||s.call(r,o,i):null==a||a(),[2/*return*/]}}))}))}),[i,a,r]);return y().createElement(y().Fragment,null,s?y().createElement("div",{className:"g2-view-container g2-view-container-2-login"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==n?void 0:n.logo,size:42,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},u)),y().createElement("div",{className:"g2-view-tabs"},y().createElement("ul",{className:"g2-select-account-2-login_wrapper"},d.map((function(e,t){return y().createElement("li",{className:"g2-select-account-2-login__li",key:t,onClick:function(){return p(e)}},y().createElement("img",{className:"g2-select-account-2-login__avatar",alt:e.userId,src:e.avatar||""}),y().createElement("div",{className:"g2-select-account-2-login__body"},e.displayName&&y().createElement(h_,{className:"g2-select-account-2-login__title"},e.displayName,2==+e.usertype&&y().createElement(h_,{className:"g2-select-account-2-login__des"},o("common.publicAccount"))),y().createElement(h_,{className:"g2-multiple__tel"},(null==e?void 0:e.phone)||"-")))}))))):n.loadingComponent)},hU=function(){return hU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hU.apply(this,arguments)};hU({},Ac());!function(e){e.NONE="none",e.EMAIL="email",e.PHONE="phone",e.IS_NUMBER="isNumber",e.REG_EXP="regExp"}(oq||(oq={})),function(e){e.USERNAME="username",e.PHONE="phone",e.EMAIL="email"}(iq||(iq={})),function(e){e.IMAGE="image",e.NUMBER="number",e.DATE="date",e.DATE_TIME="datetime",e.SELECT="select",e.DROPDOWN="dropdown",e.BOOLEAN="boolean",e.STRING="string",e.TEXT="text",e.GENDER="gender",e.COUNTRY="country"}(aq||(aq={})),function(e){e.registerByEmail="email",e.registerByPhoneCode="phone",e.registerByEmailCode="email",e["phone-password"]="phone"}(sq||(sq={}));// CONCATENATED MODULE: ./src/SendCode/SendCodeByEmail.tsx
|
|
18053
|
+
var mU,vU=function(){return vU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vU.apply(this,arguments)},gU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},yU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},bU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},wU=function(e){var t=e.scene,n=e.data,r=e.form,o=e.onSendCodeBefore,i=e.fieldName,a=bU(e,["scene","data","form","onSendCodeBefore","fieldName"]),s=Pu().t,c=uL(),l=WL(),u=nQ().post,d=function(e){return gU(void 0,void 0,void 0,(function(){var n,r,o,i,a;return yU(this,(function(c){switch(c.label){case 0:if(!e)return vC.error(s("login.inputEmail")),[2/*return*/,{status:!1,error:{code:400,message:s("login.inputEmail")}}];if(!fQ("email",e))return vC.error(s("common.emailFormatError")),[2/*return*/,{status:!1,error:{code:400,message:s("common.emailFormatError")}}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4/*yield*/,u("/api/v2/email/send",{email:e,scene:t})];case 2:return n=c.sent(),r=n.code,o=n.message,2080===(i=n.apiCode)?(
|
|
18056
18054
|
// 一分钟只能发一次邮箱验证码的提示信息,特殊处理
|
|
18057
18055
|
vC.error(o),[2/*return*/,{status:!1,error:{code:i,message:o}}]):200===r?[2/*return*/,{status:!0}]:(vC.error(s("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:{code:r,message:s("login.sendCodeTimeout")}}]);case 3:
|
|
18058
18056
|
// onError?.(error)
|
|
18059
|
-
return a=c.sent(),[2/*return*/,{status:!1,error:{message:JSON.stringify(a),code:401}}];case 4:return[2/*return*/]}}))}))};return y().createElement(Nq,yU({beforeSend:function(){return o().then((function(e){return bU(void 0,void 0,void 0,(function(){var e,o,a,s,u,f;return wU(this,(function(p){switch(p.label){case 0:return e=r?r.getFieldValue(i||"email"):n,[4/*yield*/,d(e)];case 1:return o=p.sent(),a=o.status,s=o.error,a?null===(u=null==c?void 0:c.onEmailSend)||void 0===u||u.call(c,l,t):null===(f=null==c?void 0:c.onEmailSendError)||void 0===f||f.call(c,s,l,t),[2/*return*/,a]}}))}))})).catch((function(e){var n;return null===(n=null==c?void 0:c.onEmailSendError)||void 0===n||n.call(c,e,l,t),!1}))},form:r},a))},kU=[{iso:"CA",regions:"加拿大",regions_en:"Canada",phoneCountryCode:"+1"},{iso:"US",regions:"美国",regions_en:"United States",phoneCountryCode:"+1"},{iso:"KZ",regions:"哈萨克斯坦",regions_en:"Kazakhstan",phoneCountryCode:"+7"},{iso:"RU",regions:"俄罗斯",regions_en:"Russia",phoneCountryCode:"+7"},{iso:"EG",regions:"埃及",regions_en:"Egypt",phoneCountryCode:"+20"},{iso:"ZA",regions:"南非",regions_en:"South Africa",phoneCountryCode:"+27"},{iso:"GR",regions:"希腊",regions_en:"Greece",phoneCountryCode:"+30"},{iso:"NL",regions:"荷兰",regions_en:"Netherlands",phoneCountryCode:"+31"},{iso:"BE",regions:"比利时",regions_en:"Belgium",phoneCountryCode:"+32"},{iso:"FR",regions:"法国",regions_en:"France",phoneCountryCode:"+33"},{iso:"ES",regions:"西班牙",regions_en:"Spain",phoneCountryCode:"+34"},{iso:"HU",regions:"匈牙利",regions_en:"Hungary",phoneCountryCode:"+36"},{iso:"IT",regions:"意大利",regions_en:"Italy",phoneCountryCode:"+39"},{iso:"RO",regions:"罗马尼亚",regions_en:"Romania",phoneCountryCode:"+40"},{iso:"CH",regions:"瑞士",regions_en:"Switzerland",phoneCountryCode:"+41"},{iso:"AT",regions:"奥地利",regions_en:"Austria",phoneCountryCode:"+43"},{iso:"GB",regions:"英国",regions_en:"United Kingdom",phoneCountryCode:"+44"},{iso:"DK",regions:"丹麦",regions_en:"Denmark",phoneCountryCode:"+45"},{iso:"SE",regions:"瑞典",regions_en:"Sweden",phoneCountryCode:"+46"},{iso:"NO",regions:"挪威",regions_en:"Norway",phoneCountryCode:"+47"},{iso:"PL",regions:"波兰",regions_en:"Poland",phoneCountryCode:"+48"},{iso:"DE",regions:"德国",regions_en:"Germany",phoneCountryCode:"+49"},{iso:"PE",regions:"秘鲁",regions_en:"Peru",phoneCountryCode:"+51"},{iso:"MX",regions:"墨西哥",regions_en:"Mexico",phoneCountryCode:"+52"},{iso:"CU",regions:"古巴",regions_en:"Cuba",phoneCountryCode:"+53"},{iso:"AR",regions:"阿根廷",regions_en:"Argentina",phoneCountryCode:"+54"},{iso:"BR",regions:"巴西",regions_en:"Brazil",phoneCountryCode:"+55"},{iso:"CL",regions:"智利",regions_en:"Chile",phoneCountryCode:"+56"},{iso:"CO",regions:"哥伦比亚",regions_en:"Colombia",phoneCountryCode:"+57"},{iso:"VE",regions:"委内瑞拉",regions_en:"Venezuela",phoneCountryCode:"+58"},{iso:"MY",regions:"马来西亚",regions_en:"Malaysia",phoneCountryCode:"+60"},{iso:"AU",regions:"澳大利亚",regions_en:"Australia",phoneCountryCode:"+61"},{iso:"ID",regions:"印度尼西亚",regions_en:"Indonesia",phoneCountryCode:"+62"},{iso:"PH",regions:"菲律宾",regions_en:"Philippines",phoneCountryCode:"+63"},{iso:"NZ",regions:"新西兰",regions_en:"New Zealand",phoneCountryCode:"+64"},{iso:"SG",regions:"新加坡",regions_en:"Singapore",phoneCountryCode:"+65"},{iso:"TH",regions:"泰国",regions_en:"Thailand",phoneCountryCode:"+66"},{iso:"JP",regions:"日本",regions_en:"Japan",phoneCountryCode:"+81"},{iso:"KR",regions:"韩国",regions_en:"South Korea",phoneCountryCode:"+82"},{iso:"VN",regions:"越南",regions_en:"Vietnam",phoneCountryCode:"+84"},{iso:"CN",regions:"中国",regions_en:"China",phoneCountryCode:"+86"},{iso:"TR",regions:"土耳其",regions_en:"Turkey",phoneCountryCode:"+90"},{iso:"IN",regions:"印度",regions_en:"India",phoneCountryCode:"+91"},{iso:"PK",regions:"巴基斯坦",regions_en:"Pakistan",phoneCountryCode:"+92"},{iso:"AF",regions:"阿富汗",regions_en:"Afghanistan",phoneCountryCode:"+93"},{iso:"LK",regions:"斯里兰卡",regions_en:"Sri Lanka",phoneCountryCode:"+94"},{iso:"MM",regions:"缅甸",regions_en:"Myanmar",phoneCountryCode:"+95"},{iso:"IR",regions:"伊朗",regions_en:"Iran",phoneCountryCode:"+98"},{iso:"MA",regions:"摩洛哥",regions_en:"Morocco",phoneCountryCode:"+212"},{iso:"DZ",regions:"阿尔及利亚",regions_en:"Algeria",phoneCountryCode:"+213"},{iso:"TN",regions:"突尼斯",regions_en:"Tunisia",phoneCountryCode:"+216"},{iso:"LY",regions:"利比亚",regions_en:"Libya",phoneCountryCode:"+218"},{iso:"GM",regions:"冈比亚",regions_en:"Gambia",phoneCountryCode:"+220"},{iso:"SN",regions:"塞内加尔",regions_en:"Senegal",phoneCountryCode:"+221"},{iso:"MR",regions:"毛里塔尼亚",regions_en:"Mauritania",phoneCountryCode:"+222"},{iso:"ML",regions:"马里",regions_en:"Mali",phoneCountryCode:"+223"},{iso:"GN",regions:"几内亚",regions_en:"Guinea",phoneCountryCode:"+224"},{iso:"CI",regions:"象牙海岸",regions_en:"Ivory Coast",phoneCountryCode:"+225"},{iso:"BF",regions:"布基纳法索",regions_en:"Burkina Faso",phoneCountryCode:"+226"},{iso:"NE",regions:"尼日尔",regions_en:"Niger",phoneCountryCode:"+227"},{iso:"TG",regions:"多哥",regions_en:"Togo",phoneCountryCode:"+228"},{iso:"BJ",regions:"贝宁",regions_en:"Benin",phoneCountryCode:"+229"},{iso:"MU",regions:"毛里求斯",regions_en:"Mauritius",phoneCountryCode:"+230"},{iso:"LR",regions:"利比里亚",regions_en:"Liberia",phoneCountryCode:"+231"},{iso:"SL",regions:"塞拉利昂",regions_en:"Sierra Leone",phoneCountryCode:"+232"},{iso:"GH",regions:"加纳",regions_en:"Ghana",phoneCountryCode:"+233"},{iso:"NG",regions:"尼日利亚",regions_en:"Nigeria",phoneCountryCode:"+234"},{iso:"TD",regions:"乍得",regions_en:"Chad",phoneCountryCode:"+235"},{iso:"CF",regions:"中非共和国",regions_en:"Central African Republic",phoneCountryCode:"+236"},{iso:"CM",regions:"喀麦隆",regions_en:"Cameroon",phoneCountryCode:"+237"},{iso:"CV",regions:"开普",regions_en:"Cape Verde",phoneCountryCode:"+238"},{iso:"ST",regions:"圣多美和普林西比",regions_en:"Sao Tome and Principe",phoneCountryCode:"+239"},{iso:"GQ",regions:"赤道几内亚",regions_en:"Equatorial Guinea",phoneCountryCode:"+240"},{iso:"GA",regions:"加蓬",regions_en:"Gabon",phoneCountryCode:"+241"},{iso:"CG",regions:"刚果共和国",regions_en:"Republic Of The Congo",phoneCountryCode:"+242"},{iso:"CD",regions:"刚果民主共和国",regions_en:"Democratic Republic of theCongo",phoneCountryCode:"+243"},{iso:"AO",regions:"安哥拉",regions_en:"Angola",phoneCountryCode:"+244"},{iso:"GW",regions:"几内亚比绍共和国",regions_en:"Guinea-Bissau",phoneCountryCode:"+245"},{iso:"SC",regions:"塞舌尔",regions_en:"Seychelles",phoneCountryCode:"+248"},{iso:"SD",regions:"苏丹",regions_en:"Sudan",phoneCountryCode:"+249"},{iso:"RW",regions:"卢旺达",regions_en:"Rwanda",phoneCountryCode:"+250"},{iso:"ET",regions:"埃塞俄比亚",regions_en:"Ethiopia",phoneCountryCode:"+251"},{iso:"SO",regions:"索马里",regions_en:"Somalia",phoneCountryCode:"+252"},{iso:"DJ",regions:"吉布提",regions_en:"Djibouti",phoneCountryCode:"+253"},{iso:"KE",regions:"肯尼亚",regions_en:"Kenya",phoneCountryCode:"+254"},{iso:"TZ",regions:"坦桑尼亚",regions_en:"Tanzania",phoneCountryCode:"+255"},{iso:"UG",regions:"乌干达",regions_en:"Uganda",phoneCountryCode:"+256"},{iso:"BI",regions:"布隆迪",regions_en:"Burundi",phoneCountryCode:"+257"},{iso:"MZ",regions:"莫桑比克",regions_en:"Mozambique",phoneCountryCode:"+258"},{iso:"ZM",regions:"赞比亚",regions_en:"Zambia",phoneCountryCode:"+260"},{iso:"MG",regions:"马达加斯加",regions_en:"Madagascar",phoneCountryCode:"+261"},{iso:"RE",regions:"留尼汪",regions_en:"Réunion Island",phoneCountryCode:"+262"},{iso:"ZW",regions:"津巴布韦",regions_en:"Zimbabwe",phoneCountryCode:"+263"},{iso:"NA",regions:"纳米比亚",regions_en:"Namibia",phoneCountryCode:"+264"},{iso:"MW",regions:"马拉维",regions_en:"Malawi",phoneCountryCode:"+265"},{iso:"LS",regions:"莱索托",regions_en:"Lesotho",phoneCountryCode:"+266"},{iso:"BW",regions:"博茨瓦纳",regions_en:"Botswana",phoneCountryCode:"+267"},{iso:"SZ",regions:"斯威士兰",regions_en:"Swaziland",phoneCountryCode:"+268"},{iso:"KM",regions:"科摩罗",regions_en:"Comoros",phoneCountryCode:"+269"},{iso:"YT",regions:"马约特",regions_en:"Mayotte",phoneCountryCode:"+269"},{iso:"ER",regions:"厄立特里亚",regions_en:"Eritrea",phoneCountryCode:"+291"},{iso:"AW",regions:"阿鲁巴",regions_en:"Aruba",phoneCountryCode:"+297"},{iso:"FO",regions:"法罗群岛",regions_en:"Faroe Islands",phoneCountryCode:"+298"},{iso:"GL",regions:"格陵兰岛",regions_en:"Greenland",phoneCountryCode:"+299"},{iso:"GI",regions:"直布罗陀",regions_en:"Gibraltar",phoneCountryCode:"+350"},{iso:"PT",regions:"葡萄牙",regions_en:"Portugal",phoneCountryCode:"+351"},{iso:"LU",regions:"卢森堡",regions_en:"Luxembourg",phoneCountryCode:"+352"},{iso:"IE",regions:"爱尔兰",regions_en:"Ireland",phoneCountryCode:"+353"},{iso:"IS",regions:"冰岛",regions_en:"Iceland",phoneCountryCode:"+354"},{iso:"AL",regions:"阿尔巴尼亚",regions_en:"Albania",phoneCountryCode:"+355"},{iso:"MT",regions:"马耳他",regions_en:"Malta",phoneCountryCode:"+356"},{iso:"CY",regions:"塞浦路斯",regions_en:"Cyprus",phoneCountryCode:"+357"},{iso:"FI",regions:"芬兰",regions_en:"Finland",phoneCountryCode:"+358"},{iso:"BG",regions:"保加利亚",regions_en:"Bulgaria",phoneCountryCode:"+359"},{iso:"LT",regions:"立陶宛",regions_en:"Lithuania",phoneCountryCode:"+370"},{iso:"LV",regions:"拉脱维亚",regions_en:"Latvia",phoneCountryCode:"+371"},{iso:"EE",regions:"爱沙尼亚",regions_en:"Estonia",phoneCountryCode:"+372"},{iso:"MD",regions:"摩尔多瓦",regions_en:"Moldova",phoneCountryCode:"+373"},{iso:"AM",regions:"亚美尼亚",regions_en:"Armenia",phoneCountryCode:"+374"},{iso:"BY",regions:"白俄罗斯",regions_en:"Belarus",phoneCountryCode:"+375"},{iso:"AD",regions:"安道尔",regions_en:"Andorra",phoneCountryCode:"+376"},{iso:"MC",regions:"摩纳哥",regions_en:"Monaco",phoneCountryCode:"+377"},{iso:"SM",regions:"圣马力诺",regions_en:"San Marino",phoneCountryCode:"+378"},{iso:"UA",regions:"乌克兰",regions_en:"Ukraine",phoneCountryCode:"+380"},{iso:"RS",regions:"塞尔维亚",regions_en:"Serbia",phoneCountryCode:"+381"},{iso:"ME",regions:"黑山",regions_en:"Montenegro",phoneCountryCode:"+382"},{iso:"HR",regions:"克罗地亚",regions_en:"Croatia",phoneCountryCode:"+385"},{iso:"SI",regions:"斯洛文尼亚",regions_en:"Slovenia",phoneCountryCode:"+386"},{iso:"BA",regions:"波斯尼亚和黑塞哥维那",regions_en:"Bosniaand Herzegovina",phoneCountryCode:"+387"},{iso:"MK",regions:"马其顿",regions_en:"Macedonia",phoneCountryCode:"+389"},{iso:"CZ",regions:"捷克",regions_en:"Czech",phoneCountryCode:"+420"},{iso:"SK",regions:"斯洛伐克",regions_en:"Slovakia",phoneCountryCode:"+421"},{iso:"LI",regions:"列支敦士登",regions_en:"Liechtenstein",phoneCountryCode:"+423"},{iso:"BZ",regions:"伯利兹",regions_en:"Belize",phoneCountryCode:"+501"},{iso:"GT",regions:"瓜地马拉",regions_en:"Guatemala",phoneCountryCode:"+502"},{iso:"SV",regions:"萨尔瓦多",regions_en:"ElSalvador",phoneCountryCode:"+503"},{iso:"HN",regions:"洪都拉斯",regions_en:"Honduras",phoneCountryCode:"+504"},{iso:"NI",regions:"尼加拉瓜",regions_en:"Nicaragua",phoneCountryCode:"+505"},{iso:"CR",regions:"哥斯达黎加",regions_en:"CostaRica",phoneCountryCode:"+506"},{iso:"PA",regions:"巴拿马",regions_en:"Panama",phoneCountryCode:"+507"},{iso:"PM",regions:"圣彼埃尔和密克隆岛",regions_en:"Saint Pierreand Miquelon",phoneCountryCode:"+508"},{iso:"HT",regions:"海地",regions_en:"Haiti",phoneCountryCode:"+509"},{iso:"GP",regions:"瓜德罗普岛",regions_en:"Guadeloupe",phoneCountryCode:"+590"},{iso:"BO",regions:"玻利维亚",regions_en:"Bolivia",phoneCountryCode:"+591"},{iso:"GY",regions:"圭亚那",regions_en:"Guyana",phoneCountryCode:"+592"},{iso:"EC",regions:"厄瓜多尔",regions_en:"Ecuador",phoneCountryCode:"+593"},{iso:"GF",regions:"法属圭亚那",regions_en:"French Guiana",phoneCountryCode:"+594"},{iso:"PY",regions:"巴拉圭",regions_en:"Paraguay",phoneCountryCode:"+595"},{iso:"SR",regions:"苏里南",regions_en:"Suriname",phoneCountryCode:"+597"},{iso:"UY",regions:"乌拉圭",regions_en:"Uruguay",phoneCountryCode:"+598"},{iso:"BQ",regions:"荷兰加勒比",regions_en:"Caribisch Nederland",phoneCountryCode:"+599"},{iso:"CW",regions:"库拉索",regions_en:"Curacao",phoneCountryCode:"+599"},{iso:"TL",regions:"东帝汶",regions_en:"East Timor",phoneCountryCode:"+670"},{iso:"BN",regions:"文莱",regions_en:"Brunei",phoneCountryCode:"+673"},{iso:"NR",regions:"拿鲁岛",regions_en:"Nauru",phoneCountryCode:"+674"},{iso:"PG",regions:"巴布亚新几内亚",regions_en:"Papua New Guinea",phoneCountryCode:"+675"},{iso:"TO",regions:"汤加",regions_en:"Tonga",phoneCountryCode:"+676"},{iso:"SB",regions:"所罗门群岛",regions_en:"Solomon Islands",phoneCountryCode:"+677"},{iso:"VU",regions:"瓦努阿图",regions_en:"Vanuatu",phoneCountryCode:"+678"},{iso:"FJ",regions:"斐济",regions_en:"Fiji",phoneCountryCode:"+679"},{iso:"PW",regions:"帕劳",regions_en:"Palau",phoneCountryCode:"+680"},{iso:"CK",regions:"库克群岛",regions_en:"Cook Islands",phoneCountryCode:"+682"},{iso:"WS",regions:"萨摩亚",regions_en:"Samoa",phoneCountryCode:"+685"},{iso:"KI",regions:"基里巴斯",regions_en:"Kiribati",phoneCountryCode:"+686"},{iso:"NC",regions:"新喀里多尼亚",regions_en:"New Caledonia",phoneCountryCode:"+687"},{iso:"PF",regions:"法属波利尼西亚",regions_en:"French Polynesia",phoneCountryCode:"+689"},{iso:"FM",regions:"密克罗尼西亚",regions_en:"Micronesia",phoneCountryCode:"+691"},{iso:"MH",regions:"马绍尔群岛",regions_en:"Marshall Islands",phoneCountryCode:"+692"},{iso:"KP",regions:"朝鲜",regions_en:"Korea Democratic Rep.",phoneCountryCode:"+850"},{iso:"HK",regions:"中国香港",regions_en:"Hong Kong",phoneCountryCode:"+852"},{iso:"MO",regions:"中国澳门",regions_en:"Macau",phoneCountryCode:"+853"},{iso:"KH",regions:"柬埔寨",regions_en:"Cambodia",phoneCountryCode:"+855"},{iso:"LA",regions:"老挝",regions_en:"Laos",phoneCountryCode:"+856"},{iso:"BD",regions:"孟加拉国",regions_en:"Bangladesh",phoneCountryCode:"+880"},{iso:"TW",regions:"中国台湾",regions_en:"Taiwan",phoneCountryCode:"+886"},{iso:"MV",regions:"马尔代夫",regions_en:"Maldives",phoneCountryCode:"+960"},{iso:"LB",regions:"黎巴嫩",regions_en:"Lebanon",phoneCountryCode:"+961"},{iso:"JO",regions:"约旦",regions_en:"Jordan",phoneCountryCode:"+962"},{iso:"SY",regions:"叙利亚",regions_en:"Syria",phoneCountryCode:"+963"},{iso:"IQ",regions:"伊拉克",regions_en:"Iraq",phoneCountryCode:"+964"},{iso:"KW",regions:"科威特",regions_en:"Kuwait",phoneCountryCode:"+965"},{iso:"SA",regions:"沙特阿拉伯",regions_en:"Saudi Arabia",phoneCountryCode:"+966"},{iso:"YE",regions:"也门",regions_en:"Yemen",phoneCountryCode:"+967"},{iso:"OM",regions:"阿曼",regions_en:"Oman",phoneCountryCode:"+968"},{iso:"AE",regions:"阿拉伯联合酋长国",regions_en:"United Arab Emirates",phoneCountryCode:"+971"},{iso:"IL",regions:"以色列",regions_en:"Israel",phoneCountryCode:"+972"},{iso:"BH",regions:"巴林",regions_en:"Bahrain",phoneCountryCode:"+973"},{iso:"QA",regions:"卡塔尔",regions_en:"Qatar",phoneCountryCode:"+974"},{iso:"BT",regions:"不丹",regions_en:"Bhutan",phoneCountryCode:"+975"},{iso:"MN",regions:"蒙古",regions_en:"Mongolia",phoneCountryCode:"+976"},{iso:"NP",regions:"尼泊尔",regions_en:"Nepal",phoneCountryCode:"+977"},{iso:"TJ",regions:"塔吉克斯坦",regions_en:"Tajikistan",phoneCountryCode:"+992"},{iso:"TM",regions:"土库曼斯坦",regions_en:"Turkmenistan",phoneCountryCode:"+993"},{iso:"AZ",regions:"阿塞拜疆",regions_en:"Azerbaijan",phoneCountryCode:"+994"},{iso:"GE",regions:"格鲁吉亚",regions_en:"Georgia",phoneCountryCode:"+995"},{iso:"KG",regions:"吉尔吉斯斯坦",regions_en:"Kyrgyzstan",phoneCountryCode:"+996"},{iso:"UZ",regions:"乌兹别克斯坦",regions_en:"Uzbekistan",phoneCountryCode:"+998"},{iso:"BS",regions:"巴哈马",regions_en:"Bahamas",phoneCountryCode:"+1242"},{iso:"BB",regions:"巴巴多斯",regions_en:"Barbados",phoneCountryCode:"+1246"},{iso:"AI",regions:"安圭拉",regions_en:"Anguilla",phoneCountryCode:"+1264"},{iso:"AG",regions:"安提瓜和巴布达",regions_en:"Antigua and Barbuda",phoneCountryCode:"+1268"},{iso:"VG",regions:"英属处女群岛",regions_en:"VirginIslands,British",phoneCountryCode:"+1284"},{iso:"KY",regions:"开曼群岛",regions_en:"Cayman Islands",phoneCountryCode:"+1345"},{iso:"BM",regions:"百慕大群岛",regions_en:"Bermuda",phoneCountryCode:"+1441"},{iso:"GD",regions:"格林纳达",regions_en:"Grenada",phoneCountryCode:"+1473"},{iso:"TC",regions:"特克斯和凯科斯群岛",regions_en:"Turksand Caicos Islands",phoneCountryCode:"+1649"},{iso:"MS",regions:"蒙特塞拉特岛",regions_en:"Montserrat",phoneCountryCode:"+1664"},{iso:"GU",regions:"关岛",regions_en:"Guam",phoneCountryCode:"+1671"},{iso:"AS",regions:"美属萨摩亚",regions_en:"American Samoa",phoneCountryCode:"+1684"},{iso:"LC",regions:"圣露西亚",regions_en:"Saint Lucia",phoneCountryCode:"+1758"},{iso:"DM",regions:"多米尼加",regions_en:"Dominica",phoneCountryCode:"+1767"},{iso:"VC",regions:"圣文森特和格林纳丁斯",regions_en:"Saint Vincent and The Grenadines",phoneCountryCode:"+1784"},{iso:"PR",regions:"波多黎各",regions_en:"Puerto Rico",phoneCountryCode:"+1787"},{iso:"DO",regions:"多米尼加共和国",regions_en:"dominican republic",phoneCountryCode:"+1809"},{iso:"TT",regions:"特立尼达和多巴哥",regions_en:"Trinidadand Tobago",phoneCountryCode:"+1868"},{iso:"KN",regions:"圣基茨和尼维斯",regions_en:"Saint Kitts and Nevis",phoneCountryCode:"+1869"},{iso:"JM",regions:"牙买加",regions_en:"Jamaica",phoneCountryCode:"+1876"}],SU=function(e){var t=e.value,n=e.onChange,r=kU.map((function(e){return{value:e.iso,key:e.iso,children:e.phoneCountryCode,label:y().createElement("div",{className:"select-option-item"},y().createElement("span",null,e.phoneCountryCode),y().createElement("div",{className:"country"},y().createElement(dv,{title:"zh-CN"===su.language?e.regions:e.regions_en},"zh-CN"===su.language?e.regions:e.regions_en))),region:e.regions,region_en:e.regions_en}}));
|
|
18057
|
+
return a=c.sent(),[2/*return*/,{status:!1,error:{message:JSON.stringify(a),code:401}}];case 4:return[2/*return*/]}}))}))};return y().createElement(Tq,vU({beforeSend:function(){return o().then((function(e){return gU(void 0,void 0,void 0,(function(){var e,o,a,s,u,f;return yU(this,(function(p){switch(p.label){case 0:return e=r?r.getFieldValue(i||"email"):n,[4/*yield*/,d(e)];case 1:return o=p.sent(),a=o.status,s=o.error,a?null===(u=null==c?void 0:c.onEmailSend)||void 0===u||u.call(c,l,t):null===(f=null==c?void 0:c.onEmailSendError)||void 0===f||f.call(c,s,l,t),[2/*return*/,a]}}))}))})).catch((function(e){var n;return null===(n=null==c?void 0:c.onEmailSendError)||void 0===n||n.call(c,e,l,t),!1}))},form:r},a))},CU=[{iso:"CA",regions:"加拿大",regions_en:"Canada",phoneCountryCode:"+1"},{iso:"US",regions:"美国",regions_en:"United States",phoneCountryCode:"+1"},{iso:"KZ",regions:"哈萨克斯坦",regions_en:"Kazakhstan",phoneCountryCode:"+7"},{iso:"RU",regions:"俄罗斯",regions_en:"Russia",phoneCountryCode:"+7"},{iso:"EG",regions:"埃及",regions_en:"Egypt",phoneCountryCode:"+20"},{iso:"ZA",regions:"南非",regions_en:"South Africa",phoneCountryCode:"+27"},{iso:"GR",regions:"希腊",regions_en:"Greece",phoneCountryCode:"+30"},{iso:"NL",regions:"荷兰",regions_en:"Netherlands",phoneCountryCode:"+31"},{iso:"BE",regions:"比利时",regions_en:"Belgium",phoneCountryCode:"+32"},{iso:"FR",regions:"法国",regions_en:"France",phoneCountryCode:"+33"},{iso:"ES",regions:"西班牙",regions_en:"Spain",phoneCountryCode:"+34"},{iso:"HU",regions:"匈牙利",regions_en:"Hungary",phoneCountryCode:"+36"},{iso:"IT",regions:"意大利",regions_en:"Italy",phoneCountryCode:"+39"},{iso:"RO",regions:"罗马尼亚",regions_en:"Romania",phoneCountryCode:"+40"},{iso:"CH",regions:"瑞士",regions_en:"Switzerland",phoneCountryCode:"+41"},{iso:"AT",regions:"奥地利",regions_en:"Austria",phoneCountryCode:"+43"},{iso:"GB",regions:"英国",regions_en:"United Kingdom",phoneCountryCode:"+44"},{iso:"DK",regions:"丹麦",regions_en:"Denmark",phoneCountryCode:"+45"},{iso:"SE",regions:"瑞典",regions_en:"Sweden",phoneCountryCode:"+46"},{iso:"NO",regions:"挪威",regions_en:"Norway",phoneCountryCode:"+47"},{iso:"PL",regions:"波兰",regions_en:"Poland",phoneCountryCode:"+48"},{iso:"DE",regions:"德国",regions_en:"Germany",phoneCountryCode:"+49"},{iso:"PE",regions:"秘鲁",regions_en:"Peru",phoneCountryCode:"+51"},{iso:"MX",regions:"墨西哥",regions_en:"Mexico",phoneCountryCode:"+52"},{iso:"CU",regions:"古巴",regions_en:"Cuba",phoneCountryCode:"+53"},{iso:"AR",regions:"阿根廷",regions_en:"Argentina",phoneCountryCode:"+54"},{iso:"BR",regions:"巴西",regions_en:"Brazil",phoneCountryCode:"+55"},{iso:"CL",regions:"智利",regions_en:"Chile",phoneCountryCode:"+56"},{iso:"CO",regions:"哥伦比亚",regions_en:"Colombia",phoneCountryCode:"+57"},{iso:"VE",regions:"委内瑞拉",regions_en:"Venezuela",phoneCountryCode:"+58"},{iso:"MY",regions:"马来西亚",regions_en:"Malaysia",phoneCountryCode:"+60"},{iso:"AU",regions:"澳大利亚",regions_en:"Australia",phoneCountryCode:"+61"},{iso:"ID",regions:"印度尼西亚",regions_en:"Indonesia",phoneCountryCode:"+62"},{iso:"PH",regions:"菲律宾",regions_en:"Philippines",phoneCountryCode:"+63"},{iso:"NZ",regions:"新西兰",regions_en:"New Zealand",phoneCountryCode:"+64"},{iso:"SG",regions:"新加坡",regions_en:"Singapore",phoneCountryCode:"+65"},{iso:"TH",regions:"泰国",regions_en:"Thailand",phoneCountryCode:"+66"},{iso:"JP",regions:"日本",regions_en:"Japan",phoneCountryCode:"+81"},{iso:"KR",regions:"韩国",regions_en:"South Korea",phoneCountryCode:"+82"},{iso:"VN",regions:"越南",regions_en:"Vietnam",phoneCountryCode:"+84"},{iso:"CN",regions:"中国",regions_en:"China",phoneCountryCode:"+86"},{iso:"TR",regions:"土耳其",regions_en:"Turkey",phoneCountryCode:"+90"},{iso:"IN",regions:"印度",regions_en:"India",phoneCountryCode:"+91"},{iso:"PK",regions:"巴基斯坦",regions_en:"Pakistan",phoneCountryCode:"+92"},{iso:"AF",regions:"阿富汗",regions_en:"Afghanistan",phoneCountryCode:"+93"},{iso:"LK",regions:"斯里兰卡",regions_en:"Sri Lanka",phoneCountryCode:"+94"},{iso:"MM",regions:"缅甸",regions_en:"Myanmar",phoneCountryCode:"+95"},{iso:"IR",regions:"伊朗",regions_en:"Iran",phoneCountryCode:"+98"},{iso:"MA",regions:"摩洛哥",regions_en:"Morocco",phoneCountryCode:"+212"},{iso:"DZ",regions:"阿尔及利亚",regions_en:"Algeria",phoneCountryCode:"+213"},{iso:"TN",regions:"突尼斯",regions_en:"Tunisia",phoneCountryCode:"+216"},{iso:"LY",regions:"利比亚",regions_en:"Libya",phoneCountryCode:"+218"},{iso:"GM",regions:"冈比亚",regions_en:"Gambia",phoneCountryCode:"+220"},{iso:"SN",regions:"塞内加尔",regions_en:"Senegal",phoneCountryCode:"+221"},{iso:"MR",regions:"毛里塔尼亚",regions_en:"Mauritania",phoneCountryCode:"+222"},{iso:"ML",regions:"马里",regions_en:"Mali",phoneCountryCode:"+223"},{iso:"GN",regions:"几内亚",regions_en:"Guinea",phoneCountryCode:"+224"},{iso:"CI",regions:"象牙海岸",regions_en:"Ivory Coast",phoneCountryCode:"+225"},{iso:"BF",regions:"布基纳法索",regions_en:"Burkina Faso",phoneCountryCode:"+226"},{iso:"NE",regions:"尼日尔",regions_en:"Niger",phoneCountryCode:"+227"},{iso:"TG",regions:"多哥",regions_en:"Togo",phoneCountryCode:"+228"},{iso:"BJ",regions:"贝宁",regions_en:"Benin",phoneCountryCode:"+229"},{iso:"MU",regions:"毛里求斯",regions_en:"Mauritius",phoneCountryCode:"+230"},{iso:"LR",regions:"利比里亚",regions_en:"Liberia",phoneCountryCode:"+231"},{iso:"SL",regions:"塞拉利昂",regions_en:"Sierra Leone",phoneCountryCode:"+232"},{iso:"GH",regions:"加纳",regions_en:"Ghana",phoneCountryCode:"+233"},{iso:"NG",regions:"尼日利亚",regions_en:"Nigeria",phoneCountryCode:"+234"},{iso:"TD",regions:"乍得",regions_en:"Chad",phoneCountryCode:"+235"},{iso:"CF",regions:"中非共和国",regions_en:"Central African Republic",phoneCountryCode:"+236"},{iso:"CM",regions:"喀麦隆",regions_en:"Cameroon",phoneCountryCode:"+237"},{iso:"CV",regions:"开普",regions_en:"Cape Verde",phoneCountryCode:"+238"},{iso:"ST",regions:"圣多美和普林西比",regions_en:"Sao Tome and Principe",phoneCountryCode:"+239"},{iso:"GQ",regions:"赤道几内亚",regions_en:"Equatorial Guinea",phoneCountryCode:"+240"},{iso:"GA",regions:"加蓬",regions_en:"Gabon",phoneCountryCode:"+241"},{iso:"CG",regions:"刚果共和国",regions_en:"Republic Of The Congo",phoneCountryCode:"+242"},{iso:"CD",regions:"刚果民主共和国",regions_en:"Democratic Republic of theCongo",phoneCountryCode:"+243"},{iso:"AO",regions:"安哥拉",regions_en:"Angola",phoneCountryCode:"+244"},{iso:"GW",regions:"几内亚比绍共和国",regions_en:"Guinea-Bissau",phoneCountryCode:"+245"},{iso:"SC",regions:"塞舌尔",regions_en:"Seychelles",phoneCountryCode:"+248"},{iso:"SD",regions:"苏丹",regions_en:"Sudan",phoneCountryCode:"+249"},{iso:"RW",regions:"卢旺达",regions_en:"Rwanda",phoneCountryCode:"+250"},{iso:"ET",regions:"埃塞俄比亚",regions_en:"Ethiopia",phoneCountryCode:"+251"},{iso:"SO",regions:"索马里",regions_en:"Somalia",phoneCountryCode:"+252"},{iso:"DJ",regions:"吉布提",regions_en:"Djibouti",phoneCountryCode:"+253"},{iso:"KE",regions:"肯尼亚",regions_en:"Kenya",phoneCountryCode:"+254"},{iso:"TZ",regions:"坦桑尼亚",regions_en:"Tanzania",phoneCountryCode:"+255"},{iso:"UG",regions:"乌干达",regions_en:"Uganda",phoneCountryCode:"+256"},{iso:"BI",regions:"布隆迪",regions_en:"Burundi",phoneCountryCode:"+257"},{iso:"MZ",regions:"莫桑比克",regions_en:"Mozambique",phoneCountryCode:"+258"},{iso:"ZM",regions:"赞比亚",regions_en:"Zambia",phoneCountryCode:"+260"},{iso:"MG",regions:"马达加斯加",regions_en:"Madagascar",phoneCountryCode:"+261"},{iso:"RE",regions:"留尼汪",regions_en:"Réunion Island",phoneCountryCode:"+262"},{iso:"ZW",regions:"津巴布韦",regions_en:"Zimbabwe",phoneCountryCode:"+263"},{iso:"NA",regions:"纳米比亚",regions_en:"Namibia",phoneCountryCode:"+264"},{iso:"MW",regions:"马拉维",regions_en:"Malawi",phoneCountryCode:"+265"},{iso:"LS",regions:"莱索托",regions_en:"Lesotho",phoneCountryCode:"+266"},{iso:"BW",regions:"博茨瓦纳",regions_en:"Botswana",phoneCountryCode:"+267"},{iso:"SZ",regions:"斯威士兰",regions_en:"Swaziland",phoneCountryCode:"+268"},{iso:"KM",regions:"科摩罗",regions_en:"Comoros",phoneCountryCode:"+269"},{iso:"YT",regions:"马约特",regions_en:"Mayotte",phoneCountryCode:"+269"},{iso:"ER",regions:"厄立特里亚",regions_en:"Eritrea",phoneCountryCode:"+291"},{iso:"AW",regions:"阿鲁巴",regions_en:"Aruba",phoneCountryCode:"+297"},{iso:"FO",regions:"法罗群岛",regions_en:"Faroe Islands",phoneCountryCode:"+298"},{iso:"GL",regions:"格陵兰岛",regions_en:"Greenland",phoneCountryCode:"+299"},{iso:"GI",regions:"直布罗陀",regions_en:"Gibraltar",phoneCountryCode:"+350"},{iso:"PT",regions:"葡萄牙",regions_en:"Portugal",phoneCountryCode:"+351"},{iso:"LU",regions:"卢森堡",regions_en:"Luxembourg",phoneCountryCode:"+352"},{iso:"IE",regions:"爱尔兰",regions_en:"Ireland",phoneCountryCode:"+353"},{iso:"IS",regions:"冰岛",regions_en:"Iceland",phoneCountryCode:"+354"},{iso:"AL",regions:"阿尔巴尼亚",regions_en:"Albania",phoneCountryCode:"+355"},{iso:"MT",regions:"马耳他",regions_en:"Malta",phoneCountryCode:"+356"},{iso:"CY",regions:"塞浦路斯",regions_en:"Cyprus",phoneCountryCode:"+357"},{iso:"FI",regions:"芬兰",regions_en:"Finland",phoneCountryCode:"+358"},{iso:"BG",regions:"保加利亚",regions_en:"Bulgaria",phoneCountryCode:"+359"},{iso:"LT",regions:"立陶宛",regions_en:"Lithuania",phoneCountryCode:"+370"},{iso:"LV",regions:"拉脱维亚",regions_en:"Latvia",phoneCountryCode:"+371"},{iso:"EE",regions:"爱沙尼亚",regions_en:"Estonia",phoneCountryCode:"+372"},{iso:"MD",regions:"摩尔多瓦",regions_en:"Moldova",phoneCountryCode:"+373"},{iso:"AM",regions:"亚美尼亚",regions_en:"Armenia",phoneCountryCode:"+374"},{iso:"BY",regions:"白俄罗斯",regions_en:"Belarus",phoneCountryCode:"+375"},{iso:"AD",regions:"安道尔",regions_en:"Andorra",phoneCountryCode:"+376"},{iso:"MC",regions:"摩纳哥",regions_en:"Monaco",phoneCountryCode:"+377"},{iso:"SM",regions:"圣马力诺",regions_en:"San Marino",phoneCountryCode:"+378"},{iso:"UA",regions:"乌克兰",regions_en:"Ukraine",phoneCountryCode:"+380"},{iso:"RS",regions:"塞尔维亚",regions_en:"Serbia",phoneCountryCode:"+381"},{iso:"ME",regions:"黑山",regions_en:"Montenegro",phoneCountryCode:"+382"},{iso:"HR",regions:"克罗地亚",regions_en:"Croatia",phoneCountryCode:"+385"},{iso:"SI",regions:"斯洛文尼亚",regions_en:"Slovenia",phoneCountryCode:"+386"},{iso:"BA",regions:"波斯尼亚和黑塞哥维那",regions_en:"Bosniaand Herzegovina",phoneCountryCode:"+387"},{iso:"MK",regions:"马其顿",regions_en:"Macedonia",phoneCountryCode:"+389"},{iso:"CZ",regions:"捷克",regions_en:"Czech",phoneCountryCode:"+420"},{iso:"SK",regions:"斯洛伐克",regions_en:"Slovakia",phoneCountryCode:"+421"},{iso:"LI",regions:"列支敦士登",regions_en:"Liechtenstein",phoneCountryCode:"+423"},{iso:"BZ",regions:"伯利兹",regions_en:"Belize",phoneCountryCode:"+501"},{iso:"GT",regions:"瓜地马拉",regions_en:"Guatemala",phoneCountryCode:"+502"},{iso:"SV",regions:"萨尔瓦多",regions_en:"ElSalvador",phoneCountryCode:"+503"},{iso:"HN",regions:"洪都拉斯",regions_en:"Honduras",phoneCountryCode:"+504"},{iso:"NI",regions:"尼加拉瓜",regions_en:"Nicaragua",phoneCountryCode:"+505"},{iso:"CR",regions:"哥斯达黎加",regions_en:"CostaRica",phoneCountryCode:"+506"},{iso:"PA",regions:"巴拿马",regions_en:"Panama",phoneCountryCode:"+507"},{iso:"PM",regions:"圣彼埃尔和密克隆岛",regions_en:"Saint Pierreand Miquelon",phoneCountryCode:"+508"},{iso:"HT",regions:"海地",regions_en:"Haiti",phoneCountryCode:"+509"},{iso:"GP",regions:"瓜德罗普岛",regions_en:"Guadeloupe",phoneCountryCode:"+590"},{iso:"BO",regions:"玻利维亚",regions_en:"Bolivia",phoneCountryCode:"+591"},{iso:"GY",regions:"圭亚那",regions_en:"Guyana",phoneCountryCode:"+592"},{iso:"EC",regions:"厄瓜多尔",regions_en:"Ecuador",phoneCountryCode:"+593"},{iso:"GF",regions:"法属圭亚那",regions_en:"French Guiana",phoneCountryCode:"+594"},{iso:"PY",regions:"巴拉圭",regions_en:"Paraguay",phoneCountryCode:"+595"},{iso:"SR",regions:"苏里南",regions_en:"Suriname",phoneCountryCode:"+597"},{iso:"UY",regions:"乌拉圭",regions_en:"Uruguay",phoneCountryCode:"+598"},{iso:"BQ",regions:"荷兰加勒比",regions_en:"Caribisch Nederland",phoneCountryCode:"+599"},{iso:"CW",regions:"库拉索",regions_en:"Curacao",phoneCountryCode:"+599"},{iso:"TL",regions:"东帝汶",regions_en:"East Timor",phoneCountryCode:"+670"},{iso:"BN",regions:"文莱",regions_en:"Brunei",phoneCountryCode:"+673"},{iso:"NR",regions:"拿鲁岛",regions_en:"Nauru",phoneCountryCode:"+674"},{iso:"PG",regions:"巴布亚新几内亚",regions_en:"Papua New Guinea",phoneCountryCode:"+675"},{iso:"TO",regions:"汤加",regions_en:"Tonga",phoneCountryCode:"+676"},{iso:"SB",regions:"所罗门群岛",regions_en:"Solomon Islands",phoneCountryCode:"+677"},{iso:"VU",regions:"瓦努阿图",regions_en:"Vanuatu",phoneCountryCode:"+678"},{iso:"FJ",regions:"斐济",regions_en:"Fiji",phoneCountryCode:"+679"},{iso:"PW",regions:"帕劳",regions_en:"Palau",phoneCountryCode:"+680"},{iso:"CK",regions:"库克群岛",regions_en:"Cook Islands",phoneCountryCode:"+682"},{iso:"WS",regions:"萨摩亚",regions_en:"Samoa",phoneCountryCode:"+685"},{iso:"KI",regions:"基里巴斯",regions_en:"Kiribati",phoneCountryCode:"+686"},{iso:"NC",regions:"新喀里多尼亚",regions_en:"New Caledonia",phoneCountryCode:"+687"},{iso:"PF",regions:"法属波利尼西亚",regions_en:"French Polynesia",phoneCountryCode:"+689"},{iso:"FM",regions:"密克罗尼西亚",regions_en:"Micronesia",phoneCountryCode:"+691"},{iso:"MH",regions:"马绍尔群岛",regions_en:"Marshall Islands",phoneCountryCode:"+692"},{iso:"KP",regions:"朝鲜",regions_en:"Korea Democratic Rep.",phoneCountryCode:"+850"},{iso:"HK",regions:"中国香港",regions_en:"Hong Kong",phoneCountryCode:"+852"},{iso:"MO",regions:"中国澳门",regions_en:"Macau",phoneCountryCode:"+853"},{iso:"KH",regions:"柬埔寨",regions_en:"Cambodia",phoneCountryCode:"+855"},{iso:"LA",regions:"老挝",regions_en:"Laos",phoneCountryCode:"+856"},{iso:"BD",regions:"孟加拉国",regions_en:"Bangladesh",phoneCountryCode:"+880"},{iso:"TW",regions:"中国台湾",regions_en:"Taiwan",phoneCountryCode:"+886"},{iso:"MV",regions:"马尔代夫",regions_en:"Maldives",phoneCountryCode:"+960"},{iso:"LB",regions:"黎巴嫩",regions_en:"Lebanon",phoneCountryCode:"+961"},{iso:"JO",regions:"约旦",regions_en:"Jordan",phoneCountryCode:"+962"},{iso:"SY",regions:"叙利亚",regions_en:"Syria",phoneCountryCode:"+963"},{iso:"IQ",regions:"伊拉克",regions_en:"Iraq",phoneCountryCode:"+964"},{iso:"KW",regions:"科威特",regions_en:"Kuwait",phoneCountryCode:"+965"},{iso:"SA",regions:"沙特阿拉伯",regions_en:"Saudi Arabia",phoneCountryCode:"+966"},{iso:"YE",regions:"也门",regions_en:"Yemen",phoneCountryCode:"+967"},{iso:"OM",regions:"阿曼",regions_en:"Oman",phoneCountryCode:"+968"},{iso:"AE",regions:"阿拉伯联合酋长国",regions_en:"United Arab Emirates",phoneCountryCode:"+971"},{iso:"IL",regions:"以色列",regions_en:"Israel",phoneCountryCode:"+972"},{iso:"BH",regions:"巴林",regions_en:"Bahrain",phoneCountryCode:"+973"},{iso:"QA",regions:"卡塔尔",regions_en:"Qatar",phoneCountryCode:"+974"},{iso:"BT",regions:"不丹",regions_en:"Bhutan",phoneCountryCode:"+975"},{iso:"MN",regions:"蒙古",regions_en:"Mongolia",phoneCountryCode:"+976"},{iso:"NP",regions:"尼泊尔",regions_en:"Nepal",phoneCountryCode:"+977"},{iso:"TJ",regions:"塔吉克斯坦",regions_en:"Tajikistan",phoneCountryCode:"+992"},{iso:"TM",regions:"土库曼斯坦",regions_en:"Turkmenistan",phoneCountryCode:"+993"},{iso:"AZ",regions:"阿塞拜疆",regions_en:"Azerbaijan",phoneCountryCode:"+994"},{iso:"GE",regions:"格鲁吉亚",regions_en:"Georgia",phoneCountryCode:"+995"},{iso:"KG",regions:"吉尔吉斯斯坦",regions_en:"Kyrgyzstan",phoneCountryCode:"+996"},{iso:"UZ",regions:"乌兹别克斯坦",regions_en:"Uzbekistan",phoneCountryCode:"+998"},{iso:"BS",regions:"巴哈马",regions_en:"Bahamas",phoneCountryCode:"+1242"},{iso:"BB",regions:"巴巴多斯",regions_en:"Barbados",phoneCountryCode:"+1246"},{iso:"AI",regions:"安圭拉",regions_en:"Anguilla",phoneCountryCode:"+1264"},{iso:"AG",regions:"安提瓜和巴布达",regions_en:"Antigua and Barbuda",phoneCountryCode:"+1268"},{iso:"VG",regions:"英属处女群岛",regions_en:"VirginIslands,British",phoneCountryCode:"+1284"},{iso:"KY",regions:"开曼群岛",regions_en:"Cayman Islands",phoneCountryCode:"+1345"},{iso:"BM",regions:"百慕大群岛",regions_en:"Bermuda",phoneCountryCode:"+1441"},{iso:"GD",regions:"格林纳达",regions_en:"Grenada",phoneCountryCode:"+1473"},{iso:"TC",regions:"特克斯和凯科斯群岛",regions_en:"Turksand Caicos Islands",phoneCountryCode:"+1649"},{iso:"MS",regions:"蒙特塞拉特岛",regions_en:"Montserrat",phoneCountryCode:"+1664"},{iso:"GU",regions:"关岛",regions_en:"Guam",phoneCountryCode:"+1671"},{iso:"AS",regions:"美属萨摩亚",regions_en:"American Samoa",phoneCountryCode:"+1684"},{iso:"LC",regions:"圣露西亚",regions_en:"Saint Lucia",phoneCountryCode:"+1758"},{iso:"DM",regions:"多米尼加",regions_en:"Dominica",phoneCountryCode:"+1767"},{iso:"VC",regions:"圣文森特和格林纳丁斯",regions_en:"Saint Vincent and The Grenadines",phoneCountryCode:"+1784"},{iso:"PR",regions:"波多黎各",regions_en:"Puerto Rico",phoneCountryCode:"+1787"},{iso:"DO",regions:"多米尼加共和国",regions_en:"dominican republic",phoneCountryCode:"+1809"},{iso:"TT",regions:"特立尼达和多巴哥",regions_en:"Trinidadand Tobago",phoneCountryCode:"+1868"},{iso:"KN",regions:"圣基茨和尼维斯",regions_en:"Saint Kitts and Nevis",phoneCountryCode:"+1869"},{iso:"JM",regions:"牙买加",regions_en:"Jamaica",phoneCountryCode:"+1876"}],EU=function(e){var t=e.value,n=e.onChange,r=CU.map((function(e){return{value:e.iso,key:e.iso,children:e.phoneCountryCode,label:y().createElement("div",{className:"select-option-item"},y().createElement("span",null,e.phoneCountryCode),y().createElement("div",{className:"country"},y().createElement(dv,{title:"zh-CN"===su.resolvedLanguage?e.regions:e.regions_en},"zh-CN"===su.resolvedLanguage?e.regions:e.regions_en))),region:e.regions,region_en:e.regions_en}}));
|
|
18060
18058
|
// 只能单次遍历了
|
|
18061
18059
|
// const [open, setOpen] = useState(false)
|
|
18062
18060
|
// 现在需要回填国际化短信
|
|
18063
|
-
return y().createElement(cI,{showSearch:!0,popupClassName:"areacode-virtual-dropdown",bordered:!1,listHeight:258,options:r,value:t,onChange:n,onClick:function(e){e.preventDefault(),e.stopPropagation()},optionLabelProp:"children",dropdownMatchSelectWidth:138,filterOption:function(e,t){return t.children.toLowerCase().indexOf(e.toLowerCase())>=0||(t.region.toLowerCase().indexOf(e.toLowerCase())>=0||t.region_en.toLowerCase().indexOf(e.toLowerCase())>=0)},suffixIcon:y().createElement(y().Fragment,null,y().createElement(YD,{className:"areacode-virtual-dropdown-icon",type:"authing-arrow-down-s-fill",style:{width:20,height:20}}))})},
|
|
18061
|
+
return y().createElement(cI,{showSearch:!0,popupClassName:"areacode-virtual-dropdown",bordered:!1,listHeight:258,options:r,value:t,onChange:n,onClick:function(e){e.preventDefault(),e.stopPropagation()},optionLabelProp:"children",dropdownMatchSelectWidth:138,filterOption:function(e,t){return t.children.toLowerCase().indexOf(e.toLowerCase())>=0||(t.region.toLowerCase().indexOf(e.toLowerCase())>=0||t.region_en.toLowerCase().indexOf(e.toLowerCase())>=0)},suffixIcon:y().createElement(y().Fragment,null,y().createElement(YD,{className:"areacode-virtual-dropdown-icon",type:"authing-arrow-down-s-fill",style:{width:20,height:20}}))})},kU=function(){return kU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kU.apply(this,arguments)},SU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},xU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},PU=y().useEffect,_U=y().useState,TU=function(e){var t=e.areaCode,n=e.onAreaCodeChange,r=e.onChange,o=e.value,i=SU(e,["areaCode","onAreaCodeChange","onChange","value"]),a=Pu().t,s=xU(_U(/^[^a-zA-Z]*$/.test(String(o))?o:""),2),c=s[0],l=s[1];
|
|
18064
18062
|
// 当formValue变化时候
|
|
18065
|
-
|
|
18063
|
+
PU((function(){l(/^[^a-zA-Z]*$/.test(String(o))?o:"")}),[o]);return y().createElement(y().Fragment,null,y().createElement(rO,kU({autoComplete:"off",pattern:"[^a-zA-Z]*",value:c,placeholder:a("login.inputPhone")},i,{onChange:function(e){var t=e.target.value;/^[^a-zA-Z]*$/.test(t)&&function(e){l(e.target.value),null==r||r(e)}(e)},prefix:y().createElement(EU,{value:t,onChange:n}),maxLength:20})))},OU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},NU=y().useState,IU=function(e){var t=e.value,n=e.onChange,r=OU(NU(!1),2),o=r[0],i=r[1],a=Pu().t,s=fL().host,c=y().createElement("div",null,y().createElement(VD,null),y().createElement("div",{style:{marginTop:8}},"Upload"));return y().createElement(lD,{name:"file",accept:"image/*",listType:"picture-card",showUploadList:!1,action:"".concat(s,"/api/v2/upload?folder=photos"),onChange:function(e){var t=e.file.status;if(i("uploading"===t),"done"===t){var r=e.file.response,o=r.code,s=r.message,c=r.data;if(200!==o)return vC.error(s);var l=c.url;null==n||n(l)}else"error"===t&&vC.error(a("common.uploadFail",{name:e.file.name}))}},y().createElement(wI,{size:"small",spinning:o},t?y().createElement("img",{src:t,alt:"",style:{width:"100%"}}):c))},AU=function(e,t){var n,r=null==e?void 0:e[t],o=(null===(n=null==e?void 0:e.i18n)||void 0===n?void 0:n[t])||{},i=null==o?void 0:o[su.resolvedLanguage];return(null==i?void 0:i.enabled)&&(null==i?void 0:i.value)||r},RU=i(5996),MU=i.n(RU),DU=function(){return DU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},DU.apply(this,arguments)},LU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},FU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},jU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},BU=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qU=y().useCallback,UU=y().useEffect,VU=y().useMemo,$U=y().useRef,zU=y().useState,HU=yS,WU=function(e,t){return t.props.value.toLowerCase().indexOf(e.toLowerCase())>=0||t.props.label.toLowerCase().indexOf(e.toLowerCase())>=0},GU=function(e){var t,n,r=e.metaData,o=e.businessRequest,i=oL(),a=null==i?void 0:i.verifyCodeLength,s=$U(null),c=jU(zU([]),2),l=c[0],u=c[1],d=(null===(t=null==i?void 0:i.internationalSmsConfig)||void 0===t?void 0:t.enabled)||!1,f=jU(zU((null===(n=null==i?void 0:i.internationalSmsConfig)||void 0===n?void 0:n.defaultISOType)||"CN"),2),p=f[0],h=f[1],m=rQ(),v=m.get,g=m.post,b=Pu().t,w=jU(sT.useForm(),1)[0],C=qU((function(){return LU(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,c,l;return FU(this,(function(d){switch(d.label){case 0:return[4/*yield*/,v("/api/v2/country-list")];case 1:e=d.sent().data,t="zh-CN"===su.resolvedLanguage?null==e?void 0:e.zh:null==e?void 0:e.en,n=[];try{for(r=BU(Object.entries(t)),o=r.next();!o.done;o=r.next())i=jU(o.value,2),a=i[0],s=i[1],n.push({label:s+" (".concat(a,")"),value:a})}catch(e){c={error:e}}finally{try{o&&!o.done&&(l=r.return)&&l.call(r)}finally{if(c)throw c.error}}return u(n),[2/*return*/]}}))}))}),[v]);UU((function(){r.map((function(e){return e.name})).includes("country")&&C()}),[C,r]);var E=qU((function(e){return d?y().createElement(TU,DU({},e,{className:"authing-g2-input",size:"large",areaCode:p,onAreaCodeChange:function(e){h(e),w.getFieldValue(["internal phone:phone"])&&w.validateFields(["internal phone:phone"])},maxLength:20})):y().createElement(xq,DU({},e,{className:"authing-g2-input",autoComplete:"off",key:"internal-phone:phone123",type:"tel",size:"large",maxLength:11,placeholder:b("login.inputPhone")}))}),[p,w,d,b]),k=VU((function(){return{gender:function(e){return y().createElement(cI,{key:e.key,className:MU()("authing-g2-select","authing-g2-input"),popupClassName:"authing-g2-dropdown",options:[{label:su.t("common.man"),value:"M"},{label:su.t("common.female"),value:"F"}]})},country:function(e){return y().createElement(cI,{key:e.key,className:MU()("authing-g2-select","authing-g2-input"),popupClassName:"authing-g2-dropdown",options:l,showSearch:!0,filterOption:WU})},image:function(){return y().createElement(IU,null)},number:function(e){return y().createElement(xq,{key:e.key,style:{width:"100%"},className:"authing-g2-input"})},date:function(e){return y().createElement(HU,{key:e.key,className:"authing-g2-input",style:{width:"100%"},placeholder:su.t("common.pleaseSelectDate")})},datetime:function(e){return y().createElement(HU,{key:e.key,className:"authing-g2-input",style:{width:"100%"},placeholder:su.t("common.pleaseSelectDate")})},select:function(e){return y().createElement(cI,{key:e.key,className:MU()("authing-g2-select","authing-g2-input"),popupClassName:"authing-g2-dropdown",showSearch:!0,options:e.options,filterOption:WU})},dropdown:function(e){return y().createElement(cI,{key:e.key,className:MU()("authing-g2-select","authing-g2-input"),popupClassName:"authing-g2-dropdown",showSearch:!0,options:e.options,filterOption:WU})},boolean:function(e){return y().createElement(cI,{key:e.key,className:MU()("authing-g2-select","authing-g2-input"),popupClassName:"authing-g2-dropdown",options:[{label:su.t("common.yes"),value:!0},{label:su.t("common.no"),value:!1}]})},string:function(e){return y().createElement(rO,{key:e.key,type:"text",size:"large",className:"authing-g2-input",autoComplete:"off"})},text:function(e){return y().createElement(rO,{key:e.key,type:"text",size:"large",className:"authing-g2-input",autoComplete:"off"})},textarea:function(e){return y().createElement(rO.TextArea,{key:e.key,
|
|
18066
18064
|
// className="authing-g2-textarea"
|
|
18067
|
-
className:
|
|
18065
|
+
className:MU()("authing-g2-textarea","authing-g2-input"),maxLength:200,rows:4,style:{marginBottom:10}})}}}),[l]),S=VU((function(){return{username:function(e){var t;return y().createElement(UB.UserName,{validateFirst:!0,className:"authing-g2-input-form",name:"username",key:e.key,label:null!==(t=e.label)&&void 0!==t?t:su.t("common.username"),required:e.required,checkRepeat:!0},y().createElement(rO,{className:"authing-g2-input",autoComplete:"username",key:"internal-username:asdf",size:"large",maxLength:11,placeholder:b("login.inputUsername")}))},phone:function(e){var t;return y().createElement(y().Fragment,null,y().createElement(UB.Phone,{validateFirst:!0,className:d?"authing-g2-input-form remove-padding":"authing-g2-input-form",name:"phone",key:"internal-phone:phone",label:null!==(t=e.label)&&void 0!==t?t:su.t("common.phoneLabel"),required:e.required,checkRepeat:!0,areaCode:p},y().createElement(E,null)),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"phoneCode",key:"internal-phone:code",rules:e.required?pQ(b("common.captchaCode")):void 0},y().createElement(Rq,{isInternationSms:d,areaCode:p,className:"authing-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:b("common.inputFourVerifyCode",{length:a}),scene:Ii.SCENE_TYPE_COMPLETE_PHONE,maxLength:a,fieldName:"phone",form:w,onSendCodeBefore:function(){return w.validateFields(["phone"])}})))},email:function(e){var t;return y().createElement(y().Fragment,null,y().createElement(UB.Email,{className:"authing-g2-input-form",name:"email",checkRepeat:!0,label:null!==(t=e.label)&&void 0!==t?t:su.t("common.email"),required:e.required,key:"internal email:email13",validateFirst:!0},y().createElement(rO,{className:"authing-g2-input",autoComplete:"email",size:"large",placeholder:b("login.inputEmail")})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"emailCode",key:"internal email:code1432",rules:e.required?pQ(b("common.captchaCode")):void 0},y().createElement(wU,{className:"authing-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:b("common.inputFourVerifyCode",{length:a}),maxLength:a,data:"",scene:Nc.INFORMATION_COMPLETION_VERIFY_CODE,fieldName:"email",form:w,onSendCodeBefore:function(){return w.validateFields(["email"])}})))}}}),[E,p,w,d,b,a]),x=qU((function(e){var t,n,r=null===(t=i.extendsFieldsI18n)||void 0===t?void 0:t[e.name],o=MQ();return(null===(n=null==r?void 0:r[o])||void 0===n?void 0:n.enabled)&&(null==r?void 0:r[o].value)?null==r?void 0:r[o].value:e.label||e.name}),[i.extendsFieldsI18n]),P=qU((function(e){var t,n,r=[],o=x(e),i=null!==(t=e.validateRules)&&void 0!==t?t:[];return null!==(n=e.required)&&void 0!==n&&n&&r.push({type:"any",required:!0,validateTrigger:"onChange",message:b("login.noEmpty",{label:o})}),
|
|
18068
18066
|
// TODO 后端的 rule Type 有很多 前端目前只做了两种的映射
|
|
18069
|
-
i.forEach((function(e){switch(e.type){case"isNumber":r.push({type:"number",validateTrigger:"onBlur",message:
|
|
18067
|
+
i.forEach((function(e){switch(e.type){case"isNumber":r.push({type:"number",validateTrigger:"onBlur",message:AU(e,"errorMessage")||e.errorMessage||"请填写数字"});break;case"regExp":r.push({validateTrigger:"onBlur",pattern:new RegExp(e.content.replaceAll("/","")),message:AU(e,"errorMessage")||e.errorMessage})}})),r}),[x,b]),_=qU((function(e){
|
|
18070
18068
|
// const label =
|
|
18071
|
-
// i18n.
|
|
18069
|
+
// i18n.resolvedLanguage === 'zh-CN'
|
|
18072
18070
|
// ? metaData.label || metaData.name
|
|
18073
18071
|
// : metaData.name
|
|
18074
18072
|
var t=x(e);
|
|
@@ -18081,16 +18079,16 @@ return["country","gender"].includes(e.name)?n(k[e.name]({options:e.options,key:e
|
|
|
18081
18079
|
// TODO 默认这里手机号与邮箱 都是有验证码的
|
|
18082
18080
|
if("phone"===t){if(d){var r=uj(d,e[t],p).countryCode;return DU(DU({},n),{code:e.phoneCode,phoneCountryCode:r})}return DU(DU({},n),{code:e.phoneCode})}return"email"===t?DU(DU({},n),{code:e.emailCode}):n})),k.label=1;case 1:return k.trys.push([1,9,10,11]),t.includes("username")?[4/*yield*/,v("/api/v2/users/is-user-exists",{username:e.username})]:[3/*break*/,3];case 2:
|
|
18083
18081
|
// checkResult 为 true 时 代表用户名已存在 直接报message 并且不调用注册接口
|
|
18084
|
-
if(r=k.sent(),i=r.data,200===(h=r.code)&&i)return vC.error(b("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},d&&(c=uj(d,e.phone,p).countryCode,a.phoneCountryCode=c),[4/*yield*/,g("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),h=l.statusCode,u=l.data,y=u.valid,w=u.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,g("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(f=k.sent(),h=f.statusCode,m=f.data,y=m.valid,w=m.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=s.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[p]),2),N=O[1];return y().createElement(sT,{layout:"vertical",form:w,onFinish:N,onSubmitCapture:function(){return s.current.onSpin(!0)},onFinishFailed:function(){return s.current.onError()},className:"authing-g2-completeInfo-form authing-g2-form-required-item-icon-after"},T,y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:b("common.problem.form.submit"),ref:s,className:"password g2-completeInfo-submit"})))},KU=function(){return KU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KU.apply(this,arguments)},YU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(gU||(gU={}));var QU,ZU=function(e,t){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,RQ().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},XU=function(e,t,n){var r=RQ().post;if("registerByEmail"===e){var o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var i=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,r("/api/v2/register-phone-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),emailToken:i,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}o=n.phoneToken,i=n.emailToken;return delete n.phoneToken,delete n.emailToken,r("/api/v2/register-".concat(e.split("-")[0]),KU(KU({},t),{profile:KU(KU({},t.profile),n),postUserInfoPipeline:!0,phoneToken:o,emailToken:i}))},eV=function(e,t,n,r){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(o){switch(o.label){case 0:return e!==gU.Skip?[3/*break*/,2]:[4/*yield*/,(i=t,a=n,s=RQ().post,s("registerByEmail"===i?"/api/v2/register-email":"registerByPhoneCode"===i?"/api/v2/register-phone-code":"registerByEmailCode"===i?"/api/v2/register-email-code":"/api/v2/register-".concat(i.split("-")[0]),a))];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==gU.Complete?[3/*break*/,4]:[4/*yield*/,XU(t,n,r)];case 4:return[2/*return*/]}var i,a,s}))}))},tV=function(){return tV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tV.apply(this,arguments)},nV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},oV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iV=y().useCallback,aV=y().useEffect,sV=y().useMemo,cV=y().useState,lV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;fB();var o=fL(),i=Pu().t,a=rL().spinChange,s=oV(cV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(hj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(gU.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(YD,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(GU,{metaData:t,businessRequest:function(e){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(gU.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},uV=function(){var e=cL(),t=e.metaData,n=e.skip,r=uL(),o=WL(),i=hL().instance;return y().createElement(lV,{metaData:t,businessRequest:function(e,t){return nV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return rV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,ZU(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},dV=function(){var e=cL(),t=oL(),n=uL(),r=WL(),o=iL().get,i=fL(),a=oV(cV(),2),s=a[0],c=a[1],l=oV(cV(),2),u=l[0],d=l[1],f=sV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==sq[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=sV((function(){return i.loadingComponent}),[i.loadingComponent]),m=iV((function(){return nV(void 0,void 0,void 0,(function(){var e;return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return aV((function(){m()}),[m]),aV((function(){if(s){var e=function(e,t){return void 0===e&&(e=[]),e.map((function(e){var n;return{type:e.inputType,label:e.label,name:e.name,required:e.required,validateRules:e.validateRules.map((function(e){return{type:e.type,content:e.content,errorMessage:e.errorMessage,i18n:e.i18n}})),options:null===(n=t.find((function(t){return t.key===e.name})))||void 0===n?void 0:n.options}}))}(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(lV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return nV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return rV(this,(function(b){switch(b.label){case 0:return i=function(e,t){var n=[],r={};return null==t||t.forEach((function(t){var o,i=t.name,a=t.value,s=t.code,c=null===(o=e.find((function(e){return e.name===i})))||void 0===o?void 0:o.type;
|
|
18082
|
+
if(r=k.sent(),i=r.data,200===(h=r.code)&&i)return vC.error(b("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},d&&(c=uj(d,e.phone,p).countryCode,a.phoneCountryCode=c),[4/*yield*/,g("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),h=l.statusCode,u=l.data,y=u.valid,w=u.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,g("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(f=k.sent(),h=f.statusCode,m=f.data,y=m.valid,w=m.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=s.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[p]),2),N=O[1];return y().createElement(sT,{layout:"vertical",form:w,onFinish:N,onSubmitCapture:function(){return s.current.onSpin(!0)},onFinishFailed:function(){return s.current.onError()},className:"authing-g2-completeInfo-form authing-g2-form-required-item-icon-after"},T,y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:b("common.problem.form.submit"),ref:s,className:"password g2-completeInfo-submit"})))},KU=function(){return KU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KU.apply(this,arguments)},YU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(mU||(mU={}));var QU,ZU=function(e,t){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},XU=function(e,t,n){var r=nQ().post;if("registerByEmail"===e){var o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var i=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,r("/api/v2/register-phone-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),emailToken:i,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}o=n.phoneToken,i=n.emailToken;return delete n.phoneToken,delete n.emailToken,r("/api/v2/register-".concat(e.split("-")[0]),KU(KU({},t),{profile:KU(KU({},t.profile),n),postUserInfoPipeline:!0,phoneToken:o,emailToken:i}))},eV=function(e,t,n,r){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(o){switch(o.label){case 0:return e!==mU.Skip?[3/*break*/,2]:[4/*yield*/,(i=t,a=n,s=nQ().post,s("registerByEmail"===i?"/api/v2/register-email":"registerByPhoneCode"===i?"/api/v2/register-phone-code":"registerByEmailCode"===i?"/api/v2/register-email-code":"/api/v2/register-".concat(i.split("-")[0]),a))];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==mU.Complete?[3/*break*/,4]:[4/*yield*/,XU(t,n,r)];case 4:return[2/*return*/]}var i,a,s}))}))},tV=function(){return tV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tV.apply(this,arguments)},nV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},oV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iV=y().useCallback,aV=y().useEffect,sV=y().useMemo,cV=y().useState,lV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;fB();var o=fL(),i=Pu().t,a=rL().spinChange,s=oV(cV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(hj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(mU.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(YD,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(GU,{metaData:t,businessRequest:function(e){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(mU.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},uV=function(){var e=cL(),t=e.metaData,n=e.skip,r=uL(),o=WL(),i=hL().instance;return y().createElement(lV,{metaData:t,businessRequest:function(e,t){return nV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return rV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,ZU(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},dV=function(){var e=cL(),t=oL(),n=uL(),r=WL(),o=iL().get,i=fL(),a=oV(cV(),2),s=a[0],c=a[1],l=oV(cV(),2),u=l[0],d=l[1],f=sV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==sq[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=sV((function(){return i.loadingComponent}),[i.loadingComponent]),m=iV((function(){return nV(void 0,void 0,void 0,(function(){var e;return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return aV((function(){m()}),[m]),aV((function(){if(s){var e=function(e,t){return void 0===e&&(e=[]),e.map((function(e){var n;return{type:e.inputType,label:e.label,name:e.name,required:e.required,validateRules:e.validateRules.map((function(e){return{type:e.type,content:e.content,errorMessage:e.errorMessage,i18n:e.i18n}})),options:null===(n=t.find((function(t){return t.key===e.name})))||void 0===n?void 0:n.options}}))}(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(lV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return nV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return rV(this,(function(b){switch(b.label){case 0:return i=function(e,t){var n=[],r={};return null==t||t.forEach((function(t){var o,i=t.name,a=t.value,s=t.code,c=null===(o=e.find((function(e){return e.name===i})))||void 0===o?void 0:o.type;
|
|
18085
18083
|
// 根据字段类型生成不同的数据结构
|
|
18086
|
-
"internal"===c?("phone"===i&&(r.phoneToken=s),"email"===i&&(r.emailToken=s),r[i]=a):"user"===c&&n.push({key:i,value:a})})),{registerProfile:r,udf:n}}(f,null==o?void 0:o.fieldValues),a=i.registerProfile,s=i.udf,c=tV(tV({},e.content),{params:JSON.stringify(JSON.parse((null===(h=e.content)||void 0===h?void 0:h.params)?null===(m=e.content)||void 0===m?void 0:m.params:"[]").concat(s))}),[4/*yield*/,eV(t,e.businessRequestName,c,a)];case 1:return 200===(l=b.sent()).statusCode?(e.onRegisterSuccess(l.data),null===(v=null==n?void 0:n.onRegisterInfoCompleted)||void 0===v||v.call(n,l.data,c,r)):(null===(g=null==l?void 0:l.onGuardHandling)||void 0===g||g.call(l),u=l.apiCode,d=l.message,p=l.data,e.onRegisterFailed(u,p,d),null===(y=null==n?void 0:n.onRegisterInfoCompletedError)||void 0===y||y.call(n,{code:u,message:d},c,r)),[2/*return*/]}}))}))}}):h)},fV=y().useMemo;!function(e){e.IOS="ios",e.Android="Android"}(QU||(QU={}));var pV,hV=function(){fB();var e=Pu().t,t=oL(),n=dL().backModule,r=null==t?void 0:t.cdnBase,o=fV((function(){var t;return(t={})[QU.IOS]={title:e("common.downloadTotpAppIOS"),google:"".concat(r,"/GoogleAuthenticator-Apple.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Apple.png")},t[QU.Android]={title:e("common.downloadTotpAppAndroid"),google:"".concat(r,"/GoogleAuthenticator-Authing.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Baidu.png")},t}),[r,e]),i=fV((function(){return Object.keys(o).map((function(t,n){return y().createElement(SR.TabPane,{tab:o[t].title,key:n,className:"g2-mfa-download-at-tab"},y().createElement("span",{className:"g2-mfa-totp-download-subtitle"},e("common.downloadTotpAppDocs")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode"},y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].google,alt:"Google Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Google Authenticator")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].microsoft,alt:"Microsoft Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Microsoft Authenticator"))))}))}),[o,e]),a=fV((function(){return y().createElement(lB,{onBack:function(){return null==n?void 0:n()}},e("common.backToMFA"))}),[n,e]);return y().createElement("div",{className:"g2-view-container g2-download-authenticator"},a,y().createElement("div",{className:"g2-view-tabs g2-mfa-totp-download-tabs"},y().createElement(SR,{defaultActiveKey:QU.IOS},i)))},mV=y().useMemo,vV=function(e){var t=cL();fB();var n=mV((function(){var n,r,o=null!==(n=null==e?void 0:e.error)&&void 0!==n?n:null==t?void 0:t.error;return null!==(r="".concat(null==o?void 0:o.message))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.error,null==e?void 0:e.error]);return y().createElement("div",{className:"g2-view-container g2-view-error"},y().createElement("div",{className:"g2-error-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("div",{className:"g2-error-message"},su.t("user.error")),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:n}})))},gV=function(){return gV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gV.apply(this,arguments)},yV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},bV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},CV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},EV=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},kV=y().useMemo,SV={"phone-code":"phone","email-code":"email"},xV=function(e){var t,n=e.methods,r=e.areaCode,o=void 0===r?"CN":r,i=e.currentMethod,a=e.checkRepeat,s=e.checkExist,c=wV(e,["methods","areaCode","currentMethod","checkRepeat","checkExist"]),l=oL(),u=Pu().t,d=iL().get,f=mL(),p=(null===(t=l.internationalSmsConfig)||void 0===t?void 0:t.enabled)&&"phone-code"===i,h=kV((function(){return"email-code"===i?{field:u("common.emailLabel"),checkRepeatErrorMessage:u("common.checkEmail"),checkExistErrorMessage:u("common.noFindEmail"),formatErrorMessage:u("login.inputCorrectPhone"),pattern:
|
|
18084
|
+
"internal"===c?("phone"===i&&(r.phoneToken=s),"email"===i&&(r.emailToken=s),r[i]=a):"user"===c&&n.push({key:i,value:a})})),{registerProfile:r,udf:n}}(f,null==o?void 0:o.fieldValues),a=i.registerProfile,s=i.udf,c=tV(tV({},e.content),{params:JSON.stringify(JSON.parse((null===(h=e.content)||void 0===h?void 0:h.params)?null===(m=e.content)||void 0===m?void 0:m.params:"[]").concat(s))}),[4/*yield*/,eV(t,e.businessRequestName,c,a)];case 1:return 200===(l=b.sent()).statusCode?(e.onRegisterSuccess(l.data),null===(v=null==n?void 0:n.onRegisterInfoCompleted)||void 0===v||v.call(n,l.data,c,r)):(null===(g=null==l?void 0:l.onGuardHandling)||void 0===g||g.call(l),u=l.apiCode,d=l.message,p=l.data,e.onRegisterFailed(u,p,d),null===(y=null==n?void 0:n.onRegisterInfoCompletedError)||void 0===y||y.call(n,{code:u,message:d},c,r)),[2/*return*/]}}))}))}}):h)},fV=y().useMemo;!function(e){e.IOS="ios",e.Android="Android"}(QU||(QU={}));var pV,hV=function(){fB();var e=Pu().t,t=oL(),n=dL().backModule,r=null==t?void 0:t.cdnBase,o=fV((function(){var t;return(t={})[QU.IOS]={title:e("common.downloadTotpAppIOS"),google:"".concat(r,"/GoogleAuthenticator-Apple.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Apple.png")},t[QU.Android]={title:e("common.downloadTotpAppAndroid"),google:"".concat(r,"/GoogleAuthenticator-Authing.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Baidu.png")},t}),[r,e]),i=fV((function(){return Object.keys(o).map((function(t,n){return y().createElement(SR.TabPane,{tab:o[t].title,key:n,className:"g2-mfa-download-at-tab"},y().createElement("span",{className:"g2-mfa-totp-download-subtitle"},e("common.downloadTotpAppDocs")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode"},y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].google,alt:"Google Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Google Authenticator")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].microsoft,alt:"Microsoft Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Microsoft Authenticator"))))}))}),[o,e]),a=fV((function(){return y().createElement(lB,{onBack:function(){return null==n?void 0:n()}},e("common.backToMFA"))}),[n,e]);return y().createElement("div",{className:"g2-view-container g2-download-authenticator"},a,y().createElement("div",{className:"g2-view-tabs g2-mfa-totp-download-tabs"},y().createElement(SR,{defaultActiveKey:QU.IOS},i)))},mV=y().useMemo,vV=function(e){var t=cL();fB();var n=mV((function(){var n,r,o=null!==(n=null==e?void 0:e.error)&&void 0!==n?n:null==t?void 0:t.error;return null!==(r="".concat(null==o?void 0:o.message))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.error,null==e?void 0:e.error]);return y().createElement("div",{className:"g2-view-container g2-view-error"},y().createElement("div",{className:"g2-error-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("div",{className:"g2-error-message"},su.t("user.error")),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:n}})))},gV=function(){return gV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gV.apply(this,arguments)},yV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},bV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},CV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},EV=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},kV=y().useMemo,SV={"phone-code":"phone","email-code":"email"},xV=function(e){var t,n=e.methods,r=e.areaCode,o=void 0===r?"CN":r,i=e.currentMethod,a=e.checkRepeat,s=e.checkExist,c=wV(e,["methods","areaCode","currentMethod","checkRepeat","checkExist"]),l=oL(),u=Pu().t,d=iL().get,f=mL(),p=(null===(t=l.internationalSmsConfig)||void 0===t?void 0:t.enabled)&&"phone-code"===i,h=kV((function(){return"email-code"===i?{field:u("common.emailLabel"),checkRepeatErrorMessage:u("common.checkEmail"),checkExistErrorMessage:u("common.noFindEmail"),formatErrorMessage:u("login.inputCorrectPhone"),pattern:dQ.email}:{field:u("common.phone"),checkRepeatErrorMessage:u("common.checkPhone"),checkExistErrorMessage:u("common.noFindPhone"),formatErrorMessage:u("login.inputCorrectPhone"),pattern:f||dQ.phone}}),[i,f,u]),m=IB((function(e,t,n){var r=e;"phone-code"===i&&p&&(r=uj(p,r,o).phoneNumber);d("/api/v2/users/find",{userPoolId:null==l?void 0:l.userPoolId,key:r,type:SV[i]}).then((function(e){var r=e.data;s&&(Boolean(r)?t(!0):n(h.checkExistErrorMessage)),a&&(Boolean(r)?n(h.checkRepeatErrorMessage):t(!0))}))})),v=kV((function(){return p?{validateTrigger:"onBlur",validator:function(e,t){return yV(void 0,void 0,void 0,(function(){return bV(this,(function(e){return!t||(0,rj.phone)(t,{country:o}).isValid||(0,rj.phone)(t).isValid?[2/*return*/,Promise.resolve()]:[2/*return*/,Promise.reject(u("common.i18nCheckErrorMessage"))]}))}))}}:{validateTrigger:"onBlur",pattern:h.pattern,message:h.formatErrorMessage}}),[o,p,h.formatErrorMessage,h.pattern,u]),g=kV((function(){
|
|
18087
18085
|
// 如果不是必填就不校验
|
|
18088
18086
|
// 必填项的默认校验规则
|
|
18089
|
-
var e=EV([],CV(
|
|
18087
|
+
var e=EV([],CV(pQ(u("common.phoneOrEmail"))),!1);
|
|
18090
18088
|
// 格式校验
|
|
18091
18089
|
return e.push(v),
|
|
18092
18090
|
// 是否校验重复
|
|
18093
|
-
(a||s)&&e.push({validator:m,validateTrigger:[]}),e}),[u,v,a,s,m]),b=kV((function(){if(1!==n.length)return y().createElement(sT.Item,gV({validateTrigger:["onBlur","onChange"],validateFirst:!0,rules:g},c));switch(i){case"phone-code":return y().createElement(UB.Phone,gV({},c,{areaCode:o,checkRepeat:a,checkExist:s}));case"email-code":return y().createElement(UB.Email,gV({},c,{checkRepeat:a,checkExist:s}))}}),[o,s,a,i,c,n.length,g]);return y().createElement(y().Fragment,null,b)},PV=function(){return PV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PV.apply(this,arguments)},_V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},TV=y().useMemo,OV=function(e){var t,n=e.methods,r=_V(e,["methods"]),o=oL(),i=Pu().t,a=TV((function(){var e;return{"email-code":{t:i("common.email"),sort:2},"phone-code":{t:(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("common.areaCodePhone"):i("common.phoneNumber"),sort:1}}}),[o,i]),s=TV((function(){var e;return(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).map((function(e,t){return 0===t?"「".concat(e,"」"):e})).join(" / ")}):i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[n,i,a,null===(t=null==o?void 0:o.internationalSmsConfig)||void 0===t?void 0:t.enabled]),c=TV((function(){return 1===n.length&&"phone-code"===n[0]?y().createElement(
|
|
18091
|
+
(a||s)&&e.push({validator:m,validateTrigger:[]}),e}),[u,v,a,s,m]),b=kV((function(){if(1!==n.length)return y().createElement(sT.Item,gV({validateTrigger:["onBlur","onChange"],validateFirst:!0,rules:g},c));switch(i){case"phone-code":return y().createElement(UB.Phone,gV({},c,{areaCode:o,checkRepeat:a,checkExist:s}));case"email-code":return y().createElement(UB.Email,gV({},c,{checkRepeat:a,checkExist:s}))}}),[o,s,a,i,c,n.length,g]);return y().createElement(y().Fragment,null,b)},PV=function(){return PV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PV.apply(this,arguments)},_V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},TV=y().useMemo,OV=function(e){var t,n=e.methods,r=_V(e,["methods"]),o=oL(),i=Pu().t,a=TV((function(){var e;return{"email-code":{t:i("common.email"),sort:2},"phone-code":{t:(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("common.areaCodePhone"):i("common.phoneNumber"),sort:1}}}),[o,i]),s=TV((function(){var e;return(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).map((function(e,t){return 0===t?"「".concat(e,"」"):e})).join(" / ")}):i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[n,i,a,null===(t=null==o?void 0:o.internationalSmsConfig)||void 0===t?void 0:t.enabled]),c=TV((function(){return 1===n.length&&"phone-code"===n[0]?y().createElement(xq,PV({maxLength:11,placeholder:s},r)):y().createElement(rO,PV({maxLength:50,placeholder:s},r,{prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[r,n,s]);return y().createElement(y().Fragment,null,c)},NV=function(){return NV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NV.apply(this,arguments)},IV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},AV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},RV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},MV=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},DV=y().useCallback,LV=y().useRef,FV=y().useState;!function(e){e.email="email-code",e.phone="phone-code"}(pV||(pV={}));var jV=function(e){var t,n,r=Pu().t,o=RV(sT.useForm(),1)[0],i=RV(FV(""),2),a=i[0],s=i[1],c=RV(FV("phone"),2),l=c[0],u=c[1],d=LV(null),f=lj().isPhoneMedia,p=nQ().post,h=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,m=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,v=DV((function(e){return y().createElement(y().Fragment,null,"phone"===l&&y().createElement(Rq,NV({},e,{isInternationSms:m,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:h}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_RESET,maxLength:h,data:a,onSendCodeBefore:function(){return IV(void 0,void 0,void 0,(function(){return AV(this,(function(e){switch(e.label){case 0:return[4/*yield*/,o.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})),"email"===l&&y().createElement(wU,NV({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:h}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Nc.RESET_PASSWORD_VERIFY_CODE,maxLength:h,data:a,onSendCodeBefore:function(){return IV(void 0,void 0,void 0,(function(){return AV(this,(function(e){switch(e.label){case 0:return[4/*yield*/,o.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[l,o,a,m,r,h]);
|
|
18094
18092
|
// .map((item, index) => (index === 0 ? `「${item}」` : item))
|
|
18095
18093
|
return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"rePassword",form:o,onFinish:function(t){return IV(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,c;return AV(this,(function(u){return null===(c=d.current)||void 0===c||c.onSpin(!0),n=t.identify,r=t.code,o=new Promise((function(){})),
|
|
18096
18094
|
// const newPassword = await authClient.options?.encryptFunction?.(
|
|
@@ -18108,7 +18106,7 @@ phoneCountryCode:s})),o.then((function(t){var r,o,i,a,s,c,l,u,f=t.code;if(null==
|
|
|
18108
18106
|
200===f&&(e.setPhoneOrEmailText(n),e.setPolicyStrength(p),(null===(c=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.customPasswordStrength)||void 0===c?void 0:c.enabled)&&e.setCustomPasswordStrength(h),e.setControlShow(!1),e.setResetToken(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.resetPasswordToken),e.setUserId(null===(u=null==t?void 0:t.data)||void 0===u?void 0:u.userId))}else vC.error(null==t?void 0:t.message)})).catch((function(e){
|
|
18109
18107
|
// submitButtonRef.current.onError()
|
|
18110
18108
|
// props.onSendError(codeMethod, e)
|
|
18111
|
-
vC.error(e.message)})),[2/*return*/]}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(xV,{name:"identify",className:"authing-g2-input-form",methods:["email-code","phone-code"],currentMethod:pV[l],checkExist:!0},y().createElement(OV,{methods:["email-code","phone-code"],className:"authing-g2-input",autoComplete:"off",autoFocus:!f,size:"large",value:a,onChange:function(e){var t=e.target.value;s(t)
|
|
18109
|
+
vC.error(e.message)})),[2/*return*/]}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(xV,{name:"identify",className:"authing-g2-input-form",methods:["email-code","phone-code"],currentMethod:pV[l],checkExist:!0},y().createElement(OV,{methods:["email-code","phone-code"],className:"authing-g2-input",autoComplete:"off",autoFocus:!f,size:"large",value:a,onChange:function(e){var t=e.target.value;s(t),fQ("email",t)?u("email"):u("phone")},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form-sendCode",name:"code",rules:MV([],RV(pQ(r("common.captchaCode"))),!1)},y().createElement(v,null)),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"validater-account-btn",text:r("login.resetPassword.nextStep"),ref:d}))))},BV=function(){return BV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},BV.apply(this,arguments)},qV=y().forwardRef((function(e,t){return y().createElement(rO.Password,BV({autoComplete:"off",ref:t},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(YD,{type:"authing-authing-eye-fill",style:{color:"#4E5969"}}):y().createElement(YD,{type:"authing-authing-eye-off-fill",style:{color:"#A9AEB8"}}))},maxLength:35}))})),UV=function(){return UV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},UV.apply(this,arguments)},VV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},$V=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},zV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},HV=y().useRef,WV=y().useState,GV=function(){var e,t=Pu().t,n=uL(),r=oL(),o=WL(),i=fL();fB();var a,s=(null==r?void 0:r.resetPwdCustomLogo)||(null==i?void 0:i.logo),c=dL().changeModule,l=zV(WV(!0),2),u=l[0],d=l[1],f=zV(WV(0),2),p=f[0],h=f[1],m=zV(WV({}),2),v=m[0],g=m[1],b=zV(WV(""),2),w=b[0],C=b[1],E=GB(),k=E.getPassWordUnsafeText,S=E.setPasswordErrorTextShow,x=zV(WV(""),2),P=x[0],_=x[1],T=zV(WV(""),2),O=T[0],N=T[1],I=null!==(null==i?void 0:i.goBack),A=null!==(e=null==i?void 0:i.goBack)&&void 0!==e?e:function(){return null==c?void 0:c(ML.LOGIN)},R=zV(sT.useForm(),1)[0],M=nQ().post,D=HV(null);
|
|
18112
18110
|
// const onSend = (type: 'phone' | 'email') => {
|
|
18113
18111
|
// if (type === 'phone') events?.onPwdPhoneSend?.(authClient)
|
|
18114
18112
|
// if (type === 'email') events?.onPwdEmailSend?.(authClient)
|
|
@@ -18123,7 +18121,7 @@ return u?y().createElement("div",{className:"g2-view-container g2-forget-passwor
|
|
|
18123
18121
|
// onReset={onReset}
|
|
18124
18122
|
publicConfig:r,setControlShow:d,setPolicyStrength:h,setCustomPasswordStrength:g,setPhoneOrEmailText:C,setResetToken:_,setUserId:N})),I&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:A},t("login.resetPassword.back")))):y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step2"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:s,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},t("login.resetPwd")),y().createElement("div",{className:"title-explain"},t("login.resetPassword.resetPasswordText2",{account:w}))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(sT,{name:"resetPassword",form:R,onFinish:function(){return VV(void 0,void 0,void 0,(function(){var e,i,a,s,l,u,d,f;return $V(this,(function(p){switch(p.label){case 0:return null===(s=D.current)||void 0===s||s.onSpin(!0),e=R.getFieldsValue(),[4/*yield*/,null===(u=null===(l=o.options)||void 0===l?void 0:l.encryptFunction)||void 0===u?void 0:u.call(l,e.password,r.publicKey)];case 1:return i=p.sent(),[4/*yield*/,null===(f=null===(d=o.options)||void 0===d?void 0:d.encryptFunction)||void 0===f?void 0:f.call(d,e.repeatPassword,r.publicKey)];case 2:return a=p.sent(),M("/api/v2/users/password/password-reset",{newPassword:i,repeatPassword:a,
|
|
18125
18123
|
// ...phoneOrEmail, // 不用传 phone 和 email 了
|
|
18126
|
-
resetPasswordToken:P}).then((function(e){var r,i,a;null===(r=D.current)||void 0===r||r.onSpin(!1);var s=e.code;if(s===
|
|
18124
|
+
resetPasswordToken:P}).then((function(e){var r,i,a;null===(r=D.current)||void 0===r||r.onSpin(!1);var s=e.code;if(s===AJ.UNSAFE_PASSWORD_TIP&&S(!0),200!==s)return null===(i=null==n?void 0:n.onPwdResetError)||void 0===i||i.call(n,e,o),void vC.error(null==e?void 0:e.message);null===(a=null==n?void 0:n.onPwdReset)||void 0===a||a.call(n,o);
|
|
18127
18125
|
// 返回登录
|
|
18128
18126
|
var l={title:t("common.resetSuccess"),message:t("common.resetSuccessMessage"),needBack:I,goBack:A};null==c||c(ML.New_SUBMIT_SUCCESS,UV({},l))})).catch((function(e){var t;D.current.onError(),
|
|
18129
18127
|
// props.onSendError(codeMethod, e)
|
|
@@ -18132,12 +18130,12 @@ null===(t=null==n?void 0:n.onPwdResetError)||void 0===t||t.call(n,e,o),vC.error(
|
|
|
18132
18130
|
// required: true,
|
|
18133
18131
|
// message: t('login.resetPassword.pleaseInputPassword'),
|
|
18134
18132
|
// },
|
|
18135
|
-
a=[
|
|
18133
|
+
a=[bQ.NoCheck,bQ.Low,bQ.Middle,bQ.High,bQ.AUTO,bQ.Custom],xQ(a[p],v,"onChange",t("login.resetPassword.pleaseInputPassword"),O))},y().createElement(qV,{className:"authing-g2-input",size:"large",placeholder:t("login.resetPassword.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),y().createElement(sT.Item,{className:"authing-g2-input-form-password-repeat",name:"repeatPassword",validateFirst:!0,rules:[{required:!0,message:t("login.resetPassword.pleaseInputPassword")},function(e){var n=e.getFieldValue;return{validator:function(e,r){var o=n("password");return void 0===o&&void 0===r||o===r?Promise.resolve():Promise.reject(t("login.resetPassword.checkPasswordDiff"))}}}]},y().createElement(qV,{className:"authing-g2-input",size:"large",placeholder:t("login.resetPassword.confirmNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),k(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"reset-password-button",text:t("login.resetPassword.reset"),ref:D})))),y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:function(){return d(!0)}},t("login.resetPassword.back"))))},KV=i(1766),YV=i.n(KV),JV=function(){return JV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},JV.apply(this,arguments)},QV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ZV=y().useMemo,XV=function(e){var t=e.validPasswordLoginMethods,n=QV(e,["validPasswordLoginMethods"]),r=Pu().t,o=ZV((function(){if(1!==t.length)return y().createElement(sT.Item,JV({validateTrigger:["onBlur","onChange"],rules:pQ(r("common.account"))},n));switch(t[0]){case"phone-password":return y().createElement(UB.Phone,JV({},n,{isCheckPattern:!1}));case"email-password":return y().createElement(UB.Email,JV({},n))}return y().createElement(UB.UserName,JV({},n))}),[n,t,r]);return y().createElement(y().Fragment,null,o)},e$=function(){return e$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e$.apply(this,arguments)},t$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},n$=y().useMemo,r$=function(e){var t=e.passwordLoginMethods,n=e.placeholder,r=t$(e,["passwordLoginMethods","placeholder"]),o=n$((function(){return 1===t.length&&"phone-password"===t[0]?y().createElement(xq,e$({maxLength:20,placeholder:n},r)):y().createElement(rO,e$({placeholder:n},r))}),[r,t,n]);return y().createElement(y().Fragment,null,o)},o$=function(){return o$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o$.apply(this,arguments)},i$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},a$=function(e){var t=e.verifyCodeUrl,n=e.changeCode,r=i$(e,["verifyCodeUrl","changeCode"]),o=Pu().t;return y().createElement("div",{className:"g2-graphic-verify-code"},y().createElement(rO,o$({},r)),y().createElement(qj,{className:"g2-captcha-code-image",src:t,alt:o("login.captchaCode"),height:"46px",width:"134px",style:{cursor:"pointer"},onClick:function(){return n()}}))},s$=y().useEffect;// CONCATENATED MODULE: ./src/Register/components/Agreements/index.tsx
|
|
18136
18134
|
var c$=function(){return c$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c$.apply(this,arguments)},l$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},u$=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},d$=y().useState,f$=y().useMemo,p$=y().useEffect,h$=function(e){var t=e.showError,n=e.onChange,r=void 0===n?function(){}:n,o=e.style,i=e.agreements,a=l$(d$([]),2),s=a[0],c=a[1];!function(e){var t=e.agreements,n=e.checkedAgreements,r={agreements:t,checkedAgreements:n,checkAllAgreements:e.checkAllAgreements,unCheckAllAgreements:e.unCheckAllAgreements};s$((function(){window.$$guard=Object.assign({},window.$$guard,{agreementsContext:r})}),[t,n])}({agreements:i,checkedAgreements:s,checkAllAgreements:function(){var e=i.map((function(e){return e.id}));c(e)},unCheckAllAgreements:function(){c([])}});
|
|
18137
18135
|
/** 是否可以注册 */
|
|
18138
18136
|
var l=f$((function(){
|
|
18139
18137
|
/** 所有必须勾选的都勾了就可以通过 */
|
|
18140
|
-
return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return p$((function(){r(l)}),[l,r]),y().createElement("div",{className:
|
|
18138
|
+
return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return p$((function(){r(l)}),[l,r]),y().createElement("div",{className:yQ(["authing-agreements",t&&"authing-agreements-error"])},i.map((function(e){return y().createElement("div",{key:e.id,style:c$({},o),className:yQ(["authing-agreements-item",e.required&&!s.includes(e.id)&&"authing-agreements-item-invalid"]),onClick:function(t){t.persist(),"A"!==t.target.nodeName&&function(e){c((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):u$(u$([],l$(t),!1),[e],!1)}))}(e.id)}},y().createElement(h_,{align:"start",size:5},y().createElement(ew,{className:"authing-agreements-checkbox",checked:s.includes(e.id)}),y().createElement("div",{className:"authing-agreements-item-content",dangerouslySetInnerHTML:{__html:e.title}})))})))},m$=y().useEffect,v$=y().useCallback,g$=y().useRef,y$=y().useLayoutEffect;
|
|
18141
18139
|
/**
|
|
18142
18140
|
* 多账号登录下 账户 & 登录方式自动回填
|
|
18143
18141
|
* TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
|
|
@@ -18152,7 +18150,7 @@ m$((function(){var e,i=(null==o?void 0:o.way)===n;if(o&&i&&!s){var u=l(),d=u.acc
|
|
|
18152
18150
|
* @param setLoginWay
|
|
18153
18151
|
* @returns
|
|
18154
18152
|
*/ // CONCATENATED MODULE: ./src/_utils/getCaptchaUrl.ts
|
|
18155
|
-
var w$=function(e){var t=new URL(e);return t.pathname="/api/v2/security/captcha",t.search="?r=".concat(+new Date),t.href},C$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},E$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},k$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},S$=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},x$=y().useCallback,P$=y().useEffect,_$=y().useMemo,T$=y().useRef,O$=y().useState,N$=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=e.saveIdentify,a=e.multipleInstance,s=e.backfillData,c=e.passwordLoginMethods,l=k$(sT.useForm(),1)[0],u=cL(),d=u._firstItemInitialValue,f=void 0===d?"":d,p=u.specifyDefaultLoginMethod;b$({form:l,way:$s.Password,formKey:"account",backfillData:s,cancelBackfill:$s.Password===p});var h=k$(O$(!1),2),m=h[0],v=h[1],g=lj().isPhoneMedia,b=k$(O$(!1),2),w=b[0],C=b[1],E=Pu(),k=E.t,S=E.i18n,x=
|
|
18153
|
+
var w$=function(e){var t=new URL(e);return t.pathname="/api/v2/security/captcha",t.search="?r=".concat(+new Date),t.href},C$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},E$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},k$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},S$=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},x$=y().useCallback,P$=y().useEffect,_$=y().useMemo,T$=y().useRef,O$=y().useState,N$=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=e.saveIdentify,a=e.multipleInstance,s=e.backfillData,c=e.passwordLoginMethods,l=k$(sT.useForm(),1)[0],u=cL(),d=u._firstItemInitialValue,f=void 0===d?"":d,p=u.specifyDefaultLoginMethod;b$({form:l,way:$s.Password,formKey:"account",backfillData:s,cancelBackfill:$s.Password===p});var h=k$(O$(!1),2),m=h[0],v=h[1],g=lj().isPhoneMedia,b=k$(O$(!1),2),w=b[0],C=b[1],E=Pu(),k=E.t,S=E.i18n,x=rQ().post,P=WL(),_=oL(),T=fL(),O=vL(),N=gL(),I=T$(null),A=k$(O$("always_enable"===N),2),R=A[0],M=A[1],D=k$(O$(""),2),L=D[0],F=D[1],j=k$(O$(0),2),B=j[0],q=j[1],U=k$(O$(!1),2),V=U[0],$=U[1],z=P.options.encryptFunction,H=x$((function(t){return C$(void 0,void 0,void 0,(function(){var n,r,o,i,a,s;return E$(this,(function(c){switch(c.label){case 0:return e.onLoginRequest?[4/*yield*/,e.onLoginRequest(t)]:[3/*break*/,2];case 1:return[2/*return*/,c.sent()];case 2:return n=t.data,r=(null==_?void 0:_.mergeAdAndAccountPasswordLogin)?"/api/v2/login/ad-all-in-one":"/api/v2/login/account",o=n.identity&&n.identity.trim(),i=n.password,a=n.captchaCode&&n.captchaCode.trim(),s={account:o},[4/*yield*/,z(i,e.publicKey)];case 3:return s.password=c.sent(),s.captchaCode=a,s.customData=(null==T?void 0:T.isHost)?wQ(["login_page_context"]):void 0,s.autoRegister=e.autoRegister,s.withCustomData=!1,[4/*yield*/,x(r,s)];case 4:return[2/*return*/,c.sent()]}}))}))}),[null==T?void 0:T.isHost,z,x,e,null==_?void 0:_.mergeAdAndAccountPasswordLogin]),W=function(t,n){var i,s,c,l,u=t.code,d=t.apiCode,f=t.message,p=t.data,h=t.onGuardHandling;if(null===(i=null==I?void 0:I.current)||void 0===i||i.onSpin(!1),
|
|
18156
18154
|
// 更新本次登录方式
|
|
18157
18155
|
p&&a&&a.setLoginWayByHttpData(n,p),200===u)o(p,f);else{if(
|
|
18158
18156
|
// 需要「图形验证码」并且是第一次,就发一次,后面存在的时候会在点击登录,表单校验通过后,不论对错都要重新请求验证码
|
|
@@ -18166,19 +18164,19 @@ $(!0);
|
|
|
18166
18164
|
// 本次请求成功 && 当前请求
|
|
18167
18165
|
var m=null==h?void 0:h();
|
|
18168
18166
|
// 向上层抛出错误
|
|
18169
|
-
m===
|
|
18167
|
+
m===IJ.RENDER_MESSAGE&&(null==r||r(u,p,f))}};P$((function(){q(0),$(!1)}),[e.loginWay]),P$((function(){M("always_enable"===N),"always_enable"===N&&F(w$(e.host))}),[N,e.host]);var G=_$((function(){var t,n;return e.submitButText?e.submitButText:e.autoRegister&&!_.registerDisabled&&(null===(n=null===(t=T.registerMethods)||void 0===t?void 0:t.filter((function(e){
|
|
18170
18168
|
// @ts-ignore
|
|
18171
18169
|
return![Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===n?void 0:n.length)?"".concat(k("common.login")," / ").concat(k("common.register")):k("common.login")}),[e,k,_.registerDisabled,T.registerMethods]),K=_$((function(){var e=new Map;return _.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[_.tabMethodsFields]),Y=_$((function(){
|
|
18172
18170
|
// 登录注册合并
|
|
18173
18171
|
if(null==T?void 0:T.autoRegister){
|
|
18174
18172
|
// 密码 placeholder
|
|
18175
|
-
var e=S$([],k$(c),!1);return k("login.inputAccount",{text:
|
|
18173
|
+
var e=S$([],k$(c),!1);return k("login.inputAccount",{text:FQ(e,K,O)})}
|
|
18176
18174
|
// 登录注册分页
|
|
18177
|
-
return k("login.inputAccount",{text:
|
|
18175
|
+
return k("login.inputAccount",{text:FQ(S$([],k$(c),!1),K,O)})}),[null==T?void 0:T.autoRegister,S,K,O,c,k]);return y().createElement("div",{className:"authing-g2-login-password"},y().createElement(sT,{name:"passworLogin",onFinish:function(t){return C$(void 0,void 0,void 0,(function(){var r,o,i,a,s;return E$(this,(function(c){switch(c.label){case 0:return C(!0),(null==n?void 0:n.length)&&!m?(I.current.onError(),[2/*return*/]):(q(0),$(!1),
|
|
18178
18176
|
// onBeforeLogin
|
|
18179
18177
|
null===(i=null==I?void 0:I.current)||void 0===i||i.onSpin(!0),r={type:$s.Password,data:{identity:t.account,password:t.password,captchaCode:t.captchaCode}},[4/*yield*/,null===(a=e.onBeforeLogin)||void 0===a?void 0:a.call(e,r)]);case 1:return!c.sent()&&e.onBeforeLogin?(null===(s=null==I?void 0:I.current)||void 0===s||s.onSpin(!1),[2/*return*/]):(
|
|
18180
18178
|
// 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
|
|
18181
|
-
L&&F(w$(e.host)),[4/*yield*/,H(r)]);case 2:return o=c.sent(),W(o,t.account),[2/*return*/]}}))}))},onFinishFailed:function(){return I.current.onError()},autoComplete:"off",form:l,onValuesChange:function(e){(null==e?void 0:e.account)&&i&&i($s.Password,null==e?void 0:e.account)}},y().createElement(XV,{name:"account",className:"authing-g2-input-form",validPasswordLoginMethods:(null===(t=null==_?void 0:_.passwordTabConfig)||void 0===t?void 0:t.validLoginMethods)||[],initialValue:p===$s.Password?f:""},y().createElement(r$,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!g,prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),passwordLoginMethods:c,placeholder:Y})),y().createElement(sT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",rules:
|
|
18179
|
+
L&&F(w$(e.host)),[4/*yield*/,H(r)]);case 2:return o=c.sent(),W(o,t.account),[2/*return*/]}}))}))},onFinishFailed:function(){return I.current.onError()},autoComplete:"off",form:l,onValuesChange:function(e){(null==e?void 0:e.account)&&i&&i($s.Password,null==e?void 0:e.account)}},y().createElement(XV,{name:"account",className:"authing-g2-input-form",validPasswordLoginMethods:(null===(t=null==_?void 0:_.passwordTabConfig)||void 0===t?void 0:t.validLoginMethods)||[],initialValue:p===$s.Password?f:""},y().createElement(r$,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!g,prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),passwordLoginMethods:c,placeholder:Y})),y().createElement(sT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",rules:pQ(k("common.password"))},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:k("login.inputLoginPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),R&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:pQ(k("common.captchaCode"))},y().createElement(a$,{className:"authing-g2-input",size:"large",placeholder:k("login.inputCaptchaCode"),verifyCodeUrl:L,changeCode:function(){return F(w$(e.host))}})),0!==B&&!V&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},k("common.loginFailCheck",{number:B})),V&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},k("common.accountLock")),Boolean(null==n?void 0:n.length)&&y().createElement(h$,{onChange:v,agreements:n,showError:w}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
|
|
18182
18180
|
// TODO 产品还没想好 暂时不上
|
|
18183
18181
|
// disabled={
|
|
18184
18182
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
@@ -18191,7 +18189,7 @@ null===(E=v.current)||void 0===E||E.onSpin(!0),a={type:$s.LDAP,data:{identity:i.
|
|
|
18191
18189
|
// 更新本次登录方式
|
|
18192
18190
|
f&&o&&o.setLoginWayByLDAPData(s,f),200===d?n(f):(d===qF.INPUT_CAPTCHACODE&&(k(x()),w(!0)),
|
|
18193
18191
|
// 向上层抛出错误
|
|
18194
|
-
(null==g?void 0:g())===
|
|
18192
|
+
(null==g?void 0:g())===IJ.RENDER_MESSAGE&&r(d,f,y)),[3/*break*/,5];case 4:return b=_.sent(),null===(P=v.current)||void 0===P||P.onSpin(!1),"ECONNABORTED"===b.code&&(vC.error(m("common.timeoutLDAP")),r(2333,{},JSON.stringify(b))),[3/*break*/,5];case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=v.current)||void 0===e?void 0:e.onError()},autoComplete:"off"},y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"account",rules:pQ(m("common.account"))},y().createElement(rO,{autoFocus:!u,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:m("login.inputLdapUsername"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:pQ(m("common.password"))},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:m("login.inputLdapPwd"),
|
|
18195
18193
|
// prefix={<LockOutlined style={{ color: '#878A95' }} />}
|
|
18196
18194
|
prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),b&&y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"captchaCode",rules:[{required:!0,message:m("login.inputCaptchaCode")}]},y().createElement(rO,{className:"authing-g2-input add-after",size:"large",placeholder:m("login.inputCaptchaCode"),addonAfter:y().createElement("img",{className:"g2-captcha-code-image",src:E,alt:m("login.captchaCode"),style:{height:"2em",cursor:"pointer"},onClick:function(){return k(x())}})})),Boolean(null==t?void 0:t.length)&&y().createElement(h$,{onChange:l,agreements:t,showError:f}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
|
|
18197
18195
|
// disabled={
|
|
@@ -18201,14 +18199,14 @@ text:m("common.login"),className:"password",ref:v}))))},F$=function(e,t,n,r){ret
|
|
|
18201
18199
|
// onBeforeLogin
|
|
18202
18200
|
null===(M=P.current)||void 0===M||M.onSpin(!0),a={type:Oi.AD,data:{identity:o.account,password:o.password,captchaCode:o.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:return j.sent()?(s=o.account&&o.account.trim(),c=o.password,u=o.captchaCode,[4/*yield*/,(0,S.options.encryptFunction)(c,e.publicKey)]):(null===(D=P.current)||void 0===D||D.onSpin(!1),[2/*return*/]);case 2:d=j.sent(),
|
|
18203
18201
|
// 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
|
|
18204
|
-
m&&v(w$(b)),j.label=3;case 3:return j.trys.push([3,6,,7]),f="".concat(b,"/api/v2/ad/verify-user"),h=kL(),[4/*yield*/,fetch(f,{method:"POST",body:JSON.stringify({username:s,password:d,captchaCode:u}),credentials:"include",headers:(A={"Content-Type":"application/json"},A[AL.langHeader]=su.
|
|
18202
|
+
m&&v(w$(b)),j.label=3;case 3:return j.trys.push([3,6,,7]),f="".concat(b,"/api/v2/ad/verify-user"),h=kL(),[4/*yield*/,fetch(f,{method:"POST",body:JSON.stringify({username:s,password:d,captchaCode:u}),credentials:"include",headers:(A={"Content-Type":"application/json"},A[AL.langHeader]=su.resolvedLanguage,A["x-authing-userpool-id"]=g.userPoolId,A["x-authing-app-id"]=w,A["x-authing-sdk-version"]=h,A["x-authing-request-from"]="Guard@".concat(h),A)})];case 4:return[4/*yield*/,j.sent().json()];case 5:return y=j.sent(),k=C(y),x=k.code,_=k.apiCode,T=k.data,O=k.onGuardHandling,N=k.message,
|
|
18205
18203
|
// // 更新本次登录方式
|
|
18206
18204
|
// data && multipleInstance && multipleInstance.setLoginWay('input', 'ad')
|
|
18207
18205
|
null===(L=P.current)||void 0===L||L.onSpin(!1),200===x?r(T):(
|
|
18208
18206
|
// 需要「图形验证码」并且是第一次,就发一次,后面存在的时候会在点击登录,表单校验通过后,不论对错都要重新请求验证码
|
|
18209
18207
|
_!==qF.INPUT_CAPTCHACODE||m||(v(w$(b)),p(!0)),
|
|
18210
18208
|
// 向上层抛出错误
|
|
18211
|
-
(null==O?void 0:O())===
|
|
18209
|
+
(null==O?void 0:O())===IJ.RENDER_MESSAGE&&n(x,T,N)),[3/*break*/,7];case 6:return I=j.sent(),null===(F=P.current)||void 0===F||F.onSpin(!1),"ECONNABORTED"===I.code&&(vC.error(E("common.timeoutAD")),n(2333,{},JSON.stringify(I))),[3/*break*/,7];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return P.current.onError()},autoComplete:"off"},(null==g?void 0:g.ssoPageComponentDisplay.userPasswordInput)&&y().createElement(y().Fragment,null,y().createElement(sT.Item,{className:"authing-g2-input-form",name:"account",validateTrigger:["onBlur","onChange"],rules:pQ(E("common.account"))},y().createElement(rO,{autoFocus:!k,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:(null==g?void 0:g.mergeAdAndAccountPasswordLogin)?E("common.jobNumber"):E("login.inputAdUsername"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:pQ(E("common.password"))},y().createElement(zB,{autoComplete:"off",className:"authing-g2-input",size:"large",placeholder:(null==g?void 0:g.mergeAdAndAccountPasswordLogin)?E("login.inputPwd"):E("login.inputAdPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),f&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:pQ(E("common.captchaCode"))},y().createElement(a$,{className:"authing-g2-input",size:"large",placeholder:E("login.inputCaptchaCode"),verifyCodeUrl:m,changeCode:function(){return v(w$(b))}})),Boolean(null==t?void 0:t.length)&&y().createElement(h$,{onChange:a,agreements:t,showError:c}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
|
|
18212
18210
|
// disabled={
|
|
18213
18211
|
// !!agreements.find(
|
|
18214
18212
|
// (item) => item.required && !acceptedAgreements
|
|
@@ -18216,15 +18214,15 @@ _!==qF.INPUT_CAPTCHACODE||m||(v(w$(b)),p(!0)),
|
|
|
18216
18214
|
// }
|
|
18217
18215
|
text:E("common.login"),className:"password",ref:P})))))},z$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},H$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},W$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},G$=y().useCallback,K$=y().useEffect,Y$=y().useState,J$=y().useMemo,Q$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Z$=y().useMemo,X$="refactor",ez=y().memo((function(e){var t=e.status,n=e.loadingComponent,r=e.src,o=e.descriptions,i=e.containerStyle,a=e.imageStyle,s=e.onLoad,c=e.onClickMaskEl,l=e.onMaskContent,u=Pu().t,d=Q$(function(e){var t="".concat(X$,"-qrcode--").concat(e),n=Pu().t;return[t,J$((function(){return{loading:null,ready:null,already:y().createElement(y().Fragment,null,y().createElement(YD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(X$,"-inner__title--already")},n("login.scanSuccess"))),cancel:y().createElement(y().Fragment,null,y().createElement(YD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(X$,"-inner__title--refer")},n("login.qrcodeRefer"))),expired:y().createElement(y().Fragment,null,y().createElement(YD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(X$,"-inner__title--refer")},n("login.qrcodeRefer"))),error:y().createElement(y().Fragment,null,y().createElement(YD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(X$,"-inner__title--refer")},n("login.qrcodeNetWorkError"))),success:y().createElement(y().Fragment,null,y().createElement(YD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(X$,"-inner__title--already")},n("login.scanSuccess"))),MFA:null}[e]}),[e,n])]}(t),2),f=d[0],p=d[1],h=Q$(function(e,t){var n=W$(Y$(),2),r=n[0],o=n[1],i=t.onLoad,a=G$((function(){return z$(void 0,void 0,void 0,(function(){var t,n;return H$(this,(function(r){switch(r.label){case 0:return[4/*yield*/,ma().get(e,{responseType:"blob"})];case 1:return t=r.sent().data,(n=new FileReader).onload=function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.result;o(n),i&&i()},n.readAsDataURL(t),[2/*return*/]}}))}))}),[e,i]);
|
|
18218
18216
|
// 每次 render 都会请求 不应该
|
|
18219
|
-
return K$((function(){e&&a()}),[e]),[r]}(r,{onLoad:s}),1),m=h[0],v="".concat(X$,"-qrcode"),g=
|
|
18217
|
+
return K$((function(){e&&a()}),[e]),[r]}(r,{onLoad:s}),1),m=h[0],v="".concat(X$,"-qrcode"),g=MU()(v,f),b=Z$((function(){return n||y().createElement(iF,null)}),[n]);return y().createElement("div",{className:g,style:i},"loading"===t?b:y().createElement(y().Fragment,null,y().createElement("span",{className:"".concat(X$,"__image-wrapper"),onClick:function(){return l&&l(t)}},p&&y().createElement("div",{className:"".concat(X$,"-qrcode__mask")},y().cloneElement(p,{onClick:function(e){var n,r;c&&c(t),null===(r=(n=p.props).onClick)||void 0===r||r.call(n,e)}})),y().createElement("img",{className:"".concat(X$,"__image"),src:m,alt:u("common.qrcode"),style:a})),y().createElement("div",{className:"".concat(X$,"__desc")},o[t])))})),tz=function(){return tz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tz.apply(this,arguments)},nz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rz=y().useReducer,oz=function(e,t){switch(t.type){case"changeStatus":return e.status===t.payload.status?e:tz(tz({},e),t.payload);
|
|
18220
18218
|
// case 'changeDesc':
|
|
18221
18219
|
// if (state.description === action.payload.description) {
|
|
18222
18220
|
// return state
|
|
18223
18221
|
// }
|
|
18224
18222
|
// return { ...state, ...action.payload }
|
|
18225
|
-
case"change":return tz(tz({},e),t.payload);default:return e}},iz=function(){return iz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},iz.apply(this,arguments)},az=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},sz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},cz=y().useCallback,lz=y().useEffect,uz=function(e,t){var n=!1,r=e.state,o=e.dispatch,i=e.sleepTime,a=e.onStatusChange,s=fL(),c=t.readyCheckedRequest,l=t.alreadyCheckedRequest,u=t.exchangeUserInfo,d=t.genCodeRequest,f=cz((function(e){return["expired","ready","already","success","cancel","MFA","error"][e.status+1]}),[]),p=function(){return az(void 0,void 0,void 0,(function(){return sz(this,(function(e){switch(e.label){case 0:return"ready"!==r.status||!c||(null==s?void 0:s._closeLoopCheckQrcode)?[3/*break*/,3]:i?[4/*yield*/,
|
|
18223
|
+
case"change":return tz(tz({},e),t.payload);default:return e}},iz=function(){return iz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},iz.apply(this,arguments)},az=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},sz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},cz=y().useCallback,lz=y().useEffect,uz=function(e,t){var n=!1,r=e.state,o=e.dispatch,i=e.sleepTime,a=e.onStatusChange,s=fL(),c=t.readyCheckedRequest,l=t.alreadyCheckedRequest,u=t.exchangeUserInfo,d=t.genCodeRequest,f=cz((function(e){return["expired","ready","already","success","cancel","MFA","error"][e.status+1]}),[]),p=function(){return az(void 0,void 0,void 0,(function(){return sz(this,(function(e){switch(e.label){case 0:return"ready"!==r.status||!c||(null==s?void 0:s._closeLoopCheckQrcode)?[3/*break*/,3]:i?[4/*yield*/,PQ(i)]:[3/*break*/,2];case 1:e.sent(),e.label=2;case 2:
|
|
18226
18224
|
// 再次发起请求
|
|
18227
|
-
k(c),e.label=3;case 3:return[2/*return*/]}}))}))},h=function(){return az(void 0,void 0,void 0,(function(){return sz(this,(function(e){switch(e.label){case 0:return"already"!==r.status||!l||(null==s?void 0:s._closeLoopCheckQrcode)?[3/*break*/,3]:i?[4/*yield*/,
|
|
18225
|
+
k(c),e.label=3;case 3:return[2/*return*/]}}))}))},h=function(){return az(void 0,void 0,void 0,(function(){return sz(this,(function(e){switch(e.label){case 0:return"already"!==r.status||!l||(null==s?void 0:s._closeLoopCheckQrcode)?[3/*break*/,3]:i?[4/*yield*/,PQ(i)]:[3/*break*/,2];case 1:e.sent(),e.label=2;case 2:k(l),e.label=3;case 3:return[2/*return*/]}}))}))},m=function(){r.status},v=function(){r.status},g=function(){r.status},y=function(){r.status},b=function(){r.status},w=function(e){if(!n){var t,o,i=r.status,s=f(e);
|
|
18228
18226
|
// 状态已经改变 交给状态的 Handler 来改变
|
|
18229
18227
|
if(i!==s)
|
|
18230
18228
|
// 改变状态
|
|
@@ -18335,15 +18333,15 @@ action:"message"},Cz[1640]={action:"changeModule",module:ML.IDENTITY_BINDING},Cz
|
|
|
18335
18333
|
// 1643: {},
|
|
18336
18334
|
Cz[408]={action:"message"},Cz),Dz=i(3109),Lz=function(){return Lz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lz.apply(this,arguments)},Fz=y().useCallback,jz=((Ez={})[Ws.OIDC]="/connections/oidc/init",Ez[Ws.SAML]="/connections/saml/init",Ez[Ws.CAS]="/connections/cas/init",Ez[Ws.OAUTH]="/connections/oauth2/init",Ez[Ws.AZURE_AD]="/connections/azure-ad/init",Ez[Ws.AD_KERBEROS]="/connections/ad-kerberos/init",Ez),Bz=((kz={})[Ws.OIDC]="oidcConnectionLoginUrl",kz[Ws.SAML]="samlRequest",kz[Ws.CAS]="casConnectionLoginUrl",kz[Ws.OAUTH]="authUrl",kz[Ws.AZURE_AD]="authorizationUrl",kz[Ws.AD_KERBEROS]="authorizationUrl",kz),qz=function(e){
|
|
18337
18335
|
// TODO: 能不能加个类型
|
|
18338
|
-
var t=e.i,n=e.appId,r=e.appHost,o=e.isHost,i=Pu().t,a=sL(),s=kL(),c=Fz((function(){var e,c,l=Lz({from_guard:"1",app_id:n,guard_version:"Guard@".concat(s)},a&&{tenant_id:a});if(o&&(delete l.from_guard,l.from_hosted_guard="1",Uc())){l.redirected="1";var u=
|
|
18336
|
+
var t=e.i,n=e.appId,r=e.appHost,o=e.isHost,i=Pu().t,a=sL(),s=kL(),c=Fz((function(){var e,c,l=Lz({from_guard:"1",app_id:n,guard_version:"Guard@".concat(s)},a&&{tenant_id:a});if(o&&(delete l.from_guard,l.from_hosted_guard="1",Uc())){l.redirected="1";var u=VQ();u&&(
|
|
18339
18337
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
18340
18338
|
l.redirect_url=null===(e=Fc().parse(u.location.search))||void 0===e?void 0:e.finish_login_url)}if(null==t?void 0:t.provider){
|
|
18341
18339
|
// 社交身份源
|
|
18342
|
-
var d="authing-".concat(t.provider.replace(/:/g,"-"));return y().createElement(hj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(YD,{type:"".concat(d,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:function(){var e,n;if(t.action===tj.Message)vC.error(i("login.socialConnectionMessage",{provider:null!==(n=null!==(e=t.displayName)&&void 0!==e?e:"zh-CN"===su.
|
|
18340
|
+
var d="authing-".concat(t.provider.replace(/:/g,"-"));return y().createElement(hj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(YD,{type:"".concat(d,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:function(){var e,n;if(t.action===tj.Message)vC.error(i("login.socialConnectionMessage",{provider:null!==(n=null!==(e=t.displayName)&&void 0!==e?e:"zh-CN"===su.resolvedLanguage?t.name:t.name_en)&&void 0!==n?n:t.provider}));else if(t.action===tj.Auth){var o="".concat(r,"/connections/social/").concat(t.identifier,"?").concat(Fc().stringify(l));l.redirected?window.location.replace(o):oQ(o)}}},i("login.loginBy",{name:t.displayName}))}if(o){
|
|
18343
18341
|
// 托管登录页,直接写死登录 URL
|
|
18344
18342
|
l.identifier=t.identifier;var f=jz[t.protocol];if(!f)return null;c="".concat(r).concat(f,"?").concat(Fc().stringify(l))}else{var p=Bz[t.protocol];if(!p)return null;
|
|
18345
18343
|
// 嵌入式组件,从配置字段获取登录 URL
|
|
18346
|
-
c=t.config[p]}return y().createElement(hj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(yv,{size:20,src:t.logo,style:{marginRight:8}}),onClick:function(){l.redirected?window.location.replace(c):
|
|
18344
|
+
c=t.config[p]}return y().createElement(hj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(yv,{size:20,src:t.logo,style:{marginRight:8}}),onClick:function(){l.redirected?window.location.replace(c):oQ(c)}},i("login.loginBy",{name:t.displayName}))}),[n,t,i,o,r,a]);return c()};// CONCATENATED MODULE: ./node_modules/@github/webauthn-json/dist/esm/webauthn-json.js
|
|
18347
18345
|
// src/webauthn-json/base64url.ts
|
|
18348
18346
|
function Uz(e){const t="==".slice(0,(4-e.length%4)%4),n=e.replace(/-/g,"+").replace(/_/g,"/")+t,r=atob(n),o=new ArrayBuffer(r.length),i=new Uint8Array(o);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return o}function Vz(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}
|
|
18349
18347
|
// src/webauthn-json/convert.ts
|
|
@@ -18352,9 +18350,9 @@ var $z="copy",zz="convert";function Hz(e,t,n){if(t===$z)return n;if(t===zz)retur
|
|
|
18352
18350
|
var Yz={type:Gz($z),id:Gz(zz),transports:Kz($z)},Jz={appid:Kz($z),appidExclude:Kz($z),credProps:Kz($z)},Qz={appid:Kz($z),appidExclude:Kz($z),credProps:Kz($z)},Zz=(Gz({rp:Gz($z),user:Gz({id:Gz(zz),name:Gz($z),displayName:Gz($z)}),challenge:Gz(zz),pubKeyCredParams:Gz($z),timeout:Kz($z),excludeCredentials:Kz([Yz]),authenticatorSelection:Kz($z),attestation:Kz($z),extensions:Kz(Jz)}),Kz($z),Gz($z),Gz($z),Gz(zz),Kz($z),Gz({clientDataJSON:Gz(zz),attestationObject:Gz(zz),transports:Wz($z,(e=>{var t;return(null==(t=e.getTransports)?void 0:t.call(e))||[]}))}),Wz(Qz,(e=>e.getClientExtensionResults())),{mediation:Kz($z),publicKey:Gz({challenge:Gz(zz),timeout:Kz($z),rpId:Kz($z),allowCredentials:Kz([Yz]),userVerification:Kz($z),extensions:Kz(Jz)}),signal:Kz($z)}),Xz={type:Gz($z),id:Gz($z),rawId:Gz(zz),authenticatorAttachment:Kz($z),response:Gz({clientDataJSON:Gz(zz),authenticatorData:Gz(zz),signature:Gz(zz),userHandle:Gz(zz)}),clientExtensionResults:Wz(Qz,(e=>e.getClientExtensionResults()))};async function eH(e){const t=await navigator.credentials.get(function(e){return Hz(Uz,Zz,e)}(e));return function(e){return Hz(Vz,Xz,e)}(t)}
|
|
18353
18351
|
// src/webauthn-json/basic/supported.ts
|
|
18354
18352
|
// CONCATENATED MODULE: ./src/Login/socialLogin/PasskeyButton/index.tsx
|
|
18355
|
-
var tH,nH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},oH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iH=y().useCallback,aH=function(e){var t=e.onLoginFailed,n=e.onLoginSuccess,r=lj().isPhoneMedia,o=oL(),i=oH((0,g.useState)(),2),a=i[0],s=i[1],c=oH((0,g.useState)(!1),2),l=c[0],u=c[1],d=fL().host,f=aL(),p=kL(),h=iL().responseIntercept,m=Pu().t,v=iH((function(){if(r||!o.passkeyEnabled)return!1;var e=navigator.userAgent;return e.includes("Chrome")&&!e.includes("Edge")?"Chrome":e.includes("Safari")&&!e.includes("Chrome")?"Safari":e.includes("Edg")?"Edge":e.includes("Brave")?"Brave":(e.includes("Windows"),!1)}),[r,o]);return y().createElement(y().Fragment,null,v()&&y().createElement(hj,{className:"g2-guard-third-login-btn",block:!0,loading:l,size:"large",onClick:function(){return nH(void 0,void 0,void 0,(function(){var e,r,i,c,l,m,v,g,y,b,w,C,E,k,S,x,P;return rH(this,(function(_){switch(_.label){case 0:u(!0),_.label=1;case 1:return _.trys.push([1,7,8,9]),e="".concat(d,"/api/v3/webauthn/login/initialize"),[4/*yield*/,fetch(e,{method:"POST",body:JSON.stringify({}),credentials:"include",headers:(x={"Content-Type":"application/json"},x[AL.langHeader]=su.
|
|
18353
|
+
var tH,nH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},oH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iH=y().useCallback,aH=function(e){var t=e.onLoginFailed,n=e.onLoginSuccess,r=lj().isPhoneMedia,o=oL(),i=oH((0,g.useState)(),2),a=i[0],s=i[1],c=oH((0,g.useState)(!1),2),l=c[0],u=c[1],d=fL().host,f=aL(),p=kL(),h=iL().responseIntercept,m=Pu().t,v=iH((function(){if(r||!o.passkeyEnabled)return!1;var e=navigator.userAgent;return e.includes("Chrome")&&!e.includes("Edge")?"Chrome":e.includes("Safari")&&!e.includes("Chrome")?"Safari":e.includes("Edg")?"Edge":e.includes("Brave")?"Brave":(e.includes("Windows"),!1)}),[r,o]);return y().createElement(y().Fragment,null,v()&&y().createElement(hj,{className:"g2-guard-third-login-btn",block:!0,loading:l,size:"large",onClick:function(){return nH(void 0,void 0,void 0,(function(){var e,r,i,c,l,m,v,g,y,b,w,C,E,k,S,x,P;return rH(this,(function(_){switch(_.label){case 0:u(!0),_.label=1;case 1:return _.trys.push([1,7,8,9]),e="".concat(d,"/api/v3/webauthn/login/initialize"),[4/*yield*/,fetch(e,{method:"POST",body:JSON.stringify({}),credentials:"include",headers:(x={"Content-Type":"application/json"},x[AL.langHeader]=su.resolvedLanguage,x["x-authing-userpool-id"]=o.userPoolId,x["x-authing-app-id"]=f,x["x-authing-sdk-version"]=p,x["x-authing-request-from"]="Guard@".concat(p),x)})];case 2:return[4/*yield*/,_.sent().json()];case 3:return r=_.sent(),i=h(r),c=i.statusCode,l=i.data,m=i.message,200!==c?(t(c,void 0,m),[2/*return*/]):(l.mediation="required",l.signal=function(){a&&a.abort();var e=new AbortController;return s(e),e.signal}(),v=l.ticket,[4/*yield*/,eH(l)]);case 4:return g=_.sent(),y="".concat(d,"/api/v3/webauthn/login/finalize"),[4/*yield*/,fetch(y,{method:"POST",body:JSON.stringify({credential:g,ticket:v}),credentials:"include",headers:(P={"Content-Type":"application/json"},P[AL.langHeader]=su.resolvedLanguage,P["x-authing-userpool-id"]=o.userPoolId,P["x-authing-app-id"]=f,P["x-authing-sdk-version"]=p,P["x-authing-request-from"]="Guard@".concat(p),P)})];case 5:return[4/*yield*/,_.sent().json()];case 6:return b=_.sent(),w=h(b),C=w.statusCode,E=w.data,k=w.message,200!==C?(t(C,void 0,k),[2/*return*/]):(n(E),[3/*break*/,9]);case 7:return S=_.sent(),t(500,void 0,S.message),[3/*break*/,9];case 8:return u(!1),[7/*endfinally*/];case 9:return[2/*return*/]}}))}))},icon:y().createElement(YD,{type:"authing-slideshow-3-line",style:{fontSize:16,marginRight:8,color:"#215AE5"}})},m("login.loginWithPasskey")))},sH=function(e){var t,n=e.appId,r=e.config,o=e.enterpriseConnectionObjs,i=e.socialConnectionObjs,a=e.onLoginSuccess,s=e.onLoginFailed,c=!(null===(t=null==r?void 0:r.loginMethods)||void 0===t?void 0:t.length),l=oL(),u=null==l?void 0:l.userPoolId,d=Pu().t,f=lj().isPhoneMedia,p=sL(),h=o.map((function(e){return y().createElement(qz,{key:e.identifier,i:e,appId:n,appHost:null==r?void 0:r.host,userPoolId:u,isHost:null==r?void 0:r.isHost})})),m=i.map((function(e){var t,o,i,a,s,l,u,h="authing-".concat(e.provider.replace(/:/g,"-")),m=kL(),v={from_guard:"1",app_id:n,guard_version:"Guard@".concat(m)};if(p&&(v.tenant_id=p),(null==r?void 0:r.isHost)&&(v.from_hosted_guard="1",Uc())){v.redirected="1";var g=VQ();g&&(
|
|
18356
18354
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
18357
|
-
v.redirect_url=null===(t=Dz.parse(g.location.search))||void 0===t?void 0:t.finish_login_url)}var b=function(){var t,n;if(e.action===tj.Message)vC.error(d("login.socialConnectionMessage",{provider:null!==(n=null!==(t=e.displayName)&&void 0!==t?t:"zh-CN"===su.
|
|
18355
|
+
v.redirect_url=null===(t=Dz.parse(g.location.search))||void 0===t?void 0:t.finish_login_url)}var b=function(){var t,n;if(e.action===tj.Message)vC.error(d("login.socialConnectionMessage",{provider:null!==(n=null!==(t=e.displayName)&&void 0!==t?t:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==n?n:e.provider}));else if(e.action===tj.Auth){var o="".concat(r.host,"/connections/social/").concat(e.identifier,"?").concat(Dz.stringify(v));v.redirected?window.location.replace(o):oQ(o)}},w=r.socialConnectionsBtnShape;return"button"===w?y().createElement(hj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(YD,{type:"".concat(h,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:b,style:{marginBottom:8}},null!==(i=null!==(o=e.displayName)&&void 0!==o?o:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==i?i:e.provider):"icon"===w?f?y().createElement(hj,{className:"g2-social-login-item",onClick:b,icon:y().createElement(YD,{type:"".concat(h,"-fill")})}):y().createElement(dv,{key:e.id,title:(null===(a=e.tooltip)||void 0===a?void 0:a[su.resolvedLanguage])||e.name,trigger:["hover","click","contextMenu"]},y().createElement(hj,{className:"g2-social-login-item",onClick:b,icon:y().createElement(YD,{type:"".concat(h,"-fill")})})):c?y().createElement(hj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(YD,{type:"".concat(h,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:b},null!==(l=null!==(s=e.displayName)&&void 0!==s?s:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==l?l:e.provider):f?y().createElement(hj,{className:"g2-social-login-item",onClick:b,key:e.id,icon:y().createElement(YD,{type:"".concat(h,"-fill")})}):y().createElement(dv,{overlayStyle:{fontFamily:"sans-serif"},key:e.id,title:e.displayName||(null===(u=e.tooltip)||void 0===u?void 0:u[su.resolvedLanguage])||e.name,trigger:["hover","click","contextMenu"]},y().createElement(hj,{className:"g2-social-login-item",onClick:b,icon:y().createElement(YD,{type:"".concat(h,"-fill")})}))})),v=o.length?y().createElement(y().Fragment,null,!c&&y().createElement("div",{className:"g2-social-login-title"},su.t("login.otherLoginWay")),y().createElement("div",{className:"g2-social-login-list"},h)):null,g=m.length>0&&c?y().createElement(h_,{size:c?0:12,className:"g2-guard-full-width-space no-login-methods",direction:"vertical"},m):m.length>0&&y().createElement(y().Fragment,null,y().createElement("div",{className:"g2-social-login-title"},d("login.thridAccLogin")),y().createElement("div",{className:"g2-social-login-list"},m)),b=y().createElement("div",{className:"g2-social-login-list",style:{marginTop:-8}},y().createElement(aH,{onLoginSuccess:a,onLoginFailed:s}));return y().createElement(y().Fragment,null,!c&&y().createElement("div",{style:{flex:1,minHeight:16}}),y().createElement(h_,{size:c?0:8,direction:"vertical",className:"g2-guard-full-width-space"},!(null==l?void 0:l.ssoPageComponentDisplay.idpBtns)||v,b,!(null==l?void 0:l.ssoPageComponentDisplay.socialLoginBtns)||g))},cH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},lH=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},uH=y().useMemo,dH=y().useCallback,fH=function(e){var t=e.lists,n=e.handleDel,r=e.onClick,o=Pu().t,i=lj().isPhoneMedia,a=uH((function(){return i?"click":"hover"}),[i]),s=uH((function(){return lH(lH([],cH(t),!1),[{operation:!1,id:"other",title:o("login.useOtherAccount"),element:y().createElement("div",{className:"g2-multiple__icon--add-line"},y().createElement(YD,{style:{fontSize:24,color:"#4E5969"},type:"authing-add-line"}))}],!1)}),[t,o]),c=dH((function(e,t){n(t),e.stopPropagation()}),[n]),l=uH((function(){return s.map((function(e){var t=e,n=t.photo,i=t.title,s=t.description,l=t.id,u=t.operation,d=void 0===u||u,f=t.element;return y().createElement("li",{className:"g2-multiple__li",key:l,onClick:function(){return r(l)}},f||y().createElement("img",{className:"g2-multiple__avatar",alt:"",src:n}),y().createElement("section",{className:"g2-multiple__body"},i&&y().createElement("span",{className:"g2-multiple__title"},i),y().createElement("span",{className:i?"g2-multiple__desc":"g2-multiple__title"},s)),d&&y().createElement("span",{className:"g2-multiple__op",onClick:function(e){return e.stopPropagation()}},y().createElement(mv,{trigger:a,overlayClassName:"g2-multiple__op-wrapper",getPopupContainer:function(e){return e},content:y().createElement("div",{className:"g2-multiple__del",onClick:function(e){return c(e,l)}},y().createElement(YD,{style:{fontSize:20,marginRight:8},type:"authing-indeterminate-circle-line"}),o("common.del"))},y().createElement("div",{className:"g2-multiple__icon"},y().createElement(YD,{type:"authing-more-fill"})))))}))}),[s,r,c,o,a]);return y().createElement("ul",{className:"g2-multiple"},l)},pH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hH=y().useCallback,mH=y().useState,vH=y().memo((function(e){var t=pH(mH(0),2)[1],n=e.multipleInstance,r=e.referMultipleState,o=null==n?void 0:n.getMemoUser(),i=hH((function(){return t(Math.random)}),[]);if(!o)
|
|
18358
18356
|
// 这里应该额外处理下 其实本质上应该是存在的
|
|
18359
18357
|
return null;
|
|
18360
18358
|
/**
|
|
@@ -18363,11 +18361,11 @@ return null;
|
|
|
18363
18361
|
// way && account
|
|
18364
18362
|
var t=null==n?void 0:n.getMemoSingleUser(e);null==r||r("login",t)},handleDel:function(e){null==n||n.delUserById(e);var t=null==n?void 0:n.getMemoUser();0===(null==t?void 0:t.length)?
|
|
18365
18363
|
// 7.15: 如果仅剩一个需求跳转
|
|
18366
|
-
null==r||r("login"):i()}})})),gH=function(){return gH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gH.apply(this,arguments)},yH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},bH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},CH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},EH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},kH=y().useCallback,SH=y().useRef,xH=function(){var e=SH(null),t=EH(sT.useForm(),1)[0],n=uL(),r=WL(),o=kH((function(t){return wH(void 0,void 0,void 0,(function(){var o,i,a,s,c,l,u,d,f;return CH(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4/*yield*/,(h="reset-username-before-auth"/* ResetAccountBusinessAction.ResetName */,m=t,yH(void 0,void 0,void 0,(function(){return bH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,
|
|
18364
|
+
null==r||r("login"):i()}})})),gH=function(){return gH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gH.apply(this,arguments)},yH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},bH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},CH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},EH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},kH=y().useCallback,SH=y().useRef,xH=function(){var e=SH(null),t=EH(sT.useForm(),1)[0],n=uL(),r=WL(),o=kH((function(t){return wH(void 0,void 0,void 0,(function(){var o,i,a,s,c,l,u,d,f;return CH(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4/*yield*/,(h="reset-username-before-auth"/* ResetAccountBusinessAction.ResetName */,m=t,yH(void 0,void 0,void 0,(function(){return bH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(h,gH({},m))];case 1:return[2/*return*/,e.sent()]}}))})))];case 1:return o=p.sent(),i=o.apiCode,a=o.onGuardHandling,s=o.message,c=o.isFlowEnd,l=o.data,null===(u=e.current)||void 0===u||u.onSpin(!1),c?null===(d=null==n?void 0:n.onLogin)||void 0===d||d.call(n,l,r):i===AJ.RESET_ACCOUNT_NAME?
|
|
18367
18365
|
// 用户名重复
|
|
18368
|
-
vC.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==a||a()),[3/*break*/,3];case 2:return p.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var h,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},su.t("common.resetAccount.title")),y().createElement(sT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(UB.UserName,null,y().createElement(rO,{className:"authing-g2-input",size:"large",prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:su.t("login.inputUsername")})),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:su.t("common.sure"),className:"password",ref:e}))))},PH=function(){return PH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PH.apply(this,arguments)},_H=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},TH=y().useMemo,OH=function(e){var t=e.methods,n=_H(e,["methods"]),r=oL(),o=Pu().t,i=TH((function(){var e;return{"email-code":{t:o("common.email"),sort:2},"phone-code":{t:(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)?o("common.areaCodePhone"):o("common.phoneNumber"),sort:1}}}),[r,o]),a=TH((function(){return o("login.inputAccount",{text:null==t?void 0:t.map((function(e){return i[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[t,o,i]),s=TH((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(
|
|
18366
|
+
vC.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==a||a()),[3/*break*/,3];case 2:return p.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var h,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},su.t("common.resetAccount.title")),y().createElement(sT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(UB.UserName,null,y().createElement(rO,{className:"authing-g2-input",size:"large",prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:su.t("login.inputUsername")})),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:su.t("common.sure"),className:"password",ref:e}))))},PH=function(){return PH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PH.apply(this,arguments)},_H=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},TH=y().useMemo,OH=function(e){var t=e.methods,n=_H(e,["methods"]),r=oL(),o=Pu().t,i=TH((function(){var e;return{"email-code":{t:o("common.email"),sort:2},"phone-code":{t:(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)?o("common.areaCodePhone"):o("common.phoneNumber"),sort:1}}}),[r,o]),a=TH((function(){return o("login.inputAccount",{text:null==t?void 0:t.map((function(e){return i[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[t,o,i]),s=TH((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(xq,PH({maxLength:11,placeholder:a},n)):y().createElement(rO,PH({placeholder:a},n,{prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[n,t,a]);return y().createElement(y().Fragment,null,s)},NH=function(){return NH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NH.apply(this,arguments)},IH=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},AH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},RH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},MH=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};!function(e){e.Phone="phone",e.Email="email"}(tH||(tH={}));var DH=y().useCallback,LH=y().useEffect,FH=y().useMemo,jH=y().useRef,BH=y().useState,qH=function(e){var t,n,r,o=oL(),i=fL(),a=cL(),s=a._firstItemInitialValue,c=void 0===s?"":s,l=a.specifyDefaultLoginMethod,u=a._lockMethod,d=e.agreements,f=e.methods,p=e.autoRegister,h=e.submitButText,m=e.onLoginFailed,v=e.onLoginSuccess,g=e.saveIdentify,b=e.multipleInstance,w=e.backfillData,C=e.specifyCodeMethod,E=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,k=iL().post,S=lj().isPhoneMedia,x=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,P=jH(!1),_=RH(BH(!1),2),T=_[0],O=_[1],N=RH(BH(""),2),I=N[0],A=N[1],R=RH(BH(l&&null!=u?u:f[0]),2),M=R[0],D=R[1],L=RH(BH(!1),2),F=L[0],j=L[1],B=RH(BH(!1),2),q=B[0],U=B[1],V=RH(BH((null===(r=null==o?void 0:o.internationalSmsConfig)||void 0===r?void 0:r.defaultISOType)||"CN"),2),$=V[0],z=V[1],H=yL(),W=RH(BH(""),2),G=W[0],K=W[1],Y=RH(sT.useForm(),1)[0],J=DH((function(e){1!==f.length&&(fQ("email",e)?D(Tc.EmailCode):
|
|
18369
18367
|
// 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
|
|
18370
|
-
D(Tc.PhoneCode))}),[f.length]),Q=DH((function(e){A(e),J(e)}),[J]);b$({form:Y,way:$s.PhoneCode,formKey:"identify",backfillData:w,isOnlyInternationSms:F,setAreaCode:z,cancelBackfill:l===$s.PhoneCode,changeCurrentMethod:Q});var Z=jH(null),X=Pu().t,ee=DH((function(e){return F?y().createElement(
|
|
18368
|
+
D(Tc.PhoneCode))}),[f.length]),Q=DH((function(e){A(e),J(e)}),[J]);b$({form:Y,way:$s.PhoneCode,formKey:"identify",backfillData:w,isOnlyInternationSms:F,setAreaCode:z,cancelBackfill:l===$s.PhoneCode,changeCurrentMethod:Q});var Z=jH(null),X=Pu().t,ee=DH((function(e){return F?y().createElement(Rq,NH({},e,{form:Y,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),areaCode:$,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:x,scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,onSendCodeBefore:function(){return IH(void 0,void 0,void 0,(function(){return AH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,Y.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,M===Tc.PhoneCode&&y().createElement(Rq,NH({},e,{isInternationSms:x,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),areaCode:$,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,form:Y,fieldName:"identify",data:I,codeFieldName:"captchaCode",onSendCodeBefore:function(){return IH(void 0,void 0,void 0,(function(){return AH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,Y.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),M===Tc.EmailCode&&y().createElement(wU,NH({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),form:Y,fieldName:"identify",scene:Nc.LOGIN_VERIFY_CODE,maxLength:E,data:I,onSendCodeBefore:function(){return IH(void 0,void 0,void 0,(function(){return AH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[$,M,Y,I,x,F,X,E]);LH((function(){var e;
|
|
18371
18369
|
// 开启国际化配置且登录方式为手机号码时
|
|
18372
18370
|
(1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||C===tH.Phone)&&(j(!0),D(Tc.PhoneCode)),
|
|
18373
18371
|
// 指定了只用邮箱验证码
|
|
@@ -18375,17 +18373,17 @@ C===tH.Email&&(U(!0),D(Tc.EmailCode))}),[o,f,C]),LH((function(){
|
|
|
18375
18373
|
/** 如果是国外用户池,那么有图形验证码,需要请求图片 */
|
|
18376
18374
|
H&&K(w$(i.host))}),[H,null==i?void 0:i.host]),LH((function(){
|
|
18377
18375
|
// 方法发生变化时,图像验证码数据应该清空
|
|
18378
|
-
H&&(null==Y||Y.setFieldsValue({captchaCode:void 0}))}),[Y,M,H]);var te=function(e){return IH(void 0,void 0,void 0,(function(){var t,n,r,a,s,c,l,u;return AH(this,(function(d){switch(d.label){case 0:return t={phone:e.phoneNumber,code:e.code,customData:(null==i?void 0:i.isHost)?
|
|
18376
|
+
H&&(null==Y||Y.setFieldsValue({captchaCode:void 0}))}),[Y,M,H]);var te=function(e){return IH(void 0,void 0,void 0,(function(){var t,n,r,a,s,c,l,u;return AH(this,(function(d){switch(d.label){case 0:return t={phone:e.phoneNumber,code:e.code,customData:(null==i?void 0:i.isHost)?wQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1},o&&(null===(l=o.internationalSmsConfig)||void 0===l?void 0:l.enabled)&&(t.phoneCountryCode=e.phoneCountryCode),[4/*yield*/,k("/api/v2/login/phone-code",t)];case 1:return n=d.sent(),r=n.code,a=n.data,s=n.onGuardHandling,c=n.message,null===(u=Z.current)||void 0===u||u.onSpin(!1),200===r?
|
|
18379
18377
|
// props.onLogin(200, data)
|
|
18380
18378
|
v(a):
|
|
18381
18379
|
// 向上层抛出错误
|
|
18382
|
-
(null==s?void 0:s())===
|
|
18380
|
+
(null==s?void 0:s())===IJ.RENDER_MESSAGE&&m(r,a,c),[2/*return*/]}}))}))},ne=function(e){return IH(void 0,void 0,void 0,(function(){var t,n,r,o,a,s,c;return AH(this,(function(l){switch(l.label){case 0:return t={email:e.identify,code:e.code,customData:(null==i?void 0:i.isHost)?wQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1},[4/*yield*/,k("/api/v2/login/email-code",t)];case 1:return n=l.sent(),r=n.code,o=n.data,a=n.onGuardHandling,s=n.message,null===(c=Z.current)||void 0===c||c.onSpin(!1),200===r?
|
|
18383
18381
|
// props.onLogin(200, data)
|
|
18384
18382
|
v(o):
|
|
18385
18383
|
// 向上层抛出错误
|
|
18386
|
-
(null==a?void 0:a())===
|
|
18384
|
+
(null==a?void 0:a())===IJ.RENDER_MESSAGE&&m(r,o,s),[2/*return*/]}}))}))},re=FH((function(){var e,t;return h||(p&&!o.registerDisabled&&(null===(t=null===(e=i.registerMethods)||void 0===e?void 0:e.filter((function(e){
|
|
18387
18385
|
// @ts-ignore
|
|
18388
|
-
return[Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(X("common.login")," / ").concat(X("common.register")):X("common.login"))}),[p,h,X,i.registerMethods,o.registerDisabled]),oe=DH((function(e){return y().createElement(
|
|
18386
|
+
return[Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(X("common.login")," / ").concat(X("common.register")):X("common.login"))}),[p,h,X,i.registerMethods,o.registerDisabled]),oe=DH((function(e){return y().createElement(TU,NH({},e,{className:"authing-g2-input",size:"large",areaCode:$,onAreaCodeChange:function(e){z(e),Y.getFieldValue(["identify"])&&Y.validateFields(["identify"])}}))}),[$,Y]),ie=Vc();
|
|
18389
18387
|
// 邮箱验证码登录
|
|
18390
18388
|
return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"phoneCode",form:Y,onFinish:function(t){return IH(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,c,l,u,f,p,h,g,y,w;return AH(this,(function(C){switch(C.label){case 0:return O(!0),(null==d?void 0:d.length)&&!P.current?(
|
|
18391
18389
|
// message.error(t('common.loginProtocolTips'))
|
|
@@ -18393,9 +18391,9 @@ Z.current.onError(),[2/*return*/]):(n=uj(x,t.identify,$),r=n.phoneNumber,o=n.cou
|
|
|
18393
18391
|
// onBeforeLogin
|
|
18394
18392
|
null===(p=Z.current)||void 0===p||p.onSpin(!0),i={type:M,data:{identity:r,code:t.code,phoneCountryCode:o}},[4/*yield*/,null===(h=e.onBeforeLogin)||void 0===h?void 0:h.call(e,i)]);case 1:return!C.sent()&&e.onBeforeLogin?(null===(g=Z.current)||void 0===g||g.onSpin(!1),[2/*return*/]):e.onLoginRequest?[4/*yield*/,null===(y=e.onLoginRequest)||void 0===y?void 0:y.call(e,i)]:[3/*break*/,3];case 2:return a=C.sent(),s=a.code,c=a.apiCode,l=a.data,u=a.onGuardHandling,f=a.message,null===(w=Z.current)||void 0===w||w.onSpin(!1),200===s?v(l):
|
|
18395
18393
|
// 向上层抛出错误 执行绑定失败钩子
|
|
18396
|
-
(null==u?void 0:u())===
|
|
18394
|
+
(null==u?void 0:u())===IJ.RENDER_MESSAGE&&m(null!=c?c:s,l,f),[2/*return*/];case 3:
|
|
18397
18395
|
// 其实这里应该是保存两个 一个是 countryCode 一个是对应的 code
|
|
18398
|
-
return b&&b.setLoginWay("input","phone-code"===M?"phone-code":"email-code",void 0,x?{phoneCountryCode:o,areaCode:$}:void 0),"phone-code"!==M?[3/*break*/,5]:[4/*yield*/,te(NH(NH({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ne(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return Z.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g($s.PhoneCode,null==e?void 0:e.identify)}},y().createElement(xV,{initialValue:l===$s.PhoneCode?c:"phone"!==C&&x||!ie?"":ie,name:"identify",className:F?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:f,checkExist:!p,currentMethod:M,areaCode:$},F?y().createElement(oe,{autoFocus:!S}):y().createElement(OH,{className:"authing-g2-input",size:"large",autoFocus:!S,value:I,methods:q?["email-code"]:f,onChange:function(e){var t=e.target.value;J(t)},onBlur:function(e){var t=e.target.value;J(t)},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),H&&M===Tc.PhoneCode&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:
|
|
18396
|
+
return b&&b.setLoginWay("input","phone-code"===M?"phone-code":"email-code",void 0,x?{phoneCountryCode:o,areaCode:$}:void 0),"phone-code"!==M?[3/*break*/,5]:[4/*yield*/,te(NH(NH({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ne(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return Z.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g($s.PhoneCode,null==e?void 0:e.identify)}},y().createElement(xV,{initialValue:l===$s.PhoneCode?c:"phone"!==C&&x||!ie?"":ie,name:"identify",className:F?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:f,checkExist:!p,currentMethod:M,areaCode:$},F?y().createElement(oe,{autoFocus:!S}):y().createElement(OH,{className:"authing-g2-input",size:"large",autoFocus:!S,value:I,methods:q?["email-code"]:f,onChange:function(e){var t=e.target.value;J(t)},onBlur:function(e){var t=e.target.value;J(t)},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),H&&M===Tc.PhoneCode&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:pQ(X("common.captchaCode"))},y().createElement(a$,{className:"authing-g2-input",size:"large",placeholder:X("login.inputCaptchaCode"),verifyCodeUrl:G,changeCode:function(){return K(w$(i.host))}})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:MH([],RH(pQ(X("common.captchaCode"))),!1)},y().createElement(ee,null)),Boolean(null==d?void 0:d.length)&&y().createElement(h$,{onChange:function(e){P.current=e},agreements:d,showError:T}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:re,className:"password",ref:Z}))))};// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideSelector.tsx
|
|
18399
18397
|
function UH(e){var t=e.defaultValue,n=e.onChange,r=e.options;return y().createElement(cI,{defaultValue:t,onChange:n,options:r,dropdownMatchSelectWidth:!1,showArrow:!0})}// CONCATENATED MODULE: ./src/LazyloadImage/index.tsx
|
|
18400
18398
|
var VH=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$H=y().useEffect,zH=y().useState;function HH(e){var t=e.src,n=e.placeholder,r=e.className,o=e.style,i=e.alt,a=e.width,s=e.height,c=VH(zH(!1),2),l=c[0],u=c[1],d=new Image(0,0);return d.src=t,$H((function(){d.onload=function(){u(!0)}})),y().createElement(y().Fragment,null,l&&y().createElement("img",{src:t,width:a,height:s,className:r,style:o,alt:i})||n)}// CONCATENATED MODULE: ./node_modules/qrcode.react/lib/esm/index.js
|
|
18401
18399
|
var WH,GH=Object.defineProperty,KH=Object.getOwnPropertySymbols,YH=Object.prototype.hasOwnProperty,JH=Object.prototype.propertyIsEnumerable,QH=(e,t,n)=>t in e?GH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZH=(e,t)=>{for(var n in t||(t={}))YH.call(t,n)&&QH(e,n,t[n]);if(KH)for(var n of KH(t))JH.call(t,n)&&QH(e,n,t[n]);return e},XH=(e,t)=>{var n={};for(var r in e)YH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&KH)for(var r of KH(e))t.indexOf(r)<0&&JH.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e<this.size;e++)a.push(!1);for(let e=0;e<this.size;e++)this.modules.push(a.slice()),this.isFunction.push(a.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,a=40,c=-1,l=!0){if(!(t.MIN_VERSION<=o&&o<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=s.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(u),f);for(const e of t.getData())f.push(e)}i(f.length==d);const p=8*t.getNumDataCodewords(u,n);i(f.length<=p),r(0,Math.min(4,p-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)r(e,8,f);let h=[];for(;8*h.length<f.length;)h.push(0);return f.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(u,n,h,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],a=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=o-s%o,l=Math.floor(s/o);let u=[];const d=t.reedSolomonComputeDivisor(a);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+l-a+(n<c?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,d);n<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=l-a||n>=c)&&f.push(t[e])}));return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=t-i,s=0==(t+1&2)?this.size-1-r:r;!this.isFunction[s][a]&&n<8*e.length&&(this.modules[s][a]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[n][a]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][a],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[a][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const a=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new a(a.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new a(a.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new a(a.Mode.ECI,0,t)}static isNumeric(e){return a.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return a.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=a;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(WH||(WH={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(WH||(WH={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(WH||(WH={}));var eW=WH,tW={L:eW.QrCode.Ecc.LOW,M:eW.QrCode.Ecc.MEDIUM,Q:eW.QrCode.Ecc.QUARTILE,H:eW.QrCode.Ecc.HIGH},nW=128,rW="L",oW="#FFFFFF",iW="#000000",aW=!1,sW=4,cW=.1;
|
|
@@ -18411,25 +18409,25 @@ function vW(){var e=Pu().t;return y().createElement(y().Fragment,null,y().create
|
|
|
18411
18409
|
var gW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},yW=y().useMemo,bW=y().useState;function wW(e){var t=e.visible,n=e.onClose,r=Pu().t,o=r("login.howBindClient"),i=r("login.howGetAppLoginUrl"),a=r("login.howUsePushLogin"),s=gW(bW("howUsePushLogin"),2),c=s[0],l=s[1],u=lj().isPhoneMedia,d=yW((function(){return[{value:"howUsePushLogin",label:a},{value:"howBindClient",label:o},{value:"howGetAppLoginUrl",label:i}]}),[a,o,i]),f={howBindClient:y().createElement(hW,null),howGetAppLoginUrl:y().createElement(vW,null),howUsePushLogin:y().createElement(mW,null)};return y().createElement(VS,{title:y().createElement(UH,{defaultValue:"howUsePushLogin",onChange:function(e){var t=d.find((function(t){return t.value===e}));t&&l(t.value)},options:d}),placement:"right",onClose:n,open:t,width:u?"375":"640",closeIcon:y().createElement(YD,{type:"authing-close-line"})},f[c])}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/BeforeLogin.tsx
|
|
18412
18410
|
var CW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},EW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},kW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},SW=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},xW=y().useMemo,PW=y().useRef,_W=y().useState;function TW(e){var t,n=this,r=e.onPushSuccess,o=e.signinByPush,i=e.pushLoginStatus,a=e.setAccount,s=e.agreements,c=lj().isPhoneMedia,l=Pu().t,u=fL(),d=oL(),f=vL(),p=kW(sT.useForm(),1)[0],h=kW(_W(!1),2),m=h[0],v=h[1],g=kW(_W(!1),2),b=g[0],w=g[1],C=PW(null),E=xW((function(){var e=new Map;return d.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[d.tabMethodsFields]),k=kW(_W(!1),2),S=k[0],x=k[1],P=xW((function(){var e,t=(null===(e=d.authingOtpPushTabConfig)||void 0===e?void 0:e.validLoginMethods)||[];
|
|
18413
18411
|
// 登录注册合并
|
|
18414
|
-
return(null==u?void 0:u.autoRegister)?l("login.inputAccount",{text:
|
|
18412
|
+
return(null==u?void 0:u.autoRegister)?l("login.inputAccount",{text:FQ(t,E,f)}):l("login.inputAccount",{text:FQ(SW([],kW(t),!1),E,f)});
|
|
18415
18413
|
// 登录注册分页
|
|
18416
18414
|
}),[null==u?void 0:u.autoRegister,E,f,null===(t=d.authingOtpPushTabConfig)||void 0===t?void 0:t.validLoginMethods,l]);return y().createElement("div",null,!i&&y().createElement("div",{className:"push-login-error-tips-container"},y().createElement("div",{className:"push-login-error-warning-box"},y().createElement(YD,{type:"authing-error-warning-fill1",className:"icon-push-login-error-warning"}),y().createElement("div",null,l("login.getOtpLoginRequestAgain"))),y().createElement("div",{onClick:e.onchangePushLoginStatus},y().createElement(YD,{type:"authing-close-line",className:"close-line"}))),y().createElement(sT,{onFinish:function(e){return CW(n,void 0,void 0,(function(){return EW(this,(function(t){return function(e){CW(n,void 0,void 0,(function(){var t,n,i,c;return EW(this,(function(u){switch(u.label){case 0:return w(!0),(null==s?void 0:s.length)&&!m?(null==C||C.current.onError(),[2/*return*/]):e?[4/*yield*/,o({account:e})]:[2/*return*/,vC.error(l("login.enterAccount"))];case 1:return t=u.sent(),n=t.statusCode,i=t.message,c=t.data,200===n?(a(e),r({pushCodeId:(null==c?void 0:c.pushCodeId)||""})):vC.error(i),[2/*return*/]}}))}))}(e.account),[2/*return*/]}))}))},form:p},y().createElement(sT.Item,{name:"account"},y().createElement(rO,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!c,placeholder:P,prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),Boolean(null==s?void 0:s.length)&&y().createElement(h$,{agreements:s,showError:b,onChange:v}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:l("login.loginText"),htmlType:"submit",ref:C}))),y().createElement("div",{className:"how-use-push-login",onClick:function(){x(!0)}},l("login.howUsePushLogin"),"?"),y().createElement(wW,{visible:S,onClose:function(){x(!1)}}))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PendingLogin.tsx
|
|
18417
18415
|
function OW(e){var t=Pu().t;return y().createElement(y().Fragment,null,y().createElement("div",{className:"pending-tips"},y().createElement("div",{className:"code-success"},y().createElement(YD,{type:"authing-checkbox-circle-fill"})),y().createElement("div",null,t("login.otpLoginPendingText"))),y().createElement(sT,null,y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(cy,{block:!0,style:{width:"348px",height:"44px",background:"#F2F3F5",borderRadius:"4px",border:"none"},onClick:function(){e.onCancelLogin()}},t("login.authingOtpPushCancelLogin")))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/index.tsx
|
|
18418
|
-
var NW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},AW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RW=y().useCallback,MW=y().useEffect,DW=y().useRef,LW=y().useState;function FW(e){var t=this,n=e.onLoginSuccess,r=e.multipleInstance,o=e.agreements,i=AW(LW("before"),2),a=i[0],s=i[1],c=AW(LW(""),2),l=c[0],u=c[1],d=AW(LW(!0),2),f=d[0],p=d[1],h=DW(),m=AW(LW(""),2),v=m[0],g=m[1],b=function(){h.current&&clearInterval(h.current)},w=
|
|
18416
|
+
var NW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},AW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RW=y().useCallback,MW=y().useEffect,DW=y().useRef,LW=y().useState;function FW(e){var t=this,n=e.onLoginSuccess,r=e.multipleInstance,o=e.agreements,i=AW(LW("before"),2),a=i[0],s=i[1],c=AW(LW(""),2),l=c[0],u=c[1],d=AW(LW(!0),2),f=d[0],p=d[1],h=DW(),m=AW(LW(""),2),v=m[0],g=m[1],b=function(){h.current&&clearInterval(h.current)},w=rQ(),C=w.post,E=w.get,k=oL(),S=RW((function(){b(),s("before")}),[]),x=RW((function(e){void 0===e&&(e=!0),p(e)}),[]),P=RW((function(e){return NW(t,void 0,void 0,(function(){var t,n;return IW(this,(function(r){switch(r.label){case 0:return t=e.pushCodeId,n="/api/v3/check-pushcode-status?pushCodeId=".concat(t),[4/*yield*/,E(n)];case 1:return[2/*return*/,r.sent()]}}))}))}),[E]),_=RW((function(e){return NW(t,void 0,void 0,(function(){var t;return IW(this,(function(n){switch(n.label){case 0:return"/api/v2/users/me/info",t={headers:{"x-authing-userpool-id":k.userPoolId,authorization:"Bearer ".concat(e)}},[4/*yield*/,E("/api/v2/users/me/info",{},t)];case 1:return[2/*return*/,n.sent()]}}))}))}),[E,k.userPoolId]),T=function(){return NW(t,void 0,void 0,(function(){var e,t,o,i,a,s,c,u,d;return IW(this,(function(f){switch(f.label){case 0:return[4/*yield*/,P({pushCodeId:l})];case 1:return e=f.sent(),t=e.statusCode,o=e.data,i=e.message,200!==t?(vC.error(i),S(),[2/*return*/]):"AUTHORIZED"!==o.status?[3/*break*/,3]:(a=o.tokenSet.access_token,b(),[4/*yield*/,_(a)]);case 2:if(s=f.sent(),c=s.code,u=s.data,d=s.message,200===c)return null==r||r.setLoginWay("input",$s.AuthingOtpPush),n(u,d),[2/*return*/];f.label=3;case 3:return"PUSHED"!==o.status&&(p(!1),S()),[2/*return*/]}}))}))};MW((function(){if(l)return h.current=setInterval(T,1e3),function(){b()}}),[l,P,_,n,S]);var O={before:y().createElement(TW,{defaultAccount:v,setAccount:g,onPushSuccess:function(e){s("pending"),u(e.pushCodeId)},signinByPush:function(e){return NW(t,void 0,void 0,(function(){var t;return IW(this,(function(n){switch(n.label){case 0:return t=e.account,"/api/v3/signin-by-push",[4/*yield*/,C("/api/v3/signin-by-push",{account:t})];case 1:return[2/*return*/,n.sent()]}}))}))},pushLoginStatus:f,onchangePushLoginStatus:x,agreements:o}),pending:y().createElement(OW,{onCancelLogin:S})};return y().createElement("div",null,O[a])}// CONCATENATED MODULE: ./src/Login/socialLogin/postMessage.ts
|
|
18419
18417
|
// 处理所有使用 postMessage 方式的登录
|
|
18420
|
-
var jW,BW=function(){return BW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},BW.apply(this,arguments)},qW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},UW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},VW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$W=kL(),zW=y().useCallback,HW=y().useEffect,WW=y().useState,GW=(y().useMemo,function(e){var t=e.QRConfig,n=e.id,r=window.WwLogin,o=VW(WW(!0),2),i=o[0],a=o[1],s=iL().get,c=sL(),l=aL(),u=fL(),d=oL(),f=uL(),p=WL(),h=zW((function(){return qW(void 0,void 0,void 0,(function(){var e,o,i,s;return UW(this,(function(f){return e=BW({from_guard:"1",app_id:l,guard_version:"Guard@".concat($W)},c&&{tenant_id:c}),(null==u?void 0:u.isHost)&&(delete e.from_guard,e.from_hosted_guard="1",Uc()&&(e.redirected="1",(o=
|
|
18418
|
+
var jW,BW=function(){return BW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},BW.apply(this,arguments)},qW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},UW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},VW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$W=kL(),zW=y().useCallback,HW=y().useEffect,WW=y().useState,GW=(y().useMemo,function(e){var t=e.QRConfig,n=e.id,r=window.WwLogin,o=VW(WW(!0),2),i=o[0],a=o[1],s=iL().get,c=sL(),l=aL(),u=fL(),d=oL(),f=uL(),p=WL(),h=zW((function(){return qW(void 0,void 0,void 0,(function(){var e,o,i,s;return UW(this,(function(f){return e=BW({from_guard:"1",app_id:l,guard_version:"Guard@".concat($W)},c&&{tenant_id:c}),(null==u?void 0:u.isHost)&&(delete e.from_guard,e.from_hosted_guard="1",Uc()&&(e.redirected="1",(o=VQ())&&(
|
|
18421
18419
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
18422
18420
|
e.redirect_url=null===(s=Fc().parse(o.location.search))||void 0===s?void 0:s.finish_login_url))),(i=new r({id:"weCom_qrcode_wrapper-".concat(n),appid:t.corpId,agentid:t.agentId,redirect_uri:encodeURIComponent("".concat(t.redirectUrl,"?").concat(Fc().stringify(e))),
|
|
18423
18421
|
// redirect_uri,
|
|
18424
|
-
href:"".concat(null==d?void 0:d.cdnBase,"/guard-assets/wrp_code_friesland.css"),lang:su.
|
|
18422
|
+
href:"".concat(null==d?void 0:d.cdnBase,"/guard-assets/wrp_code_friesland.css"),lang:su.resolvedLanguage.includes("zh")?"zh":"en"})).frame.onload=function(e){a(!1),i.frame.contentWindow.postMessage&&i.frame.contentWindow.postMessage("ask_usePostMessage","*")},[2/*return*/]}))}))}),[t.agentId,t.corpId,t.redirectUrl,r,l,null==u?void 0:u.isHost,n,null==d?void 0:d.cdnBase,c]);return HW((function(){h()}),[h]),HW((function(){var n=function(n){return qW(void 0,void 0,void 0,(function(){var r,o,i,a;return UW(this,(function(c){switch(c.label){case 0:if(!BQ(n))return[3/*break*/,6];c.label=1;case 1:return c.trys.push([1,5,,6]),(null==f?void 0:f.onBeforeLogin)?[4/*yield*/,null==f?void 0:f.onBeforeLogin({type:$s.WechatworkCorpQrconnect,data:n.data},p)]:[3/*break*/,3];case 2:if(!c.sent())return[2/*return*/];c.label=3;case 3:return r=new URL(n.data).search,[4/*yield*/,s("/api/v1/qrcode/".concat(t.identifier,"/verify").concat(r))];case 4:return 200===(o=c.sent()).code?(e.multipleInstance&&e.multipleInstance.setLoginWay("qrcode",$s.WechatworkCorpQrconnect,e.id),e.onLoginSuccess(o.data)):
|
|
18425
18423
|
// 向上层抛出错误
|
|
18426
|
-
(null===(a=null==o?void 0:o.onGuardHandling)||void 0===a?void 0:a.call(o))===
|
|
18424
|
+
(null===(a=null==o?void 0:o.onGuardHandling)||void 0===a?void 0:a.call(o))===IJ.RENDER_MESSAGE&&e.onLoginFailed(o.code,o.data),[3/*break*/,6];case 5:return i=c.sent(),vC.error(i.message),[3/*break*/,6];case 6:return[2/*return*/]}}))}))};return i||window.addEventListener("message",n,!1),function(){window.removeEventListener("message",n,!1)}}),[t.identifier,p,f,s,i,e]),y().createElement("div",{className:"wecom_container"},i&&y().createElement(iF,null),y().createElement("div",{id:"weCom_qrcode_wrapper-".concat(n),style:{display:i?"none":""}}))}),KW=function(){return KW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KW.apply(this,arguments)},YW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZW=kL(),XW=y().useCallback,eG=y().useEffect,tG=y().useState,nG=function(e){var t=e.QRConfig,n=e.id,r=window.DTFrameLogin,o=QW(tG(!0),2),i=o[0],a=o[1],s=iL().get,c=sL(),l=aL(),u=uL(),d=WL(),f=fL(),p=XW((function(){return YW(void 0,void 0,void 0,(function(){var o,i,p,h;return JW(this,(function(m){return o=KW({from_guard:"1",embedded:"1",app_id:l,guard_version:"Guard@".concat(ZW)},c&&{tenant_id:c}),(null==f?void 0:f.isHost)&&(delete o.from_guard,o.from_hosted_guard="1",Uc()&&(o.redirected="1",(i=VQ())&&(
|
|
18427
18425
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
18428
18426
|
o.redirect_url=null===(h=Fc().parse(i.location.search))||void 0===h?void 0:h.finish_login_url))),p=r({id:"dingtalk_qrcode_wrapper-".concat(n),width:"100%",height:388},{redirect_uri:encodeURIComponent("".concat(t.redirectUrl,"?").concat(Fc().stringify(o))),client_id:t.clientId,scope:"openid",response_type:"code",
|
|
18429
18427
|
// state: 'xxxxxxxxx',
|
|
18430
18428
|
prompt:"consent"},(function(n){return YW(void 0,void 0,void 0,(function(){var r,i,a,c;return JW(this,(function(l){switch(l.label){case 0:r=n.authCode,l.label=1;case 1:return l.trys.push([1,5,,6]),(null==u?void 0:u.onBeforeLogin)?[4/*yield*/,null==u?void 0:u.onBeforeLogin({type:$s.WechatworkCorpQrconnect,data:n},d)]:[3/*break*/,3];case 2:if(!l.sent())return[2/*return*/];l.label=3;case 3:return[4/*yield*/,s("/api/v1/qrcode/".concat(t.identifier,"/verify?").concat(Fc().stringify(o),"&code=").concat(r))];case 4:return 200===(i=l.sent()).code?(e.multipleInstance&&e.multipleInstance.setLoginWay("qrcode",$s.DingTalkQrcode,e.id),e.onLoginSuccess(i.data)):
|
|
18431
18429
|
// 向上层抛出错误
|
|
18432
|
-
(null===(c=null==i?void 0:i.onGuardHandling)||void 0===c?void 0:c.call(i))===
|
|
18430
|
+
(null===(c=null==i?void 0:i.onGuardHandling)||void 0===c?void 0:c.call(i))===IJ.RENDER_MESSAGE&&e.onLoginFailed(i.code,i.data),[3/*break*/,6];case 5:return a=l.sent(),vC.error(a.message),[3/*break*/,6];case 6:return[2/*return*/]}}))}))}),(function(e){})),
|
|
18433
18431
|
// frame 页面二维码加载完毕
|
|
18434
18432
|
p.onload=function(){a(!1)},[2/*return*/]}))}))}),[r,t,l,null==f?void 0:f.isHost,c]);return eG((function(){p()}),[p]),y().createElement("div",{className:"wecom_container"},i&&y().createElement(iF,null),y().createElement("div",{id:"dingtalk_qrcode_wrapper-".concat(n),style:{display:i?"none":""}}))},rG=function(){return rG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rG.apply(this,arguments)},oG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iG=y().useEffect,aG=y().useLayoutEffect,sG=y().useState,cG=y().useRef,lG=y().useMemo,uG=y().useCallback,dG=[$s.Password,$s.PhoneCode,$s.AD,$s.LDAP,$s.AuthingOtpPush,$s.EmailCode],fG=[$s.AppQr,$s.WxMinQr,$s.WechatMpQrcode,$s.WechatworkCorpQrconnect,$s.DingTalkQrcode],pG=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e},hG=function(e){var t,n,r,o,i,a,s,c,l,u,d=e.isResetPage,f=void 0!==d&&d,p=cL().specifyDefaultLoginMethod,h=fL(),m=aL(),v=dL().changeModule,g=uL(),b=oL(),w=oG(function(e){var t=null==e?void 0:e.defaultLoginMethod,n=null==e?void 0:e.loginMethods;return(null==n?void 0:n.includes(t))||(t=null==n?void 0:n[0]),[t,YV()(n,dG).length>0,YV()(n,fG).length>0]}(h),3),C=w[0],E=w[1],k=w[2],S=null==h?void 0:h.agreementEnabled,x=Pu().t,P=(u=iL().responseIntercept,function(e){var t=e.data,n=t.message,r=t.data,o=t.event,i=t.code;
|
|
18435
18433
|
// 社会化登录是用 authing-js-sdk 实现的,不用再在这里回调了
|
|
@@ -18451,14 +18449,14 @@ return(null==a?void 0:a.qrCodeId)&&(t.current=a.way+(null==a?void 0:a.qrCodeId))
|
|
|
18451
18449
|
r=!0),!0===i&&(r=!0),{disableResetPwd:n,disableRegister:r}}({config:h,loginWay:T,autoRegister:null==h?void 0:h.autoRegister}),ne=te.disableResetPwd,re=te.disableRegister,oe=lG((function(){var e=Z?Z.filter((function(e){return fG.includes(e)})):[];//取到扫码登录类型
|
|
18452
18450
|
return!(e.length>1)&&(!!e.includes($s.AppQr)||(!q||!((null==q?void 0:q[$s.WechatMpQrcode].length)>1||(null==q?void 0:q[$s.WxMinQr].length)>1||(null==q?void 0:q[$s.DingTalkQrcode].length)>1||(null==q?void 0:q[$s.WechatworkCorpQrconnect].length)>1)))}),[Z,q]),ie=lG((function(){var e,t;
|
|
18453
18451
|
// 如果存在多账号的二维码方式
|
|
18454
|
-
if(I)return I;if([$s.WechatMpQrcode,$s.WxMinQr,$s.WechatworkCorpQrconnect,$s.DingTalkQrcode].includes(C)){var n=null===(t=null===(e=null==q?void 0:q[C])||void 0===e?void 0:e.find((function(e){return e.isDefault})))||void 0===t?void 0:t.id;return C+n}return C}),[I,C,q]),ae=uG((function(e,t){var n;null===(n=null==g?void 0:g.onLogin)||void 0===n||n.call(g,e,B)}),[B,g]),se=uG((function(e,t){var n;K.current=rG(rG({},K.current),((n={})[e]=
|
|
18452
|
+
if(I)return I;if([$s.WechatMpQrcode,$s.WxMinQr,$s.WechatworkCorpQrconnect,$s.DingTalkQrcode].includes(C)){var n=null===(t=null===(e=null==q?void 0:q[C])||void 0===e?void 0:e.find((function(e){return e.isDefault})))||void 0===t?void 0:t.id;return C+n}return C}),[I,C,q]),ae=uG((function(e,t){var n;null===(n=null==g?void 0:g.onLogin)||void 0===n||n.call(g,e,B)}),[B,g]),se=uG((function(e,t){var n;K.current=rG(rG({},K.current),((n={})[e]=RQ(t),n))}),[]);
|
|
18455
18453
|
// 重置用户名页面
|
|
18456
18454
|
iG((function(){f&&vC.info({content:su.t("common.resetAccount.message"),className:"g2-view-message-info"})}),[f]);var ce=uG((function(e,t,n){var r,o=Mz[e];
|
|
18457
18455
|
// TODO 与拦截器中 render-message 同步
|
|
18458
18456
|
"message"===(null==o?void 0:o.action)&&z($+1),"accountLock"===(null==o?void 0:o.action)&&G(!0),null===(r=null==g?void 0:g.onLoginError)||void 0===r||r.call(g,{code:e,data:t,message:n})}),[$,g]),le=uG((function(e){var t;return(null==g?void 0:g.onBeforeLogin)?null===(t=null==g?void 0:g.onBeforeLogin)||void 0===t?void 0:t.call(g,e,B):function(){}}),[B,g]);iG((function(){fG.includes(T)?j(!0):j(!1);
|
|
18459
18457
|
// 可以设定 = fasle 的时候关闭 qrcode 的几个定时器
|
|
18460
18458
|
// 不关的话,第二次进入会更快,也没什么代价(只有轮询)
|
|
18461
|
-
}),[T]);var ue=function(e){var t=su.t("login.scanLogin");return fG.includes(e)&&(t=su.t("login.moreWays")),{switchText:t,inputNone:dG.includes(e)?"":"none",qrcodeNone:fG.includes(e)?"":"none"}}(T),de=ue.switchText,fe=ue.inputNone,pe=ue.qrcodeNone,he=lG((function(){var e,t;return S&&null!==(t=null===(e=null==h?void 0:h.agreements)||void 0===e?void 0:e.filter((function(e){return ud(su.
|
|
18459
|
+
}),[T]);var ue=function(e){var t=su.t("login.scanLogin");return fG.includes(e)&&(t=su.t("login.moreWays")),{switchText:t,inputNone:dG.includes(e)?"":"none",qrcodeNone:fG.includes(e)?"":"none"}}(T),de=ue.switchText,fe=ue.inputNone,pe=ue.qrcodeNone,he=lG((function(){var e,t;return S&&null!==(t=null===(e=null==h?void 0:h.agreements)||void 0===e?void 0:e.filter((function(e){return ud(su.resolvedLanguage).find((function(t){return t.includes(e.lang)}))&&((null==h?void 0:h.autoRegister)||!!(null==e?void 0:e.availableAt))})))&&void 0!==t?t:[]}),[S,null==h?void 0:h.autoRegister,null==h?void 0:h.agreements,su.resolvedLanguage]),me=lG((function(){var e,t;return null!==(t=null===(e=null==b?void 0:b.verifyCodeTabConfig)||void 0===e?void 0:e.enabledLoginMethods)&&void 0!==t?t:["phone-code"]}),[null===(t=null==b?void 0:b.verifyCodeTabConfig)||void 0===t?void 0:t.enabledLoginMethods]),ve=oG(dj({config:h,publicConfig:b}),3),ge=ve[0],ye=ve[1],be=ve[2],we=!(null===(n=null==h?void 0:h.loginMethods)||void 0===n?void 0:n.length),Ce=lj().isPhoneMedia;
|
|
18462
18460
|
//availableAt 0或者null-注册时,1-登录时,2-注册和登录时 注册登录合并时应该登录注册协议全部显示
|
|
18463
18461
|
// 渲染前执行
|
|
18464
18462
|
aG((function(){var e;if(we&&!Ce){
|
|
@@ -18471,51 +18469,51 @@ return t.style["min-height"]=be?"456px":"280px",t.classList.add("no-login-method
|
|
|
18471
18469
|
// @ts-ignore
|
|
18472
18470
|
t.style["min-height"]="540px",t.classList.remove("no-login-methods-view")}}}),[be,Ce,we]),iG((function(){var e,t=id(),n=null===(e=t.getElementsByClassName("g2-view-header"))||void 0===e?void 0:e[0],r=t.querySelector(".g2-view-login>.g2-view-container-inner");return Ce&&we?(n&&n.classList.add("g2-view-header-mobile"),r&&r.classList.add("g2-view-login-mobile-inner")):(null==n||n.classList.remove("g2-view-header-mobile"),null==r||r.classList.remove("g2-view-login-mobile-inner")),function(){null==n||n.classList.remove("g2-view-header-mobile"),null==r||r.classList.remove("g2-view-login-mobile-inner")}}),[Ce,we]);
|
|
18473
18471
|
// 获取登录 tab 多语言
|
|
18474
|
-
var Ee=(null===(r=null==b?void 0:b.ssoPageComponentDisplay)||void 0===r?void 0:r.loginMethodsI18nDisplaySettings)||{},ke=Ee.password,Se=Ee.verifyCode,xe=Ee.ad,Pe=Ee.ldap,_e=lG((function(){var e,t,n,r;return(null==Z?void 0:Z.includes($s.Password))&&y().createElement(SR.TabPane,{key:$s.Password,tab:pG((null===(t=null===(e=null==ke?void 0:ke.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.
|
|
18472
|
+
var Ee=(null===(r=null==b?void 0:b.ssoPageComponentDisplay)||void 0===r?void 0:r.loginMethodsI18nDisplaySettings)||{},ke=Ee.password,Se=Ee.verifyCode,xe=Ee.ad,Pe=Ee.ldap,_e=lG((function(){var e,t,n,r;return(null==Z?void 0:Z.includes($s.Password))&&y().createElement(SR.TabPane,{key:$s.Password,tab:pG((null===(t=null===(e=null==ke?void 0:ke.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.resolvedLanguage])||(null===(n=null==ke?void 0:ke.tab)||void 0===n?void 0:n.default)||x("login.pwdLogin"))},y().createElement(N$,{loginWay:T,publicKey:Q,autoRegister:null==h?void 0:h.autoRegister,host:null==h?void 0:h.host,
|
|
18475
18473
|
// onLogin={onLogin}
|
|
18476
18474
|
backfillData:A,onLoginSuccess:ae,onLoginFailed:ce,onBeforeLogin:le,saveIdentify:se,passwordLoginMethods:null!==(r=null==h?void 0:h.passwordLoginMethods)&&void 0!==r?r:[],agreements:he,multipleInstance:R}))}),[he,Z,R,A,h,Q,T,le,se,ce,ae,x,ke]),Te=lG((function(){var e,t,n,r,o,i,a,s,c,l,u;if(!(null==Z?void 0:Z.includes($s.PhoneCode)))return y().createElement(y().Fragment,null);
|
|
18477
18475
|
// 是否开启了国际化短信功能
|
|
18478
18476
|
var d=[];
|
|
18479
18477
|
// 开启国际化短信时要将短信和邮箱 tab 拆分,方便下拉选取手机区号
|
|
18480
|
-
return(null===(e=null==b?void 0:b.internationalSmsConfig)||void 0===e?void 0:e.enabled)||!1?((null===(n=null===(t=b.verifyCodeTabConfig)||void 0===t?void 0:t.enabledLoginMethods)||void 0===n?void 0:n.includes("phone-code"))&&d.push(y().createElement(SR.TabPane,{key:$s.PhoneCode,tab:pG((null===(o=null===(r=null==Se?void 0:Se.tab)||void 0===r?void 0:r.i18n)||void 0===o?void 0:o[su.
|
|
18478
|
+
return(null===(e=null==b?void 0:b.internationalSmsConfig)||void 0===e?void 0:e.enabled)||!1?((null===(n=null===(t=b.verifyCodeTabConfig)||void 0===t?void 0:t.enabledLoginMethods)||void 0===n?void 0:n.includes("phone-code"))&&d.push(y().createElement(SR.TabPane,{key:$s.PhoneCode,tab:pG((null===(o=null===(r=null==Se?void 0:Se.tab)||void 0===r?void 0:r.i18n)||void 0===o?void 0:o[su.resolvedLanguage])||(null===(i=null==Se?void 0:Se.tab)||void 0===i?void 0:i.default)||x("common.phoneCodeTab"))},y().createElement(qH,{verifyCodeLength:null==b?void 0:b.verifyCodeLength,autoRegister:null==h?void 0:h.autoRegister,onBeforeLogin:le,
|
|
18481
18479
|
// onLogin={onLogin}
|
|
18482
18480
|
onLoginSuccess:ae,onLoginFailed:ce,saveIdentify:se,agreements:he,methods:me,backfillData:A,multipleInstance:R,specifyCodeMethod:tH.Phone}))),(null===(s=null===(a=b.verifyCodeTabConfig)||void 0===a?void 0:a.enabledLoginMethods)||void 0===s?void 0:s.includes("email-code"))&&d.push(y().createElement(SR.TabPane,{key:$s.EmailCode,
|
|
18483
18481
|
// TODO 后续需要单独抽出来
|
|
18484
18482
|
tab:pG(x("common.emailCodeTab"))},y().createElement(qH,{verifyCodeLength:null==b?void 0:b.verifyCodeLength,autoRegister:null==h?void 0:h.autoRegister,onBeforeLogin:le,
|
|
18485
18483
|
// onLogin={onLogin}
|
|
18486
|
-
onLoginSuccess:ae,onLoginFailed:ce,saveIdentify:se,agreements:he,methods:me,backfillData:A,multipleInstance:R,specifyCodeMethod:tH.Email}))),d):y().createElement(SR.TabPane,{key:$s.PhoneCode,tab:pG((null===(l=null===(c=null==Se?void 0:Se.tab)||void 0===c?void 0:c.i18n)||void 0===l?void 0:l[su.
|
|
18484
|
+
onLoginSuccess:ae,onLoginFailed:ce,saveIdentify:se,agreements:he,methods:me,backfillData:A,multipleInstance:R,specifyCodeMethod:tH.Email}))),d):y().createElement(SR.TabPane,{key:$s.PhoneCode,tab:pG((null===(l=null===(c=null==Se?void 0:Se.tab)||void 0===c?void 0:c.i18n)||void 0===l?void 0:l[su.resolvedLanguage])||(null===(u=null==Se?void 0:Se.tab)||void 0===u?void 0:u.default)||x("common.verifyCodeLogin"))},y().createElement(qH,{verifyCodeLength:null==b?void 0:b.verifyCodeLength,autoRegister:null==h?void 0:h.autoRegister,onBeforeLogin:le,
|
|
18487
18485
|
// onLogin={onLogin}
|
|
18488
|
-
onLoginSuccess:ae,onLoginFailed:ce,saveIdentify:se,agreements:he,methods:me,backfillData:A,multipleInstance:R}))}),[Z,null===(o=null==b?void 0:b.internationalSmsConfig)||void 0===o?void 0:o.enabled,null===(i=b.verifyCodeTabConfig)||void 0===i?void 0:i.enabledLoginMethods,null==b?void 0:b.verifyCodeLength,x,null==h?void 0:h.autoRegister,le,ae,ce,se,he,me,A,R,null===(a=null==Se?void 0:Se.tab)||void 0===a?void 0:a.i18n,null===(s=null==Se?void 0:Se.tab)||void 0===s?void 0:s.default]),Oe=lG((function(){var e,t,n;return(null==Z?void 0:Z.includes($s.LDAP))&&y().createElement(SR.TabPane,{key:$s.LDAP,tab:pG((null===(t=null===(e=null==Pe?void 0:Pe.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.
|
|
18486
|
+
onLoginSuccess:ae,onLoginFailed:ce,saveIdentify:se,agreements:he,methods:me,backfillData:A,multipleInstance:R}))}),[Z,null===(o=null==b?void 0:b.internationalSmsConfig)||void 0===o?void 0:o.enabled,null===(i=b.verifyCodeTabConfig)||void 0===i?void 0:i.enabledLoginMethods,null==b?void 0:b.verifyCodeLength,x,null==h?void 0:h.autoRegister,le,ae,ce,se,he,me,A,R,null===(a=null==Se?void 0:Se.tab)||void 0===a?void 0:a.i18n,null===(s=null==Se?void 0:Se.tab)||void 0===s?void 0:s.default]),Oe=lG((function(){var e,t,n;return(null==Z?void 0:Z.includes($s.LDAP))&&y().createElement(SR.TabPane,{key:$s.LDAP,tab:pG((null===(t=null===(e=null==Pe?void 0:Pe.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.resolvedLanguage])||(null===(n=null==Pe?void 0:Pe.tab)||void 0===n?void 0:n.default)||x("login.ldapLogin"))},y().createElement(L$,{publicKey:Q,autoRegister:null==h?void 0:h.autoRegister,host:null==h?void 0:h.host,
|
|
18489
18487
|
// onLogin={onLogin}
|
|
18490
|
-
onLoginSuccess:ae,onLoginFailed:ce,onBeforeLogin:le,agreements:he,backfillData:A,multipleInstance:R}))}),[he,A,null==h?void 0:h.autoRegister,null==h?void 0:h.host,R,le,ce,ae,Q,Z,x,Pe]),Ne=lG((function(){var e,t,n;return(null==Z?void 0:Z.includes($s.AD))&&y().createElement(SR.TabPane,{key:$s.AD,tab:pG((null===(t=null===(e=null==xe?void 0:xe.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.
|
|
18488
|
+
onLoginSuccess:ae,onLoginFailed:ce,onBeforeLogin:le,agreements:he,backfillData:A,multipleInstance:R}))}),[he,A,null==h?void 0:h.autoRegister,null==h?void 0:h.host,R,le,ce,ae,Q,Z,x,Pe]),Ne=lG((function(){var e,t,n;return(null==Z?void 0:Z.includes($s.AD))&&y().createElement(SR.TabPane,{key:$s.AD,tab:pG((null===(t=null===(e=null==xe?void 0:xe.tab)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t[su.resolvedLanguage])||(null===(n=null==xe?void 0:xe.tab)||void 0===n?void 0:n.default)||x("login.adLogin"))},y().createElement($$,{backfillData:A,multipleInstance:R,publicKey:Q,autoRegister:null==h?void 0:h.autoRegister,
|
|
18491
18489
|
// onLogin={onLogin}
|
|
18492
|
-
onLoginSuccess:ae,onLoginFailed:ce,onBeforeLogin:le,agreements:he}))}),[he,A,null==h?void 0:h.autoRegister,R,le,ce,ae,Q,Z,x,xe]),Ie=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WxMinQr+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.scanLogin")},y().createElement(Nz,{id:e.id,multipleInstance:R,onLoginSuccess:ae,canLoop:F,qrCodeScanOptions:{extIdpConnId:e.id}}))}),[F,R,ae,x]),Ae=uG((function(){return y().createElement(SR.TabPane,{key:$s.AppQr,tab:x("login.appScanLogin")},y().createElement(_z,{multipleInstance:R,onLoginSuccess:ae,canLoop:F}))}),[F,R,ae,x]),Re=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatMpQrcode+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wechatmpQrcode")},y().createElement(Rz,{id:e.id,multipleInstance:R,onLoginSuccess:ae,canLoop:F,qrCodeScanOptions:{extIdpConnId:e.id}}))}),[F,R,ae,x]),Me=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatworkCorpQrconnect+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wecomScanLogin")},y().createElement(GW,{id:e.id,QRConfig:e.QRConfig,onLoginSuccess:ae,onLoginFailed:ce}))}),[F,R,ae,x]),De=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatworkCorpQrconnect+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wecomScanLogin")},y().createElement(nG,{id:e.id,QRConfig:e.QRConfig,onLoginSuccess:ae,onLoginFailed:ce}))}),[F,R,ae,x]),Le=lG((function(){return(null==Z?void 0:Z.includes($s.AuthingOtpPush))&&y().createElement(SR.TabPane,{key:$s.AuthingOtpPush,tab:x("login.authingOtpPushLogin")},y().createElement(FW,{onLoginSuccess:ae,multipleInstance:R,initData:A,agreements:he}))}),[Z,ae,x,A,R,he]),Fe=lG((function(){var e;return(e={})[$s.Password]=_e,e[$s.PhoneCode]=Te,e[$s.LDAP]=Oe,e[$s.AD]=Ne,e[$s.AuthingOtpPush]=Le,e}),[_e,Te,Oe,Ne,Le]),je=lG((function(){var e,t=null==Z?void 0:Z.filter((function(e){return[$s.Password,$s.PhoneCode,$s.LDAP,$s.AD,$s.AuthingOtpPush].includes(e)}));return t?
|
|
18490
|
+
onLoginSuccess:ae,onLoginFailed:ce,onBeforeLogin:le,agreements:he}))}),[he,A,null==h?void 0:h.autoRegister,R,le,ce,ae,Q,Z,x,xe]),Ie=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WxMinQr+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.scanLogin")},y().createElement(Nz,{id:e.id,multipleInstance:R,onLoginSuccess:ae,canLoop:F,qrCodeScanOptions:{extIdpConnId:e.id}}))}),[F,R,ae,x]),Ae=uG((function(){return y().createElement(SR.TabPane,{key:$s.AppQr,tab:x("login.appScanLogin")},y().createElement(_z,{multipleInstance:R,onLoginSuccess:ae,canLoop:F}))}),[F,R,ae,x]),Re=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatMpQrcode+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wechatmpQrcode")},y().createElement(Rz,{id:e.id,multipleInstance:R,onLoginSuccess:ae,canLoop:F,qrCodeScanOptions:{extIdpConnId:e.id}}))}),[F,R,ae,x]),Me=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatworkCorpQrconnect+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wecomScanLogin")},y().createElement(GW,{id:e.id,QRConfig:e.QRConfig,onLoginSuccess:ae,onLoginFailed:ce}))}),[F,R,ae,x]),De=uG((function(e){var t;return y().createElement(SR.TabPane,{key:$s.WechatworkCorpQrconnect+e.id,tab:null!==(t=e.title)&&void 0!==t?t:x("login.wecomScanLogin")},y().createElement(nG,{id:e.id,QRConfig:e.QRConfig,onLoginSuccess:ae,onLoginFailed:ce}))}),[F,R,ae,x]),Le=lG((function(){return(null==Z?void 0:Z.includes($s.AuthingOtpPush))&&y().createElement(SR.TabPane,{key:$s.AuthingOtpPush,tab:x("login.authingOtpPushLogin")},y().createElement(FW,{onLoginSuccess:ae,multipleInstance:R,initData:A,agreements:he}))}),[Z,ae,x,A,R,he]),Fe=lG((function(){var e;return(e={})[$s.Password]=_e,e[$s.PhoneCode]=Te,e[$s.LDAP]=Oe,e[$s.AD]=Ne,e[$s.AuthingOtpPush]=Le,e}),[_e,Te,Oe,Ne,Le]),je=lG((function(){var e,t=null==Z?void 0:Z.filter((function(e){return[$s.Password,$s.PhoneCode,$s.LDAP,$s.AD,$s.AuthingOtpPush].includes(e)}));return t?jQ(t,null!==(e=h.defaultLoginMethod)&&void 0!==e?e:"").map((function(e){return Fe[e]})):null}),[h.defaultLoginMethod,Z,Fe]),Be=lG((function(){var e;return(e={})[$s.AppQr]=Ae,e[$s.WechatMpQrcode]=Re,e[$s.WxMinQr]=Ie,e[$s.WechatworkCorpQrconnect]=Me,e[$s.DingTalkQrcode]=De,e}),[Ae,Re,Ie]),qe=lG((function(){var e,t={};Object.keys(q).forEach((function(e){q[e].forEach((function(n){t[n.id]={type:e,title:n.title,id:n.id,QRConfig:n.QRConfig}}))}));var n=(null===(e=b.qrCodeSortConfig)||void 0===e?void 0:e.loginMethodsSort)||[],r=(n||[]).map((function(e){var n;return{key:e,type:(null===(n=t[e])||void 0===n?void 0:n.type)||$s.AppQr}})),o=null==r?void 0:r.findIndex((function(e){return e.type===C}));if(o>0){var i=n.splice(o,1);n.unshift(i[0])}return(n||[]).map((function(e){var n;return t[e]?null===(n=Be[t[e].type])||void 0===n?void 0:n.call(Be,t[e]):Be[$s.AppQr]()}))}),[Be,q,null===(c=b.qrCodeSortConfig)||void 0===c?void 0:c.loginMethodsSort,C]);return iG((function(){var e=function(e){
|
|
18493
18491
|
// 去掉钉钉和企微域下的postmessage处理 由他们内部自己监听的message控制 避免重复触发
|
|
18494
18492
|
/** 是否存在开启内嵌模式的身份源 */
|
|
18495
18493
|
var t=U.filter((function(e){return e.embedded}));
|
|
18496
|
-
/** 处于扫码登录方式 */if(t.length>0&&fG.includes(T)){if(t.find((function(e){return e.provider.replaceAll(":","-")===$s.WechatworkCorpQrconnect}))&&
|
|
18494
|
+
/** 处于扫码登录方式 */if(t.length>0&&fG.includes(T)){if(t.find((function(e){return e.provider.replaceAll(":","-")===$s.WechatworkCorpQrconnect}))&&BQ(e))return;if(t.find((function(e){return"dingtalk"===e.provider.replaceAll(":","-")}))&&qQ(e.origin))return}var n=P(e);if(n){
|
|
18497
18495
|
// 更新本次登录方式
|
|
18498
18496
|
R&&R.setLoginWay("input","social");var r=n.code,o=n.data,i=n.onGuardHandling;if(200===r)ae(o);else
|
|
18499
18497
|
// 向上层抛出错误
|
|
18500
|
-
(null==i?void 0:i())===
|
|
18498
|
+
(null==i?void 0:i())===IJ.RENDER_MESSAGE&&ce(r,o)}},t=VQ();
|
|
18501
18499
|
// 如果有第三方身份源开启监听
|
|
18502
|
-
return(ge.length>0||ye.length>0)&&(null==t||t.addEventListener("message",e)),function(){null==t||t.removeEventListener("message",e)}}),[ce,R,ae,P]),y().createElement("div",{className:"g2-view-container g2-view-login"},y().createElement("div",{className:"g2-view-container-inner"},be?y().createElement(y().Fragment,null,y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==h?void 0:h.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},null==h?void 0:h.title),!!(null==b?void 0:b.welcomeMessage)&&y().createElement("div",{className:"title-description"},null==b?void 0:b.welcomeMessage[su.
|
|
18500
|
+
return(ge.length>0||ye.length>0)&&(null==t||t.addEventListener("message",e)),function(){null==t||t.removeEventListener("message",e)}}),[ce,R,ae,P]),y().createElement("div",{className:"g2-view-container g2-view-login"},y().createElement("div",{className:"g2-view-container-inner"},be?y().createElement(y().Fragment,null,y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==h?void 0:h.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},null==h?void 0:h.title),!!(null==b?void 0:b.welcomeMessage)&&y().createElement("div",{className:"title-description"},null==b?void 0:b.welcomeMessage[su.resolvedLanguage])),y().createElement("div",{className:"no-login-methods-view"},y().createElement(YD,{type:"authing-bianzu",style:{width:178,height:120}}),y().createElement("span",{className:"no-login-methods-desc"},x("login.noLoginMethodsDesc")))):y().createElement(y().Fragment,null,!M&&E&&k&&y().createElement("div",{className:"g2-qrcode-switch"},y().createElement(mv,{placement:"leftTop",content:de,overlayClassName:de===su.t("login.moreWays")?"long-switch-text":"switch-text",getPopupContainer:function(e){return e?e.parentElement:document.body}},y().createElement("div",{className:"switch-img",onClick:function(){vC.destroy(),dG.includes(T)?O(ee):fG.includes(T)&&O(X)}},y().createElement("div",{className:"imgae-mask"}),y().createElement(YD,{type:"authing-a-erweima22",className:"qrcode-switch-image ".concat(fe)}),y().createElement(YD,{type:"authing-diannao",className:"qrcode-switch-image ".concat(pe)})))),y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==h?void 0:h.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},M?x("login.selectLoginAccount"):null==h?void 0:h.title),!!(null==b?void 0:b.welcomeMessage)&&y().createElement("div",{className:"title-description"},null==b?void 0:b.welcomeMessage[su.resolvedLanguage]),null===(l=null==J?void 0:J.map)||void 0===l?void 0:l.call(J,(function(e,t){
|
|
18503
18501
|
// @ts-ignore
|
|
18504
18502
|
return y().createElement(gE,{className:"authing-header-tag",style:{color:null==e?void 0:e.color,backgroundColor:null==e?void 0:e.backgroundColor},key:t},e.name)}))),M?y().createElement(vH,{multipleInstance:R,referMultipleState:D,changeModule:v}):y().createElement(y().Fragment,null,E&&y().createElement("div",{className:fe},f?y().createElement(xH,null):y().createElement("div",{className:"g2-view-tabs"},y().createElement(SR,{destroyInactiveTabPane:!0,onChange:function(e){var t;O(e),vC.destroy(),null===(t=null==g?void 0:g.onLoginTabChange)||void 0===t||t.call(g,e)},activeKey:T},null==je?void 0:je.flat())),y().createElement("div",{className:"g2-tips-line"},!ne&&!f&&y().createElement("div",null,y().createElement(hj,{type:"link",className:"link-like forget-password-link",onClick:function(){return null==v?void 0:v(ML.FORGET_PWD,{})}},x("login.forgetPwd")),($>=2||W)&&y().createElement("span",{style:{margin:"0 4px",color:"#EAEBEE"}},"丨")),f&&y().createElement(hj,{type:"link",onClick:function(){null==v||v(ML.LOGIN)}},x("common.backLoginPage")),($>=2||W)&&y().createElement(dv,{title:x("common.feedback")},y().createElement("div",{className:"touch-tip question-feedback",onClick:function(){return null==v?void 0:v(ML.ANY_QUESTIONS,{identify:K.current[T]})}},y().createElement(YD,{type:"authing-a-question-line1",style:{fontSize:16}}))),!re&&y().createElement("span",{className:"go-to-register"},y().createElement(hj,{type:"link",className:"link-like register-link",onClick:function(){return null==v?void 0:v(ML.REGISTER,{})}},x("common.registerImmediate"))))),k&&y().createElement("div",{className:"g2-view-tabs ".concat(pe," ").concat(oe&&"hidden")},y().createElement(SR,{destroyInactiveTabPane:!0,defaultActiveKey:ie,onChange:function(e){var t;vC.destroy(),null===(t=null==g?void 0:g.onLoginTabChange)||void 0===t||t.call(g,e)}},qe))),y().createElement("div",{className:"g2-social-login"},y().createElement(sH,{appId:m,config:h,multipleInstance:R,
|
|
18505
18503
|
// onLogin={onLogin}
|
|
18506
|
-
onLoginSuccess:ae,onLoginFailed:ce,socialConnectionObjs:ge,enterpriseConnectionObjs:ye})))),y().createElement(CL,{langRange:null==h?void 0:h.langRange,onLangChange:null==g?void 0:g.onLangChange}))},mG=function(){return mG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mG.apply(this,arguments)},vG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},gG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.VerifyEmail="verify-email",e.VerifySms="verify-sms",e.VerifyTotp="verify-totp",e.VerifyFace="verify-face",e.AssociateFace="associate-face"}(jW||(jW={}));var yG=function(e,t){return vG(void 0,void 0,void 0,(function(){return gG(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,
|
|
18504
|
+
onLoginSuccess:ae,onLoginFailed:ce,socialConnectionObjs:ge,enterpriseConnectionObjs:ye})))),y().createElement(CL,{langRange:null==h?void 0:h.langRange,onLangChange:null==g?void 0:g.onLangChange}))},mG=function(){return mG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mG.apply(this,arguments)},vG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},gG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.VerifyEmail="verify-email",e.VerifySms="verify-sms",e.VerifyTotp="verify-totp",e.VerifyFace="verify-face",e.AssociateFace="associate-face"}(jW||(jW={}));var yG=function(e,t){return vG(void 0,void 0,void 0,(function(){return gG(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(e,mG({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},bG=function(){var e,t=pL();return(e={})[jW.VerifyEmail]=function(e){return t?yG(jW.VerifyEmail,e):function(e){return vG(void 0,void 0,void 0,(function(){var t,n,r;return gG(this,(function(o){switch(o.label){case 0:return t=e.email,n=e.code,r=e.mfaToken,[4/*yield*/,(0,nQ().post)("/api/v2/applications/mfa/email/verify",{email:t,code:n},{headers:{authorization:"Bearer ".concat(r)}})];case 1:return[2/*return*/,o.sent()]}}))}))}(e)},e[jW.VerifySms]=function(e){return t?yG(jW.VerifySms,e):function(e){return vG(void 0,void 0,void 0,(function(){var t,n,r,o;return gG(this,(function(i){switch(i.label){case 0:return t=e.phone,n=e.code,r=e.mfaToken,o=e.phoneCountryCode,[4/*yield*/,(0,nQ().post)("/api/v2/applications/mfa/sms/verify",{phone:t,code:n,phoneCountryCode:o},{headers:{authorization:"Bearer ".concat(r)}})];case 1:return[2/*return*/,i.sent()]}}))}))}(e)},e[jW.VerifyTotp]=function(e){return t?yG(jW.VerifyTotp,e):function(e){return vG(void 0,void 0,void 0,(function(){var t,n;return gG(this,(function(r){switch(r.label){case 0:return t=e.totp,n=e.mfaToken,[4/*yield*/,(0,nQ().post)("/api/v2/applications/mfa/totp/verify",{totp:t},{headers:{authorization:"Bearer ".concat(n)}})];case 1:return[2/*return*/,r.sent()]}}))}))}(e)},e[jW.VerifyFace]=function(e){return t?yG(jW.VerifyFace,e):function(e){return vG(void 0,void 0,void 0,(function(){var t,n;return gG(this,(function(r){switch(r.label){case 0:return t=e.photo,n=e.mfaToken,[4/*yield*/,(0,nQ().post)("/api/v2/applications/mfa/face/verify",{photo:t},{headers:{authorization:"Bearer ".concat(n)}})];case 1:return[2/*return*/,r.sent()]}}))}))}(e)},e[jW.AssociateFace]=function(e){return t?yG(jW.AssociateFace,e):function(e){return vG(void 0,void 0,void 0,(function(){var t,n,r,o;return gG(this,(function(i){switch(i.label){case 0:return t=e.photoA,n=e.photoB,r=e.isExternalPhoto,o=e.mfaToken,[4/*yield*/,(0,nQ().post)("/api/v2/mfa/face/associate",{photoA:t,photoB:n,isExternalPhoto:r},{headers:{authorization:"Bearer ".concat(o)}})];case 1:return[2/*return*/,i.sent()]}}))}))}(e)},e};
|
|
18507
18505
|
/* harmony default export */const wG=function(e){(0,g.useEffect)(e,[])};// CONCATENATED MODULE: ./src/MFA/core/email.tsx
|
|
18508
18506
|
var CG,EG,kG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},SG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},xG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},PG=y().useRef,_G=y().useState,TG=function(e){e.mfaToken;var t=e.onBind,n=(e.config,PG(null)),r=Pu().t,o=xG(sT.useForm(),1)[0];return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},r("common.mfaCertification")),y().createElement("p",{className:"authing-g2-mfa-tips"},r("common.bindEmailDoc")),y().createElement(sT,{form:o,onSubmitCapture:function(){return n.current.onSpin(!0)},onFinish:function(e){var r=e.email;return kG(void 0,void 0,void 0,(function(){var e,i;return SG(this,(function(a){switch(a.label){case 0:return[4/*yield*/,o.validateFields()];case 1:a.sent(),null===(i=n.current)||void 0===i||i.onSpin(!1);try{t(r)}catch(t){e=JSON.parse(null==t?void 0:t.message),n.current.onError(),vC.error(e.message)}return[2/*return*/]}}))}))},onFinishFailed:function(){return n.current.onError()}},y().createElement(UB.Email,{className:"authing-g2-input-form",name:"email",form:o,
|
|
18509
18507
|
// checkRepeat={true}
|
|
18510
|
-
required:!0},y().createElement(rO,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:r("login.inputEmail"),prefix:y().createElement(YD,{type:"authing-a-mail-line3",style:{color:"#878A95"}})})),y().createElement(Cj,{text:r("common.sure"),ref:n})))},OG=function(e){var t=e.email,n=e.mfaToken,r=e.onVerify,o=e.sendCodeRef,i=e.codeLength,a=
|
|
18508
|
+
required:!0},y().createElement(rO,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:r("login.inputEmail"),prefix:y().createElement(YD,{type:"authing-a-mail-line3",style:{color:"#878A95"}})})),y().createElement(Cj,{text:r("common.sure"),ref:n})))},OG=function(e){var t=e.email,n=e.mfaToken,r=e.onVerify,o=e.sendCodeRef,i=e.codeLength,a=nQ().post,s=bG()[jW.VerifyEmail],c=PG(null),l=Pu().t,u=xG(sT.useForm(),1)[0],d=xG(_G(!1),2),f=d[0],p=d[1];wG((function(){var e;null===(e=o.current)||void 0===e||e.click()}));var h=function(e){return kG(void 0,void 0,void 0,(function(){var e,o,i,a,l,d,f,p,h;return SG(this,(function(m){switch(m.label){case 0:return null===(f=c.current)||void 0===f||f.onSpin(!0),e=u.getFieldValue("mfaCode"),o={mfaToken:n,email:t,code:e.join("")},[4/*yield*/,s(o)];case 1:return i=m.sent(),a=i.isFlowEnd,l=i.data,d=i.onGuardHandling,null===(p=c.current)||void 0===p||p.onSpin(!1),a?r(200,l):(null===(h=c.current)||void 0===h||h.onError(),null==d||d()),[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},l("common.mfaCertification")),y().createElement("p",{className:"authing-g2-mfa-tips"},f?"".concat(l("login.verifyCodeSended")," ").concat(TQ(t)):l("common.emailMfaCheck")),y().createElement(sT,{form:u,onFinish:h,onFinishFailed:function(){var e;return null===(e=c.current)||void 0===e?void 0:e.onError()}},y().createElement($j,{codeLength:i,ruleKeyword:l("common.captchaCode")},y().createElement(Xj,{length:i,onFinish:h})),y().createElement(yq,{btnRef:o,setSent:p,beforeSend:function(){return kG(void 0,void 0,void 0,(function(){var e,n,r,o,i;return SG(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4/*yield*/,a("/api/v2/email/send",{email:t,scene:Nc.MFA_VERIFY_CODE})];case 1:return e=s.sent(),n=e.code,r=e.message,2080===e.apiCode?(
|
|
18511
18509
|
// 一分钟只能发一次邮箱验证码的提示信息,特殊处理
|
|
18512
|
-
vC.error(r),[2/*return*/,!1]):200===n?(p(!0),[2/*return*/,!0]):(vC.error(l("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:return"ECONNABORTED"===(o=s.sent()).code?(vC.error(l("login.sendCodeTimeout")),[2/*return*/,!1]):(i=JSON.parse(o.message),vC.error(i.message),[2/*return*/,!1]);case 3:return[2/*return*/]}}))}))},type:"link"}),y().createElement(Cj,{text:l("common.sure"),ref:c,className:"g2-mfa-submit-button"})))},NG=function(e){var t=e.email,n=e.mfaToken,r=e.mfaLogin,o=e.config,i=xG(_G(t),2),a=i[0],s=i[1],c=PG(null),l=oL(),u=null==l?void 0:l.verifyCodeLength;return y().createElement(y().Fragment,null,a?y().createElement(OG,{mfaToken:n,email:a,onVerify:function(e,t){r(e,t)},sendCodeRef:c,codeLength:null!=u?u:4}):y().createElement(TG,{config:o,mfaToken:n,onBind:function(e){var t;s(e),null===(t=c.current)||void 0===t||t.click()}}))},IG=function(){return IG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},IG.apply(this,arguments)},AG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},RG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},MG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},DG=y().useCallback,LG=y().useMemo,FG=y().useRef,jG=y().useState,BG=function(e){e.mfaToken;var t=e.onBind,n=(e.config,e.areaCode),r=e.setAreaCode,o=e.isInternationSms,i=FG(null),a=Pu().t,s=MG(sT.useForm(),1)[0],c=DG((function(e){return o?y().createElement(
|
|
18510
|
+
vC.error(r),[2/*return*/,!1]):200===n?(p(!0),[2/*return*/,!0]):(vC.error(l("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:return"ECONNABORTED"===(o=s.sent()).code?(vC.error(l("login.sendCodeTimeout")),[2/*return*/,!1]):(i=JSON.parse(o.message),vC.error(i.message),[2/*return*/,!1]);case 3:return[2/*return*/]}}))}))},type:"link"}),y().createElement(Cj,{text:l("common.sure"),ref:c,className:"g2-mfa-submit-button"})))},NG=function(e){var t=e.email,n=e.mfaToken,r=e.mfaLogin,o=e.config,i=xG(_G(t),2),a=i[0],s=i[1],c=PG(null),l=oL(),u=null==l?void 0:l.verifyCodeLength;return y().createElement(y().Fragment,null,a?y().createElement(OG,{mfaToken:n,email:a,onVerify:function(e,t){r(e,t)},sendCodeRef:c,codeLength:null!=u?u:4}):y().createElement(TG,{config:o,mfaToken:n,onBind:function(e){var t;s(e),null===(t=c.current)||void 0===t||t.click()}}))},IG=function(){return IG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},IG.apply(this,arguments)},AG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},RG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},MG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},DG=y().useCallback,LG=y().useMemo,FG=y().useRef,jG=y().useState,BG=function(e){e.mfaToken;var t=e.onBind,n=(e.config,e.areaCode),r=e.setAreaCode,o=e.isInternationSms,i=FG(null),a=Pu().t,s=MG(sT.useForm(),1)[0],c=DG((function(e){return o?y().createElement(TU,IG({},e,{className:"authing-g2-input",size:"large",areaCode:n,onAreaCodeChange:function(e){r(e),s.getFieldValue(["phone"])&&s.validateFields(["phone"])},maxLength:20})):y().createElement(xq,IG({},e,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:a("login.inputPhone"),prefix:y().createElement(YD,{type:"authing-a-smartphone-line1",style:{color:"#878A95"}}),maxLength:20}))}),[n,s,o,r,a]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"authing-g2-mfa-title"},a("common.mfaCertification")),y().createElement("p",{className:"authing-g2-mfa-tips"},a("login.bindPhoneInfo")),y().createElement(sT,{form:s,onSubmitCapture:function(){return i.current.onSpin(!0)},onFinish:function(e){var n=e.phone;return AG(void 0,void 0,void 0,(function(){var e,r;return RG(this,(function(o){switch(o.label){case 0:return[4/*yield*/,s.validateFields()];case 1:o.sent(),null===(e=i.current)||void 0===e||e.onSpin(!1);try{t(n)}catch(e){
|
|
18513
18511
|
// do nothing
|
|
18514
18512
|
null===(r=i.current)||void 0===r||r.onError()}return[2/*return*/]}}))}))},onFinishFailed:function(){return i.current.onError()}},y().createElement(UB.Phone,{className:o?"authing-g2-input-form remove-padding":"authing-g2-input-form",name:"phone",form:s,
|
|
18515
18513
|
// checkRepeat={true}
|
|
18516
|
-
required:!0,areaCode:n},y().createElement(c,null)),y().createElement(Cj,{text:a("common.sure"),ref:i})))},qG=function(e){var t=e.mfaToken,n=e.phone,r=e.userPhone,o=e.onVerify,i=e.sendCodeRef,a=e.codeLength,s=void 0===a?4:a,c=e.areaCode,l=e.phoneCountryCode,u=e.isInternationSms,d=WL(),f=FG(null),p=Pu().t,h=MG(sT.useForm(),1)[0],m=MG(jG(!1),2),v=m[0],g=m[1],b=uj(u,n,c),w=b.phoneNumber,C=b.countryCode;wG((function(){var e;null===(e=i.current)||void 0===e||e.click()}));var E=bG()[jW.VerifySms],k=function(e){return AG(void 0,void 0,void 0,(function(){var e,r,i,a,s,c,u,d;return RG(this,(function(p){switch(p.label){case 0:return null===(u=f.current)||void 0===u||u.onSpin(!0),e=h.getFieldValue("mfaCode"),r={mfaToken:t,phone:n,code:e.join(""),phoneCountryCode:l||C},[4/*yield*/,E(r)];case 1:return i=p.sent(),a=i.isFlowEnd,s=i.data,c=i.onGuardHandling,null===(d=f.current)||void 0===d||d.onSpin(!1),a?o(200,s):(f.current.onError(),null==c||c()),[2/*return*/]}}))}))},S=LG((function(){return v?"".concat(p("login.verifyCodeSended")," ").concat(u?l||C:""," ").concat(
|
|
18514
|
+
required:!0,areaCode:n},y().createElement(c,null)),y().createElement(Cj,{text:a("common.sure"),ref:i})))},qG=function(e){var t=e.mfaToken,n=e.phone,r=e.userPhone,o=e.onVerify,i=e.sendCodeRef,a=e.codeLength,s=void 0===a?4:a,c=e.areaCode,l=e.phoneCountryCode,u=e.isInternationSms,d=WL(),f=FG(null),p=Pu().t,h=MG(sT.useForm(),1)[0],m=MG(jG(!1),2),v=m[0],g=m[1],b=uj(u,n,c),w=b.phoneNumber,C=b.countryCode;wG((function(){var e;null===(e=i.current)||void 0===e||e.click()}));var E=bG()[jW.VerifySms],k=function(e){return AG(void 0,void 0,void 0,(function(){var e,r,i,a,s,c,u,d;return RG(this,(function(p){switch(p.label){case 0:return null===(u=f.current)||void 0===u||u.onSpin(!0),e=h.getFieldValue("mfaCode"),r={mfaToken:t,phone:n,code:e.join(""),phoneCountryCode:l||C},[4/*yield*/,E(r)];case 1:return i=p.sent(),a=i.isFlowEnd,s=i.data,c=i.onGuardHandling,null===(d=f.current)||void 0===d||d.onSpin(!1),a?o(200,s):(f.current.onError(),null==c||c()),[2/*return*/]}}))}))},S=LG((function(){return v?"".concat(p("login.verifyCodeSended")," ").concat(u?l||C:""," ").concat(OQ(n)):p("common.SmsMfaCheck")}),[C,u,n,l,v,p]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"authing-g2-mfa-title"},p("common.mfaCertification")),y().createElement("p",{className:"authing-g2-mfa-tips"},S),y().createElement(sT,{form:h,onFinish:k,onFinishFailed:function(){return f.current.onError()}},y().createElement($j,{codeLength:s,ruleKeyword:p("common.captchaCode")},y().createElement(Xj,{length:s,onFinish:k})),y().createElement(yq,{btnRef:i,beforeSend:function(){return AG(void 0,void 0,void 0,(function(){var e,t;return RG(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4/*yield*/,d.sendSmsCode(r||w,l||C,Ii.SCENE_TYPE_MFA_VERIFY)];case 1:return n.sent(),[2/*return*/,!0];case 2:return"ECONNABORTED"===(e=n.sent()).code?(vC.error(p("login.sendCodeTimeout")),[2/*return*/,!1]):(t=JSON.parse(e.message),vC.error(t.message),[2/*return*/,!1]);case 3:return[2/*return*/]}}))}))},type:"link",setSent:g}),y().createElement(Cj,{text:p("common.sure"),ref:f,className:"g2-mfa-submit-button"})))},UG=function(e){var t,n,r=e.mfaLogin,o=e.config,i=e.initData,a=i.mfaPhone,s=i.mfaToken,c=i.mfaPhoneCountryCode,l=MG(jG(a),2),u=l[0],d=l[1],f=FG(null),p=oL(),h=null==p?void 0:p.verifyCodeLength,m=MG(jG((null===(t=null==p?void 0:p.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),v=m[0],g=m[1],b=Boolean(null===(n=null==p?void 0:p.internationalSmsConfig)||void 0===n?void 0:n.enabled);
|
|
18517
18515
|
// todo 后续改 不用 phone 作为判断模式
|
|
18518
|
-
return y().createElement(y().Fragment,null,u?y().createElement(qG,{mfaToken:s,phone:u,userPhone:a,phoneCountryCode:c,isInternationSms:b,onVerify:function(e,t){r(e,t)},codeLength:null!=h?h:4,sendCodeRef:f,areaCode:v}):y().createElement(BG,{config:o,mfaToken:s,areaCode:v,setAreaCode:g,isInternationSms:b,onBind:function(e){var t;d(e),null===(t=f.current)||void 0===t||t.click()}}))},VG=function(){if(CG)return CG},$G={video:{width:210,height:210}};function zG(){var e=VG();if(e)return e.nets.tinyFaceDetector}!function(e){e.NotAllowedError="NotAllowedError",e.AbortError="AbortError",e.NotReadableError="NotReadableError",e.OverconstrainedError="OverconstrainedError",e.SecurityError="SecurityError"}(EG||(EG={}));var HG,WG,GG,KG=y().createContext(void 0),YG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZG=y().useCallback,XG=y().useContext,eK=y().useEffect,tK=y().useRef,nK=y().useState,rK=function(e){var t,n,r,o=XG(KG),i=
|
|
18516
|
+
return y().createElement(y().Fragment,null,u?y().createElement(qG,{mfaToken:s,phone:u,userPhone:a,phoneCountryCode:c,isInternationSms:b,onVerify:function(e,t){r(e,t)},codeLength:null!=h?h:4,sendCodeRef:f,areaCode:v}):y().createElement(BG,{config:o,mfaToken:s,areaCode:v,setAreaCode:g,isInternationSms:b,onBind:function(e){var t;d(e),null===(t=f.current)||void 0===t||t.click()}}))},VG=function(){if(CG)return CG},$G={video:{width:210,height:210}};function zG(){var e=VG();if(e)return e.nets.tinyFaceDetector}!function(e){e.NotAllowedError="NotAllowedError",e.AbortError="AbortError",e.NotReadableError="NotReadableError",e.OverconstrainedError="OverconstrainedError",e.SecurityError="SecurityError"}(EG||(EG={}));var HG,WG,GG,KG=y().createContext(void 0),YG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},QG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZG=y().useCallback,XG=y().useContext,eK=y().useEffect,tK=y().useRef,nK=y().useState,rK=function(e){var t,n,r,o=XG(KG),i=rQ().postForm,a=Pu().t,s=QG(nK("ready"),2),c=s[0],l=s[1],u=QG(nK(0),2),d=u[0],f=u[1],p=bG(),h=rL().spinChange,m=p[jW.VerifyFace],v=p[jW.AssociateFace],g=tK(null),b=tK(null),w=tK(),C=tK(),E=tK(),k=tK(0),S=oL(),x=null==S?void 0:S.cdnBase,P=function(e){return{offset:7*e,dashStyle:{}}}(d),_=P.offset,T=P.dashStyle,O=null!==(n=null===(t=null==S?void 0:S.mfa)||void 0===t?void 0:t.faceScore)&&void 0!==n?n:.65;
|
|
18519
18517
|
// 预加载数据
|
|
18520
18518
|
eK((function(){if(
|
|
18521
18519
|
// 载入 cdn
|
|
@@ -18548,16 +18546,16 @@ id:"inputVideo",autoPlay:!0,muted:!0,playsInline:!0}),y().createElement("div",{c
|
|
|
18548
18546
|
// 解析成功
|
|
18549
18547
|
if("changeModule"===(null==n?void 0:n.action)){var r=n.module?n.module:ML.ERROR,a=n.initData?n.initData:{};return function(e){return null==o?void 0:o(r,yK(yK({},e),{init:a}))}}return"insideFix"===(null==n?void 0:n.action)?function(){}:"message"===(null==n?void 0:n.action)?function(e){e.message?vC.error(e.message):vC.error(t)}:function(){}},b=wK((function(){return s===Pj.FACE&&"check"===u?y().createElement(lB,{onBack:function(){var e;c(n.applicationMfa.find((function(e){return e.mfaPolicy===Pj.FACE}))?Pj.FACE:null===(e=n.applicationMfa)||void 0===e?void 0:e.sort((function(e,t){return e.sort-t.sort}))[0].mfaPolicy),h(!0),d("login")}},v("common.backToVerify")):y().createElement(cB,null)}),[s,n.applicationMfa,u,v]);
|
|
18550
18548
|
// 返回验证页和返回登录页 需要获取内部 face 模式下的状态
|
|
18551
|
-
return y().createElement(KG.Provider,{value:{setMfaBackState:d,mfaBackState:u}},y().createElement("div",{className:"g2-view-container g2-view-mfa"},b,y().createElement("div",{className:"g2-mfa-content"},EK[s]({config:r,initData:n,changeModule:o,mfaLogin:function(e,t,n){var r=null==g?void 0:g(e,n);t||(t={}),t.__message=n,null==r||r(t)},setShowMethods:h})),p&&y().createElement(vK,{method:s,onChangeMethod:function(e){c(e)}}),y().createElement(CL,{langRange:null==r?void 0:r.langRange,onLangChange:null==i?void 0:i.onLangChange})))},SK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},xK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},PK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_K=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},TK=y().useRef,OK=y().useState,NK=function(e){var t=Pu().t,n=cL(),r={0:[t("common.problem.noVerifyTip.tip"),t("common.problem.noVerifyTip.type1"),t("common.problem.noVerifyTip.type2"),t("common.problem.noVerifyTip.type3")],1:[t("common.problem.noLoginTips"),t("common.problem.noLoginTip.type1"),t("common.problem.noLoginTip.type2")],2:[t("common.problem.noRegisterTip.tip"),t("common.problem.noRegisterTip.type1"),t("common.problem.noRegisterTip.type2"),t("common.problem.noRegisterTip.type3")],3:[t("common.problem.noAccountTip.tip"),t("common.problem.noAccountTip.type1"),t("common.problem.noAccountTip.type2")],4:[t("common.problem.noResetPassTip.tip"),t("common.problem.noResetPassTip.type1"),t("common.problem.noResetPassTip.type2")],5:[t("common.problem.lockedTips")],6:[]},o=[{label:t("common.problem.noVerify"),value:0},{label:t("common.problem.noLogin"),value:1},{label:t("common.problem.noRegister"),value:2},{label:t("common.problem.noAccount"),value:3},{label:t("common.problem.noResetPass"),value:4},{label:t("common.problem.locked"),value:5},{label:t("common.problem.other"),value:6}],i=PK(sT.useForm(),1)[0],a=
|
|
18549
|
+
return y().createElement(KG.Provider,{value:{setMfaBackState:d,mfaBackState:u}},y().createElement("div",{className:"g2-view-container g2-view-mfa"},b,y().createElement("div",{className:"g2-mfa-content"},EK[s]({config:r,initData:n,changeModule:o,mfaLogin:function(e,t,n){var r=null==g?void 0:g(e,n);t||(t={}),t.__message=n,null==r||r(t)},setShowMethods:h})),p&&y().createElement(vK,{method:s,onChangeMethod:function(e){c(e)}}),y().createElement(CL,{langRange:null==r?void 0:r.langRange,onLangChange:null==i?void 0:i.onLangChange})))},SK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},xK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},PK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_K=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},TK=y().useRef,OK=y().useState,NK=function(e){var t=Pu().t,n=cL(),r={0:[t("common.problem.noVerifyTip.tip"),t("common.problem.noVerifyTip.type1"),t("common.problem.noVerifyTip.type2"),t("common.problem.noVerifyTip.type3")],1:[t("common.problem.noLoginTips"),t("common.problem.noLoginTip.type1"),t("common.problem.noLoginTip.type2")],2:[t("common.problem.noRegisterTip.tip"),t("common.problem.noRegisterTip.type1"),t("common.problem.noRegisterTip.type2"),t("common.problem.noRegisterTip.type3")],3:[t("common.problem.noAccountTip.tip"),t("common.problem.noAccountTip.type1"),t("common.problem.noAccountTip.type2")],4:[t("common.problem.noResetPassTip.tip"),t("common.problem.noResetPassTip.type1"),t("common.problem.noResetPassTip.type2")],5:[t("common.problem.lockedTips")],6:[]},o=[{label:t("common.problem.noVerify"),value:0},{label:t("common.problem.noLogin"),value:1},{label:t("common.problem.noRegister"),value:2},{label:t("common.problem.noAccount"),value:3},{label:t("common.problem.noResetPass"),value:4},{label:t("common.problem.locked"),value:5},{label:t("common.problem.other"),value:6}],i=PK(sT.useForm(),1)[0],a=rQ().post,s=PK(OK([]),2),c=s[0],l=s[1],u=PK(OK(!1),2),d=u[0],f=u[1],p=PK(OK(),2),h=p[0],m=p[1],v=PK(OK([]),2),g=v[0],b=v[1],w=PK(OK(0),2),C=w[0],E=w[1],k=TK(null),S=r[C];return y().createElement("div",{className:"authing-g2-describe-questions authing-g2-form-required-item-icon-after"},y().createElement(sT,{name:"resetPassword",layout:"vertical",form:i,onFinish:function(t){var n;null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!0);var r={type:C,description:t.description,phone:t.identify,images:c,appId:e.appId};
|
|
18552
18550
|
// TODO 暂不支持国际化短信参数
|
|
18553
|
-
a("/api/v2/feedback",r).then((function(t){var n,r;200===t.code?(null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!1),e.onSuccess()):(null===(r=null==k?void 0:k.current)||void 0===r||r.onSpin(!1),vC.error(t.message))}))},onFinishFailed:function(){var e;null===(e=null==k?void 0:k.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"identify",label:t("common.problem.form.phone"),validateFirst:!0,initialValue:null==n?void 0:n.identify,rules:_K(_K([],PK(
|
|
18551
|
+
a("/api/v2/feedback",r).then((function(t){var n,r;200===t.code?(null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!1),e.onSuccess()):(null===(r=null==k?void 0:k.current)||void 0===r||r.onSpin(!1),vC.error(t.message))}))},onFinishFailed:function(){var e;null===(e=null==k?void 0:k.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"identify",label:t("common.problem.form.phone"),validateFirst:!0,initialValue:null==n?void 0:n.identify,rules:_K(_K([],PK(pQ(t("common.problem.form.phone"))),!1),[{validator:function(e,n){return SK(void 0,void 0,void 0,(function(){return xK(this,(function(e){if(!n)return[2/*return*/];if(fQ("email",n)||fQ("phone",n))return[2/*return*/];throw new Error(t("login.inputCorrectPhoneOrEmail"))}))}))}}],!1)},y().createElement(rO,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:t("login.inputPhoneOrEmail"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form ",label:t("common.problem.form.question"),name:"questionPicker",initialValue:C},y().createElement(cI,{className:"authing-g2-select",onChange:function(e){E(e)}},null==o?void 0:o.map((function(e){var t=e.value,n=e.label;
|
|
18554
18552
|
// @ts-ignore
|
|
18555
18553
|
return y().createElement(cI.Option,{key:t,value:t,className:"authing-g2-question-option ".concat(C===t?"authing-g2-question-option-active":"")},n)})))),y().createElement("div",{className:"authing-g2-input-form"},null==S?void 0:S.map((function(e,t){return y().createElement("div",{key:t},e)}))),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"description",label:t("common.problem.form.questionDescript")},y().createElement(rO.TextArea,{className:"authing-g2-questions-textarea",maxLength:200,showCount:!0,rows:4,style:{marginBottom:10}})),y().createElement("div",{className:"authing-g2-input-form"},y().createElement("div",{className:"label-title"},t("common.problem.form.questionClip")),y().createElement("div",{className:"g2-questions"},y().createElement(lD,{action:"".concat(e.host,"/api/v2/upload?folder=photos"),listType:"picture-card",accept:"image/png, image/jpeg, image/jpg",className:"authing-g2-questions-upload-self",fileList:g,onPreview:function(e){return SK(void 0,void 0,void 0,(function(){var t;return xK(this,(function(n){switch(n.label){case 0:return"error"===e.status||e.response?[4/*yield*/,new Promise((function(t){var n=new FileReader;n.readAsDataURL(e.originFileObj),n.onload=function(){return t(n.result)}}))]:[3/*break*/,2];case 1:return t=n.sent(),[3/*break*/,3];case 2:t=e.response.data.url,n.label=3;case 3:
|
|
18556
18554
|
// setPreviewImage(file.url);
|
|
18557
18555
|
// file 没有 url 属性,需要改成下面的用法
|
|
18558
18556
|
// let url = file.response.data.url
|
|
18559
|
-
return m(t),f(!0),[2/*return*/]}}))}))},onChange:function(e){b(e.fileList);var t=e.fileList.map((function(e){var t=e.response;return null==t?void 0:t.data.url}));l(t)},beforeUpload:function(e){return!!["image/png","image/jpeg","image/jpg"].includes(e.type)||Promise.reject(e)},itemRender:function(e,t){return y().createElement(y().Fragment,null,"uploading"===t.status?y().createElement("div",{style:{padding:6,borderRadius:2,border:"1px solid #d9d9d9"}},y().createElement(DA,{showInfo:!1,style:{margin:1},width:40,type:"circle",percent:t.percent})):e)}},g.length<4&&y().createElement(VD,null)))),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:t("common.problem.form.submit"),ref:k}))),y().createElement(uA,{visible:d,title:null,footer:null,onCancel:function(){return f(!1)}},y().createElement("img",{alt:"example",style:{width:"100%"},src:h})))},IK=function(e){var t=Pu().t,n=aL(),r=dL().changeModule,o=fL();return fB(),y().createElement("div",{className:"g2-view-container g2-need-help"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},t("common.problem.title"))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(NK,{appId:n,host:o.host,onSuccess:function(){null==r||r(ML.SUBMIT_SUCCESS)}})),y().createElement("div",{className:"g2-tips-line "},y().createElement("div",{className:"back-to-login"},y().createElement("span",{className:"gray"},t("common.noQuestions")),y().createElement("span",{className:"link-like",onClick:function(){return null==r?void 0:r(ML.LOGIN)}},t("common.goToLogin")))))},AK=function(){return AK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},AK.apply(this,arguments)},RK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},MK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function DK(e,t){return RK(this,void 0,void 0,(function(){return MK(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,
|
|
18560
|
-
var LK,FK,jK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},UK=y().useRef,VK=hM.Paragraph,$K=function(e){var t=e.secret,n=e.onBind,r=Pu().t,o=qK(sT.useForm(),1)[0],i=pL(),a=UK(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},r("common.useRecoverCode")),y().createElement("p",{className:"authing-g2-mfa-tips"},r("common.totpGenerateCode")),y().createElement("div",{className:"g2-mfa-bindTotp-copySecret"},y().createElement(VK,{copyable:!0},t)),y().createElement(sT,{form:o,onFinish:function(){return jK(void 0,void 0,void 0,(function(){var e,t,r,s,c,l,u,d,f;return BK(this,(function(p){switch(p.label){case 0:return null===(c=a.current)||void 0===c||c.onSpin(!0),i?[4/*yield*/,DK(GG.ConfirmTotpRecoveryCode,{})]:[3/*break*/,2];case 1:return e=p.sent(),t=e.isFlowEnd,r=e.data,s=e.onGuardHandling,null===(l=a.current)||void 0===l||l.onSpin(!1),t?n(r):(null===(u=a.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,6];case 2:return p.trys.push([2,4,5,6]),[4/*yield*/,o.validateFields()];case 3:return p.sent(),n(),[3/*break*/,6];case 4:return p.sent(),null===(d=a.current)||void 0===d||d.onError(),[3/*break*/,6];case 5:return null===(f=a.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 6:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.onError()}},y().createElement(sT.Item,{className:"authing-g2-input-form g2-mfa-totp-recoveryCode-input",name:"remember",rules:[{validator:function(e,t){return t?Promise.resolve():Promise.reject(r("common.pleaseRecordKey"))}}],valuePropName:"checked"},y().createElement(ew,{className:"g2-mfa-bindTotp-secretSave"},r("login.rememberedSecret"))),y().createElement(Cj,{text:r("common.confirm"),ref:a})))},zK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},HK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},WK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},GK=y().useRef,KK=function(e){var t=e.mfaToken,n=e.onSubmit,r=Pu().t,o=pL(),i=WK(sT.useForm(),1)[0],a=
|
|
18557
|
+
return m(t),f(!0),[2/*return*/]}}))}))},onChange:function(e){b(e.fileList);var t=e.fileList.map((function(e){var t=e.response;return null==t?void 0:t.data.url}));l(t)},beforeUpload:function(e){return!!["image/png","image/jpeg","image/jpg"].includes(e.type)||Promise.reject(e)},itemRender:function(e,t){return y().createElement(y().Fragment,null,"uploading"===t.status?y().createElement("div",{style:{padding:6,borderRadius:2,border:"1px solid #d9d9d9"}},y().createElement(DA,{showInfo:!1,style:{margin:1},width:40,type:"circle",percent:t.percent})):e)}},g.length<4&&y().createElement(VD,null)))),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:t("common.problem.form.submit"),ref:k}))),y().createElement(uA,{visible:d,title:null,footer:null,onCancel:function(){return f(!1)}},y().createElement("img",{alt:"example",style:{width:"100%"},src:h})))},IK=function(e){var t=Pu().t,n=aL(),r=dL().changeModule,o=fL();return fB(),y().createElement("div",{className:"g2-view-container g2-need-help"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},t("common.problem.title"))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(NK,{appId:n,host:o.host,onSuccess:function(){null==r||r(ML.SUBMIT_SUCCESS)}})),y().createElement("div",{className:"g2-tips-line "},y().createElement("div",{className:"back-to-login"},y().createElement("span",{className:"gray"},t("common.noQuestions")),y().createElement("span",{className:"link-like",onClick:function(){return null==r?void 0:r(ML.LOGIN)}},t("common.goToLogin")))))},AK=function(){return AK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},AK.apply(this,arguments)},RK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},MK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function DK(e,t){return RK(this,void 0,void 0,(function(){return MK(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,nQ().authFlow)(e,AK({},t))];case 1:return[2/*return*/,n.sent()]}}))}))}!function(e){e.RecoveryTotp="recovery-totp",e.ConfirmTotpRecoveryCode="confirm-totp-recovery-code"}(GG||(GG={}));// CONCATENATED MODULE: ./src/RecoveryCode/core/saveCode.tsx
|
|
18558
|
+
var LK,FK,jK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},UK=y().useRef,VK=hM.Paragraph,$K=function(e){var t=e.secret,n=e.onBind,r=Pu().t,o=qK(sT.useForm(),1)[0],i=pL(),a=UK(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},r("common.useRecoverCode")),y().createElement("p",{className:"authing-g2-mfa-tips"},r("common.totpGenerateCode")),y().createElement("div",{className:"g2-mfa-bindTotp-copySecret"},y().createElement(VK,{copyable:!0},t)),y().createElement(sT,{form:o,onFinish:function(){return jK(void 0,void 0,void 0,(function(){var e,t,r,s,c,l,u,d,f;return BK(this,(function(p){switch(p.label){case 0:return null===(c=a.current)||void 0===c||c.onSpin(!0),i?[4/*yield*/,DK(GG.ConfirmTotpRecoveryCode,{})]:[3/*break*/,2];case 1:return e=p.sent(),t=e.isFlowEnd,r=e.data,s=e.onGuardHandling,null===(l=a.current)||void 0===l||l.onSpin(!1),t?n(r):(null===(u=a.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,6];case 2:return p.trys.push([2,4,5,6]),[4/*yield*/,o.validateFields()];case 3:return p.sent(),n(),[3/*break*/,6];case 4:return p.sent(),null===(d=a.current)||void 0===d||d.onError(),[3/*break*/,6];case 5:return null===(f=a.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 6:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.onError()}},y().createElement(sT.Item,{className:"authing-g2-input-form g2-mfa-totp-recoveryCode-input",name:"remember",rules:[{validator:function(e,t){return t?Promise.resolve():Promise.reject(r("common.pleaseRecordKey"))}}],valuePropName:"checked"},y().createElement(ew,{className:"g2-mfa-bindTotp-secretSave"},r("login.rememberedSecret"))),y().createElement(Cj,{text:r("common.confirm"),ref:a})))},zK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},HK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},WK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},GK=y().useRef,KK=function(e){var t=e.mfaToken,n=e.onSubmit,r=Pu().t,o=pL(),i=WK(sT.useForm(),1)[0],a=rQ().post,s=GK(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},r("common.useRecoverCode")),y().createElement("p",{className:"authing-g2-mfa-tips"},r("login.mfaAfterReset")),y().createElement(sT,{form:i,onFinish:function(e){return zK(void 0,void 0,void 0,(function(){var r,c,l,u,d,f,p,h,m,v,g,y;return HK(this,(function(b){switch(b.label){case 0:return null===(f=s.current)||void 0===f||f.onSpin(!0),o?[4/*yield*/,DK(GG.RecoveryTotp,{recoveryCode:e.recoveryCode})]:[3/*break*/,2];case 1:return r=b.sent(),c=r.data,l=r.onGuardHandling,u=r.statusCode,null===(p=s.current)||void 0===p||p.onSpin(!1),200===u?n(c.recoveryCode):(null===(h=s.current)||void 0===h||h.onError(),null==l||l()),[3/*break*/,6];case 2:return b.trys.push([2,4,5,6]),[4/*yield*/,a("/api/v2/mfa/totp/recovery",{recoveryCode:i.getFieldValue("recoveryCode")},{headers:{authorization:t}})];case 3:return 200===(d=b.sent()).code?
|
|
18561
18559
|
// @ts-ignore
|
|
18562
18560
|
n(d.recoveryCode,d.data):(
|
|
18563
18561
|
// message.error(res.message)
|
|
@@ -18567,7 +18565,7 @@ null===(g=s.current)||void 0===g||g.onError(),[3/*break*/,6];case 5:return null=
|
|
|
18567
18565
|
// 开关控制 如果没有 register 就不开启了
|
|
18568
18566
|
return!!oL().complateFiledsPlace.includes("register")&&(
|
|
18569
18567
|
// 排除掉已有的字段
|
|
18570
|
-
!(!Boolean(hd()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},rY=function(){return rY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rY.apply(this,arguments)},oY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},aY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sY=y().useRef,cY=y().useState,lY=y().useCallback,uY=y().useMemo,dY=function(e){var t,n,r,o=e.label,i=e.method,a=e.onRegisterSuccess,s=e.onRegisterFailed,c=e.onBeforeRegister,l=e.agreements,u=e.registeContext,d=e.publicConfig,f=Pu().t,p=sY(null),h=lj().isPhoneMedia,m=WL(),v=aY(sT.useForm(),1)[0],g=fL(),b=nY((i||"email").split("-")[0]),w=dL().changeModule,C=iL().post,E=aY(cY(!1),2),k=E[0],S=E[1],x=aY(cY(!1),2),P=x[0],_=x[1],T=aY(cY((null===(t=null==d?void 0:d.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),O=T[0],N=T[1],I=(null===(n=null==d?void 0:d.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,A=GB(),R=A.getPassWordUnsafeText,M=A.setPasswordErrorTextShow,D=aY(ej((function(e){return oY(void 0,void 0,void 0,(function(){var t,n,r,o,d,f,h,y,E,S,x,P,T,N,A,R,D,L,F,j;return iY(this,(function(B){switch(B.label){case 0:if(null===(L=p.current)||void 0===L||L.onSpin(!0),!c)return[3/*break*/,4];B.label=1;case 1:return B.trys.push([1,3,,4]),[4/*yield*/,c({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},m)];case 2:return B.sent()?[3/*break*/,4]:(null===(F=p.current)||void 0===F||F.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=B.sent())?vC.error(t):vC.error(null==t?void 0:t.message),null===(j=p.current)||void 0===j||j.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,v.validateFields()];case 5:return B.sent(),_(!0),(null==l?void 0:l.length)&&!k?(p.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,m.options.encryptFunction)(r,g.publicKey)]);case 6:return d=B.sent(),f=null!=u?u:{},"phone-password"===i&&(y=uj(I,o,O),E=y.phoneNumber,S=y.countryCode,o=E,h=S),x={account:o,email:n,password:d,phoneCountryCode:h,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:
|
|
18568
|
+
!(!Boolean(hd()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},rY=function(){return rY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rY.apply(this,arguments)},oY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},aY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sY=y().useRef,cY=y().useState,lY=y().useCallback,uY=y().useMemo,dY=function(e){var t,n,r,o=e.label,i=e.method,a=e.onRegisterSuccess,s=e.onRegisterFailed,c=e.onBeforeRegister,l=e.agreements,u=e.registeContext,d=e.publicConfig,f=Pu().t,p=sY(null),h=lj().isPhoneMedia,m=WL(),v=aY(sT.useForm(),1)[0],g=fL(),b=nY((i||"email").split("-")[0]),w=dL().changeModule,C=iL().post,E=aY(cY(!1),2),k=E[0],S=E[1],x=aY(cY(!1),2),P=x[0],_=x[1],T=aY(cY((null===(t=null==d?void 0:d.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),O=T[0],N=T[1],I=(null===(n=null==d?void 0:d.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,A=GB(),R=A.getPassWordUnsafeText,M=A.setPasswordErrorTextShow,D=aY(ej((function(e){return oY(void 0,void 0,void 0,(function(){var t,n,r,o,d,f,h,y,E,S,x,P,T,N,A,R,D,L,F,j;return iY(this,(function(B){switch(B.label){case 0:if(null===(L=p.current)||void 0===L||L.onSpin(!0),!c)return[3/*break*/,4];B.label=1;case 1:return B.trys.push([1,3,,4]),[4/*yield*/,c({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},m)];case 2:return B.sent()?[3/*break*/,4]:(null===(F=p.current)||void 0===F||F.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=B.sent())?vC.error(t):vC.error(null==t?void 0:t.message),null===(j=p.current)||void 0===j||j.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,v.validateFields()];case 5:return B.sent(),_(!0),(null==l?void 0:l.length)&&!k?(p.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,m.options.encryptFunction)(r,g.publicKey)]);case 6:return d=B.sent(),f=null!=u?u:{},"phone-password"===i&&(y=uj(I,o,O),E=y.phoneNumber,S=y.countryCode,o=E,h=S),x={account:o,email:n,password:d,phoneCountryCode:h,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:hQ()},forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==g?void 0:g.isHost)?JSON.stringify(wQ(["login_page_context"])):void 0,context:JSON.stringify(f),phoneToken:void 0},P=function(e){a(e,{registerFrom:Ti.Email,account:n||o})},b?(null==w||w(ML.REGISTER_COMPLETE_INFO,{businessRequestName:i||"registerByEmail",content:rY({},x),onRegisterSuccess:P,onRegisterFailed:s}),[2/*return*/]):[4/*yield*/,C("/api/v2/register-".concat((i||"email").split("-")[0]),rY(rY({},x),{postUserInfoPipeline:!1}))];case 7:return T=B.sent(),N=T.statusCode,A=T.data,R=T.message,D=T.apiCode,200===N?P(A):(D===AJ.UNSAFE_PASSWORD_TIP&&M(!0),p.current.onError(),s(D,A,R),vC.error(R)),[2/*return*/]}}))}))}),[v,k],{loading:!1}),2),L=D[1],F=lY((function(e){var t;return d&&(null===(t=d.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(TU,rY({},e,{className:"authing-g2-input",size:"large",areaCode:O,onAreaCodeChange:function(e){N(e),v.getFieldValue(["phone"])&&v.validateFields(["phone"])},maxLength:20})):y().createElement(xq,rY({},e,{className:"authing-g2-input",size:"large",placeholder:f("login.inputPhone"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),maxLength:11}))}),[O,v,d,f]),j=uY((function(){var e;return i?"phone-password"===i?y().createElement(UB.Phone,{key:"account",name:"account",className:(null===(e=null==d?void 0:d.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"authing-g2-input-form remove-padding":"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0,areaCode:O},y().createElement(F,{autoFocus:!h})):y().createElement(UB.CustomName,{method:null==i?void 0:i.split("-")[0],key:i,name:"account",className:"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0},y().createElement(rO,{maxLength:50,autoFocus:!h,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:f("login.inputAccount",{text:o}),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})):null}),[F,i,h,O,o,f,v,null===(r=null==d?void 0:d.internationalSmsConfig)||void 0===r?void 0:r.enabled]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(sT,{form:v,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return p.current.onSpin(!0)},onFinish:function(e){L(e)},onFinishFailed:function(){return p.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&v.validateFields(["new-password"])}},i&&o?j:y().createElement(UB.Email,{key:"email",name:"email",className:"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0},y().createElement(rO,{autoFocus:!h,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:f("login.inputEmail"),
|
|
18571
18569
|
// prefix={<UserOutlined style={{ color: '#878A95' }} />}
|
|
18572
18570
|
prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"password",name:"password",className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:f("login.inputPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"new-password",name:"new-password",fieldRequiredRuleMessage:f("common.repeatPasswordDoc"),rules:[{validateTrigger:"onBlur",validator:function(e,t){return t!==v.getFieldValue("password")&&t?Promise.reject(f("common.repeatPasswordDoc")):Promise.resolve()}}],className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:f("common.passwordAgain"),
|
|
18573
18571
|
// prefix={<LockOutlined style={{ color: '#878A95' }} />}
|
|
@@ -18575,7 +18573,7 @@ prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}
|
|
|
18575
18573
|
// disabled={
|
|
18576
18574
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
18577
18575
|
// }
|
|
18578
|
-
text:f("common.register"),ref:p}))))},fY=function(){return fY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fY.apply(this,arguments)},pY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},hY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},vY=y().useCallback,gY=y().useEffect,yY=y().useRef,bY=y().useState,wY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=Pu().t,p=nY("phone"),h=nY("email"),m=fL(),v=lj().isPhoneMedia,g=WL(),b=dL().changeModule,w=
|
|
18576
|
+
text:f("common.register"),ref:p}))))},fY=function(){return fY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fY.apply(this,arguments)},pY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},hY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},vY=y().useCallback,gY=y().useEffect,yY=y().useRef,bY=y().useState,wY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=Pu().t,p=nY("phone"),h=nY("email"),m=fL(),v=lj().isPhoneMedia,g=WL(),b=dL().changeModule,w=rQ().post,C=yY(null),E=mY(sT.useForm(),1)[0],k=mY(bY(!1),2),S=k[0],x=k[1],P=mY(bY(!1),2),_=P[0],T=P[1],O=mY(bY((null===(t=null==c?void 0:c.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),N=O[0],I=O[1],A=null!==(n=null==c?void 0:c.verifyCodeLength)&&void 0!==n?n:4,R=mY(bY(d[0]),2),M=R[0],D=R[1],L=mY(bY(""),2),F=L[0],j=L[1],B=mY(bY(""),2),q=B[0],U=B[1],V=mY(bY(!1),2),$=V[0],z=V[1],H=(null===(r=null==c?void 0:c.internationalSmsConfig)||void 0===r?void 0:r.enabled)||!1,W=yL(),G=mY(bY(""),2),K=G[0],Y=G[1];gY((function(){var e;
|
|
18579
18577
|
// 开启国际化配置且登录方式为手机号码时
|
|
18580
18578
|
1===d.length&&"phone-code"===d[0]&&c&&(null===(e=c.internationalSmsConfig)||void 0===e?void 0:e.enabled)&&z(!0)}),[d,c]),gY((function(){
|
|
18581
18579
|
/** 如果是国外用户池,那么有图形验证码,需要请求图片 */
|
|
@@ -18585,52 +18583,43 @@ W&&(null==E||E.setFieldsValue({captchaCode:void 0}))}),[E,M,W]);var J=vY((functi
|
|
|
18585
18583
|
// message.error(t('common.registerProtocolTips'))
|
|
18586
18584
|
C.current.onError(),[2/*return*/]):(r=e.phone,B=e.code,u=null!=l?l:{},d=uj(H,r,N),f=d.phoneNumber,h=d.countryCode,v={phone:f,code:B,phoneCountryCode:H?h:void 0,
|
|
18587
18585
|
// password: undefined, // TODO: 手机号验证码不需要密码
|
|
18588
|
-
profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:
|
|
18586
|
+
profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:hQ()},forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==m?void 0:m.isHost)?JSON.stringify(wQ(["login_page_context"])):void 0,context:JSON.stringify(u),emailToken:void 0},y=function(e){o(e,{registerFrom:Gs.Phone,account:H?"":f})},t?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:B,phoneCountryCode:h})]:[3/*break*/,7]);case 6:
|
|
18589
18587
|
// 验证码校验通过 进入密码补全流程
|
|
18590
|
-
return k=W.sent(),_=k.statusCode,x=k.data,I=x.valid,A=x.message,200===_&&I?(null==b||b(ML.REGISTER_PASSWORD,{businessRequestName:"registerByPhoneCode",content:fY({},v),isChangeComplete:p,onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(A),[2/*return*/]);case 7:return p?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:B,phoneCountryCode:h})]:[3/*break*/,9];case 8:return P=W.sent(),_=P.statusCode,O=P.data,I=O.valid,A=O.message,200===_&&I?(null==b||b(ML.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByPhoneCode",content:fY({},v),onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(A),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-phone-code",fY(fY({},v),{postUserInfoPipeline:!1}))];case 10:R=W.sent(),q=R.data,M=R.statusCode,D=R.apiCode,L=R.message,200===M?(null===($=C.current)||void 0===$||$.onSpin(!1),y(q)):(C.current.onError(),vC.error(L),!t&&i(D,q,L)),W.label=11;case 11:return[3/*break*/,14];case 12:return F=W.sent(),j=F.message,B=F.code,q=F.data,C.current.onError(),vC.error(j),!t&&i(B,q,j),[3/*break*/,14];case 13:return null===(z=C.current)||void 0===z||z.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,H,N,w,b,p,o,i,null==c?void 0:c.enableCompletePassword]),Q=vY((function(e){return pY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,p,v,y,k,x,P,_,O,N,I,A,R,M,D,L,F,j,B;return hY(this,(function(q){switch(q.label){case 0:if(t=(null===(j=m.passwordLoginMethods)||void 0===j?void 0:j.includes("email-password"))&&(null==c?void 0:c.enableCompletePassword),C.current.onSpin(!0),e.email=e.identify,!a)return[3/*break*/,4];q.label=1;case 1:return q.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.EmailCode,data:{identity:e.email,password:e.password,code:e.code}},g)];case 2:return q.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=q.sent())?vC.error(n):vC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return q.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return q.sent(),T(!0),(null==s?void 0:s.length)&&!S?(C.current.onError(),[2/*return*/]):(r=e.email,L=e.code,u=null!=l?l:{},d={email:r,code:L,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:
|
|
18588
|
+
return k=W.sent(),_=k.statusCode,x=k.data,I=x.valid,A=x.message,200===_&&I?(null==b||b(ML.REGISTER_PASSWORD,{businessRequestName:"registerByPhoneCode",content:fY({},v),isChangeComplete:p,onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(A),[2/*return*/]);case 7:return p?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:B,phoneCountryCode:h})]:[3/*break*/,9];case 8:return P=W.sent(),_=P.statusCode,O=P.data,I=O.valid,A=O.message,200===_&&I?(null==b||b(ML.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByPhoneCode",content:fY({},v),onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(A),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-phone-code",fY(fY({},v),{postUserInfoPipeline:!1}))];case 10:R=W.sent(),q=R.data,M=R.statusCode,D=R.apiCode,L=R.message,200===M?(null===($=C.current)||void 0===$||$.onSpin(!1),y(q)):(C.current.onError(),vC.error(L),!t&&i(D,q,L)),W.label=11;case 11:return[3/*break*/,14];case 12:return F=W.sent(),j=F.message,B=F.code,q=F.data,C.current.onError(),vC.error(j),!t&&i(B,q,j),[3/*break*/,14];case 13:return null===(z=C.current)||void 0===z||z.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,H,N,w,b,p,o,i,null==c?void 0:c.enableCompletePassword]),Q=vY((function(e){return pY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,p,v,y,k,x,P,_,O,N,I,A,R,M,D,L,F,j,B;return hY(this,(function(q){switch(q.label){case 0:if(t=(null===(j=m.passwordLoginMethods)||void 0===j?void 0:j.includes("email-password"))&&(null==c?void 0:c.enableCompletePassword),C.current.onSpin(!0),e.email=e.identify,!a)return[3/*break*/,4];q.label=1;case 1:return q.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.EmailCode,data:{identity:e.email,password:e.password,code:e.code}},g)];case 2:return q.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=q.sent())?vC.error(n):vC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return q.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return q.sent(),T(!0),(null==s?void 0:s.length)&&!S?(C.current.onError(),[2/*return*/]):(r=e.email,L=e.code,u=null!=l?l:{},d={email:r,code:L,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:hQ()},context:JSON.stringify(u),generateToken:!0,
|
|
18591
18589
|
// 托管模式下注册携带query上自定义参数login_page_context
|
|
18592
|
-
params:(null==m?void 0:m.isHost)?JSON.stringify(
|
|
18590
|
+
params:(null==m?void 0:m.isHost)?JSON.stringify(wQ(["login_page_context"])):void 0},f=function(e){o(e,{registerFrom:Gs.EmailCode,account:r})},t?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,7]);case 6:
|
|
18593
18591
|
// 验证码校验通过 进入密码补全流程
|
|
18594
|
-
return p=q.sent(),k=p.statusCode,v=p.data,P=v.valid,_=v.message,200===k&&P?(null==b||b(ML.REGISTER_PASSWORD,{businessRequestName:"registerByEmailCode",content:fY({},d),isChangeComplete:h,onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(_),[2/*return*/]);case 7:return h?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,9];case 8:return y=q.sent(),k=y.statusCode,x=y.data,P=x.valid,_=x.message,200===k&&P?(null==b||b(ML.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByEmailCode",content:fY({},d),onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(_),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-email-code",fY(fY({},d),{postUserInfoPipeline:!1}))];case 10:O=q.sent(),N=O.statusCode,F=O.data,I=O.apiCode,A=O.onGuardHandling,R=O.message,C.current.onSpin(!1),200===N?f(F):(null==A||A(),i(I,F,R)),q.label=11;case 11:return[3/*break*/,14];case 12:return M=q.sent(),D=M.message,L=M.code,F=M.data,C.current.onError(),vC.error(D),!t&&i(L,F,vC),[3/*break*/,14];case 13:return null===(B=C.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,w,b,h,o,i,null==c?void 0:c.enableCompletePassword]),Z=vY((function(e){return pY(void 0,void 0,void 0,(function(){return hY(this,(function(t){switch(t.label){case 0:return M!==Tc.EmailCode?[3/*break*/,2]:[4/*yield*/,Q(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return M!==Tc.PhoneCode?[3/*break*/,4]:[4/*yield*/,J(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[M,Q,J]),X=vY((function(e){return $?y().createElement(
|
|
18592
|
+
return p=q.sent(),k=p.statusCode,v=p.data,P=v.valid,_=v.message,200===k&&P?(null==b||b(ML.REGISTER_PASSWORD,{businessRequestName:"registerByEmailCode",content:fY({},d),isChangeComplete:h,onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(_),[2/*return*/]);case 7:return h?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,9];case 8:return y=q.sent(),k=y.statusCode,x=y.data,P=x.valid,_=x.message,200===k&&P?(null==b||b(ML.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByEmailCode",content:fY({},d),onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),vC.error(_),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-email-code",fY(fY({},d),{postUserInfoPipeline:!1}))];case 10:O=q.sent(),N=O.statusCode,F=O.data,I=O.apiCode,A=O.onGuardHandling,R=O.message,C.current.onSpin(!1),200===N?f(F):(null==A||A(),i(I,F,R)),q.label=11;case 11:return[3/*break*/,14];case 12:return M=q.sent(),D=M.message,L=M.code,F=M.data,C.current.onError(),vC.error(D),!t&&i(L,F,vC),[3/*break*/,14];case 13:return null===(B=C.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,w,b,h,o,i,null==c?void 0:c.enableCompletePassword]),Z=vY((function(e){return pY(void 0,void 0,void 0,(function(){return hY(this,(function(t){switch(t.label){case 0:return M!==Tc.EmailCode?[3/*break*/,2]:[4/*yield*/,Q(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return M!==Tc.PhoneCode?[3/*break*/,4]:[4/*yield*/,J(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[M,Q,J]),X=vY((function(e){return $?y().createElement(Rq,fY({},e,{form:E,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),areaCode:N,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:H,scene:Ii.SCENE_TYPE_REGISTER,maxLength:A,onSendCodeBefore:function(){return pY(void 0,void 0,void 0,(function(){return hY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,M===Tc.PhoneCode&&y().createElement(Rq,fY({},e,{isInternationSms:H,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),areaCode:N,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:A,data:F,captchaCode:q,onSendCodeBefore:function(){return pY(void 0,void 0,void 0,(function(){return hY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),M===Tc.EmailCode&&y().createElement(wU,fY({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Nc.REGISTER_VERIFY_CODE,maxLength:A,data:F,onSendCodeBefore:function(){return pY(void 0,void 0,void 0,(function(){return hY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[N,M,E,F,H,$,f,A,q]),ee=vY((function(e){return y().createElement(TU,fY({},e,{className:"authing-g2-input",size:"large",areaCode:N,onAreaCodeChange:function(e){I(e),E.getFieldValue(["identify"])&&E.validateFields(["identify"])}}))}),[N,E]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(sT,{form:E,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return C.current.onSpin(!0)},onFinish:Z,onFinishFailed:function(){return C.current.onError()}},y().createElement(xV,{name:"identify",className:$?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:d,currentMethod:M,areaCode:N,checkRepeat:!0,required:!0},$?y().createElement(ee,{autoFocus:!v}):y().createElement(OH,{className:"authing-g2-input",size:"large",autoFocus:!v,value:F,methods:d,onChange:function(e){var t=e.target.value;j(t),1!==d.length&&(fQ("email",t)?D(Tc.EmailCode):
|
|
18595
18593
|
// 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
|
|
18596
|
-
D(Tc.PhoneCode))},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),W&&M===Tc.PhoneCode&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:
|
|
18594
|
+
D(Tc.PhoneCode))},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),W&&M===Tc.PhoneCode&&y().createElement(sT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:pQ(f("common.captchaCode"))},y().createElement(a$,{className:"authing-g2-input",size:"large",placeholder:f("login.inputCaptchaCode"),verifyCodeUrl:K,changeCode:function(){return Y(w$(m.host))},onChange:function(e){U(e.target.value)}})),y().createElement(sT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:pQ(f("common.captchaCode")),className:"authing-g2-input-form",validateFirst:!0},y().createElement(X,null)),Boolean(null==s?void 0:s.length)&&y().createElement(h$,{onChange:x,agreements:s,showError:_}),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
|
|
18597
18595
|
// disabled={
|
|
18598
18596
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
18599
18597
|
// }
|
|
18600
18598
|
text:f("common.register"),ref:C}))))},CY=function(){return CY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CY.apply(this,arguments)},EY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},kY=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},SY=y().useEffect,xY=y().useMemo,PY=y().useState,_Y=function(){var e=uL(),t=fL(),n=dL().changeModule,r=Pu().t,o=null==t?void 0:t.agreementEnabled,i=t.langRange,a=WL(),s=oL(),c=vL(),l=xY((function(){var e=[],n=t.registerMethods;return(null==n?void 0:n.includes(Gs.EmailCode))&&e.push("email-code"),(null==n?void 0:n.includes(Gs.Phone))&&e.push("phone-code"),e}),[t]),u=xY((function(){var r,i;return{onRegisterSuccess:function(t,r,//以何种方式注册成功
|
|
18601
|
-
o){var i;void 0===t&&(t={});var c=
|
|
18599
|
+
o){var i;void 0===t&&(t={});var c=AQ(s,r.registerFrom),l={};c&&(l.specifyDefaultLoginMethod=c.specifyDefaultLoginMethod,(null==c?void 0:c.lockMethod)&&(l._lockMethod=c.lockMethod),l._firstItemInitialValue=r.account),null===(i=null==e?void 0:e.onRegister)||void 0===i||i.call(e,t,a),null==n||n(ML.LOGIN,l)},onRegisterFailed:function(t,n,r){
|
|
18602
18600
|
// if (message) Message.error(message)
|
|
18603
18601
|
var o;void 0===n&&(n={}),null===(o=null==e?void 0:e.onRegisterError)||void 0===o||o.call(e,{code:t,data:n,message:r})},registeContext:t.registerContext,onBeforeRegister:null==e?void 0:e.onBeforeRegister,
|
|
18604
18602
|
//availableAt 0或者null-注册时,1-登录时,2-注册和登录时
|
|
18605
|
-
agreements:o&&null!==(i=null===(r=null==t?void 0:t.agreements)||void 0===r?void 0:r.filter((function(e){return ud(su.
|
|
18606
|
-
null===(n=null==c?void 0:c.onLogin)||void 0===n||n.call(c,e,h)},E=function(e,t,n){var r,o;null===(r=null==c?void 0:c.onBindingError)||void 0===r||r.call(c,{code:e,data:t,message:n}),null===(o=null==c?void 0:c.onLoginError)||void 0===o||o.call(c,{code:e,data:t,message:n})},k=function(e){return LY(void 0,void 0,void 0,(function(){var t,n,r,o,i;return FY(this,(function(a){switch(a.label){case 0:return t=e.type,n=e.data,f(!0),[4/*yield*/,null===(i=w[t])||void 0===i?void 0:i.call(w,n)];case 1:return r=a.sent(),o=r.isFlowEnd,f(!1),o?[2/*return*/,DY(DY({},r),{apiCode:200,code:200})]:[2/*return*/,r]}}))}))},S=jY((function(){var e,t;return u&&null!==(t=null===(e=null==i?void 0:i.agreements)||void 0===e?void 0:e.filter((function(e){return ud(su.
|
|
18603
|
+
agreements:o&&null!==(i=null===(r=null==t?void 0:t.agreements)||void 0===r?void 0:r.filter((function(e){return ud(su.resolvedLanguage).find((function(t){return t.includes(e.lang)}))&&1!==(null==e?void 0:e.availableAt)})))&&void 0!==i?i:[],publicConfig:s,methods:l}}),[o,null==t?void 0:t.agreements,null==e?void 0:e.onBeforeRegister,su.resolvedLanguage,l]),d=xY((function(){var e,t="";return t=l.length>1?r("common.verifyCodeRegister"):l.includes("phone-code")?r("common.phoneVerifyCode"):l.includes("email-code")?r("common.emailVerifyCode"):r("common.verifyCodeRegister"),(e={})[Ks.Email]={component:y().createElement(dY,CY({},u)),name:r("common.EmailRegister")},e[Ks.Phone]={component:y().createElement(wY,CY({},u)),name:t},e}),[u,r,l]),f=xY((function(){var e=new Map;return s.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[s.tabMethodsFields]),p=EY(PY(""),2),h=p[0],m=p[1],v=xY((function(){return t.defaultRegisterMethod&&_Q(t.defaultRegisterMethod)}),[t.defaultRegisterMethod]);SY((function(){v&&m(v)}),[v]),fB({currentTab:h,changeTab:m});var g=xY((function(){var e,n=t.registerMethods,o=kY([],EY(new Set(null===(e=kY([],EY(void 0===n?[]:n),!1))||void 0===e?void 0:e.map((function(e){return _Q(e)})))),!1);return jQ(o,v).map((function(e){var t=d[e],n=LQ(e,f,c);return y().createElement(SR.TabPane,{tab:(null==t?void 0:t.name)||r("common.registerTab",{text:n}),key:e},(null==t?void 0:t.component)||y().createElement(dY,CY({label:n,method:e},u)))}))}),[t,d,s,v,f,su.resolvedLanguage,u,c,r]);return y().createElement("div",{className:"g2-view-container g2-view-register"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==t?void 0:t.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},null==t?void 0:t.title)),y().createElement("div",{className:"g2-view-tabs"},y().createElement(SR,{destroyInactiveTabPane:!0,activeKey:h,onChange:function(t){var n;m(t),null===(n=null==e?void 0:e.onRegisterTabChange)||void 0===n||n.call(e,t)}},g)),y().createElement("div",{className:"g2-tips-line"},y().createElement("span",{className:"back-to-login"},y().createElement("span",{className:"link-like",onClick:function(){return null==n?void 0:n(ML.LOGIN,{})}},r("common.backLoginPage"))))),y().createElement(CL,{langRange:i,onLangChange:null==e?void 0:e.onLangChange}))},TY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},OY=y().useEffect,NY=y().useRef,IY=y().useState,AY=function(){var e=Pu().t,t=cL(),n=dL().changeModule,r=TY(IY(5),2),o=r[0],i=r[1],a=NY(0),s=oL();fB();var c=null!=t?t:{},l=c.title,u=void 0===l?e("common.problem.successTip"):l,d=c.message,f=void 0===d?e("common.problem.successTipMsg"):d,p=c.text,h=void 0===p?e("common.backLoginPage"):p,m=c.countDesc,v=void 0===m?e("common.pToLogin"):m,g=c.changeModule,b=void 0===g?ML.LOGIN:g,w=null==s?void 0:s.cdnBase;return OY((function(){return a.current=setInterval((function(){i((function(e){return e-1}))}),1e3),function(){return clearInterval(a.current)}}),[]),OY((function(){o<=0&&(clearInterval(a.current),null==n||n(b))}),[o]),y().createElement("div",{className:"g2-view-container g2-submit-success"},y().createElement("div",{className:"g2-view-tabs g2-questions-send-success-page"},y().createElement(Bj,{className:"plate",src:"".concat(w,"/questions-send-ok.png"),alt:"",width:191,height:146}),y().createElement("div",{className:"title"},u),y().createElement("div",{className:"message"},f),y().createElement(Cj,{onClick:function(){null==n||n(b)},text:h}),y().createElement("div",{className:"timer-tip"},o," ",v)))};!function(e){e.PhoneCode="phone-code",e.EmailCode="emial-code",e.Password="password"}(LK||(LK={})),function(e){e.CreateUser="create-federation-account",e.BindByPassword="bind-identity-by-password",e.BindByPhoneCode="bind-identity-by-phone-code",e.BindByEmailCode="bind-identity-by-email-code",e.RegisterByPassword="register-bind-by-password",e.RegisterByPhoneCode="register-bind-by-phone-code",e.RegisterByEmailCode="register-bind-by-email-code"}(FK||(FK={}));var RY,MY=function(e){var t;void 0===e&&(e="bind");var n=rQ().authFlow;return(t={})[LK.PhoneCode]=function(t){return n("bind"===e?FK.BindByPhoneCode:FK.RegisterByPhoneCode,t)},t[LK.EmailCode]=function(t){return n("bind"===e?FK.BindByEmailCode:FK.RegisterByEmailCode,t)},t[LK.Password]=function(t){return n("bind"===e?FK.BindByPassword:FK.RegisterByPassword,t)},t},DY=function(){return DY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},DY.apply(this,arguments)},LY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},FY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},jY=y().useMemo,BY=function(e){var t,n=e.skipAsk,r=void 0!==n&&n,o=cL(),i=fL(),a=dL().backModule;fB();var s=Pu().t,c=uL(),l=i.publicKey,u=i.agreementEnabled,d=oL(),f=rL().spinChange,p=(null===(t=null==d?void 0:d.internationalSmsConfig)||void 0===t?void 0:t.enabled)||!1,h=WL(),m=r?"register":"bind",v=MY(m)[LK.PhoneCode],g=MY(m)[LK.EmailCode],b=MY(m)[LK.Password],w={"phone-code":function(e){return LY(void 0,void 0,void 0,(function(){var t,n,r,o;return FY(this,(function(i){switch(i.label){case 0:return t=e.identity,n=e.code,r=e.phoneCountryCode,o={phone:t,code:n},p&&(o.phoneCountryCode=r),[4/*yield*/,v(o)];case 1:return[2/*return*/,i.sent()]}}))}))},"email-code":function(e){return LY(void 0,void 0,void 0,(function(){var t,n;return FY(this,(function(r){switch(r.label){case 0:return t=e.identity,n=e.code,[4/*yield*/,g({email:t,code:n})];case 1:return[2/*return*/,r.sent()]}}))}))},password:function(e){return LY(void 0,void 0,void 0,(function(){var t,n,r,o,i;return FY(this,(function(a){switch(a.label){case 0:return t=e.identity,n=e.password,r=h.options.encryptFunction,o=e.captchaCode&&e.captchaCode.trim(),[4/*yield*/,r(n,l)];case 1:return i=a.sent(),[4/*yield*/,b({account:t,password:i,captchaCode:o})];case 2:return[2/*return*/,a.sent()]}}))}))}},C=function(e){var t,n;null===(t=null==c?void 0:c.onBinding)||void 0===t||t.call(c,e,h),// 绑定成功
|
|
18604
|
+
null===(n=null==c?void 0:c.onLogin)||void 0===n||n.call(c,e,h)},E=function(e,t,n){var r,o;null===(r=null==c?void 0:c.onBindingError)||void 0===r||r.call(c,{code:e,data:t,message:n}),null===(o=null==c?void 0:c.onLoginError)||void 0===o||o.call(c,{code:e,data:t,message:n})},k=function(e){return LY(void 0,void 0,void 0,(function(){var t,n,r,o,i;return FY(this,(function(a){switch(a.label){case 0:return t=e.type,n=e.data,f(!0),[4/*yield*/,null===(i=w[t])||void 0===i?void 0:i.call(w,n)];case 1:return r=a.sent(),o=r.isFlowEnd,f(!1),o?[2/*return*/,DY(DY({},r),{apiCode:200,code:200})]:[2/*return*/,r]}}))}))},S=jY((function(){var e,t;return u&&null!==(t=null===(e=null==i?void 0:i.agreements)||void 0===e?void 0:e.filter((function(e){return ud(su.resolvedLanguage).find((function(t){return t.includes(e.lang)}))&&!!(null==e?void 0:e.availableAt)})))&&void 0!==t?t:[]}),[u,null==i?void 0:i.agreements,su.resolvedLanguage]),x=jY((function(){var e=["username-password","email-password","phone-password"];
|
|
18607
18605
|
// @ts-ignore
|
|
18608
18606
|
return o.methods.filter((function(t){return e.includes(t)}))}),[o.methods]),P=jY((function(){var e=["email-code","phone-code"];return o.methods.filter((function(t){return e.includes(t)}))}),[o.methods]),_=jY((function(){return r?"".concat(s("common.bind")," / ").concat(s("common.register")):s("common.bind")}),[r,s]),T=[{key:"code",title:s("common.verifyCodeLogin"),component:y().createElement(qH,{verifyCodeLength:null==d?void 0:d.verifyCodeLength,autoRegister:!!r,onLoginRequest:k,
|
|
18609
18607
|
// onLogin={onLogin}
|
|
18610
18608
|
onLoginSuccess:C,onLoginFailed:E,agreements:S,methods:P,submitButText:_})},{key:"password",title:s("login.bindPwdLogin"),component:y().createElement(N$,{publicKey:l,autoRegister:!!r,host:i.host,onLoginRequest:k,passwordLoginMethods:x,
|
|
18611
18609
|
// onLogin={onLogin}
|
|
18612
|
-
onLoginSuccess:C,onLoginFailed:E,agreements:S,submitButText:_})}],O=jY((function(){return o.source===ML.IDENTITY_BINDING_ASK?y().createElement(lB,{onBack:function(){return null==a?void 0:a()}},s("common.back")):y().createElement(cB,null)}),[a,o.source,s]);return y().createElement("div",{className:"g2-view-container g2-view-identity-binding"},O,y().createElement("div",{className:"g2-view-identity-binding-content"},y().createElement("div",{className:"g2-view-identity-binding-content-logo"},y().createElement("img",{src:null==i?void 0:i.logo,alt:"",className:"logo"})),y().createElement("div",{className:"g2-view-identity-binding-content-title"},y().createElement("span",null,s(r?"common.identityBindingSkipAskTitle":"common.identityBindingTitle"))),y().createElement("div",{className:"g2-view-identity-binding-content-desc"},y().createElement("span",null,s(r?"common.identityBindingSkipAskDesc":"common.identityBindingDesc"))),y().createElement("div",{className:"g2-view-identity-binding-content-login"},y().createElement(SR,null,T.filter((function(e){return"password"===e.key?0!==x.length:"code"!==e.key||0!==P.length})).map((function(e){return y().createElement(SR.TabPane,{key:e.key,tab:e.title},e.component)}))))))},qY=function(){return qY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qY.apply(this,arguments)},UY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},VY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},$Y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zY=function(){var e=cL(),t=dL().changeModule;fB();var n=Pu().t,r=
|
|
18610
|
+
onLoginSuccess:C,onLoginFailed:E,agreements:S,submitButText:_})}],O=jY((function(){return o.source===ML.IDENTITY_BINDING_ASK?y().createElement(lB,{onBack:function(){return null==a?void 0:a()}},s("common.back")):y().createElement(cB,null)}),[a,o.source,s]);return y().createElement("div",{className:"g2-view-container g2-view-identity-binding"},O,y().createElement("div",{className:"g2-view-identity-binding-content"},y().createElement("div",{className:"g2-view-identity-binding-content-logo"},y().createElement("img",{src:null==i?void 0:i.logo,alt:"",className:"logo"})),y().createElement("div",{className:"g2-view-identity-binding-content-title"},y().createElement("span",null,s(r?"common.identityBindingSkipAskTitle":"common.identityBindingTitle"))),y().createElement("div",{className:"g2-view-identity-binding-content-desc"},y().createElement("span",null,s(r?"common.identityBindingSkipAskDesc":"common.identityBindingDesc"))),y().createElement("div",{className:"g2-view-identity-binding-content-login"},y().createElement(SR,null,T.filter((function(e){return"password"===e.key?0!==x.length:"code"!==e.key||0!==P.length})).map((function(e){return y().createElement(SR.TabPane,{key:e.key,tab:e.title},e.component)}))))))},qY=function(){return qY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qY.apply(this,arguments)},UY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},VY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},$Y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zY=function(){var e=cL(),t=dL().changeModule;fB();var n=Pu().t,r=rQ().authFlow,o=WL(),i=uL(),a=rL().spinChange,s=$Y(ej((function(){return UY(void 0,void 0,void 0,(function(){var e,t,n,s,c;return VY(this,(function(l){switch(l.label){case 0:return a(!0),[4/*yield*/,r(FK.CreateUser)];case 1:return e=l.sent(),t=e.code,n=e.onGuardHandling,s=e.data,c=e.isFlowEnd,a(!1),c?function(e){var t,n;null===(t=null==i?void 0:i.onLogin)||void 0===t||t.call(i,e,o),null===(n=null==i?void 0:i.onCreate)||void 0===n||n.call(i,e,o)}(s):(!function(e,t){var n,r;null===(n=null==i?void 0:i.onCreateError)||void 0===n||n.call(i,{code:e,data:t}),null===(r=null==i?void 0:i.onLoginError)||void 0===r||r.call(i,{code:e,data:t})}(t,s),null==n||n()),[2/*return*/]}}))}))}),[]),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-view-identity-binding-ask"},y().createElement(cB,null),y().createElement("div",{className:"g2-view-identity-binding-ask-content"},y().createElement("div",{className:"g2-view-identity-binding-ask-content-title"},y().createElement("span",null,n("common.identityBindingAskTitle"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-desc"},y().createElement("span",null,n("common.identityBindingAskDesc"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-img"},y().createElement(YD,{type:"authing-bind"})),y().createElement("div",{className:"g2-view-identity-binding-ask-content-button-group"},y().createElement(hj,{className:"g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-create",loading:c.loading,onClick:l},n("common.identityBindingCreate")),y().createElement(hj,{className:" g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-binding authing-g2-submit-button",onClick:function(){null==t||t(ML.IDENTITY_BINDING,qY(qY({},e),{source:ML.IDENTITY_BINDING_ASK}))},type:"primary"},n("common.identityBindingBinding")))))},HY=function(){return HY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},HY.apply(this,arguments)},WY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},GY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},KY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},YY=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},JY=y().useCallback,QY=y().useEffect,ZY=y().useRef,XY=y().useState;!function(e){e.email="email-code",e.phone="phone-code"}(RY||(RY={}));var eJ,tJ,nJ=function(e){var t=e.identifyRef,n=Pu().t,r=KY(sT.useForm(),1)[0],o=KY(XY(""),2),i=o[0],a=o[1],s=KY(XY("phone"),2),c=s[0],l=s[1],u=ZY(null),d=lj().isPhoneMedia,f=WL(),p=uL(),h=cL();QY((function(){h.defaultEmail&&(a(h.defaultEmail),r.setFieldsValue({identify:h.defaultEmail}),l("email")),h.defaultPhone&&(a(h.defaultPhone),r.setFieldsValue({identify:h.defaultPhone}),l("phone"))}),[h,r]),QY((function(){t&&(t.current=RQ(i))}),[i,t]);var m=rQ().authFlow,v=oL(),g=v.publicKey,b=v.verifyCodeLength,w=v.internationalSmsConfig,C=v.selfUnlockStrategy,E=void 0===C?"password-captcha":C,k=(null==w?void 0:w.enabled)||!1,S=JY((function(e){return y().createElement(y().Fragment,null,"phone"===c&&y().createElement(Rq,HY({},e,{isInternationSms:k,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:n("common.inputFourVerifyCode",{length:b}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_RESET,maxLength:b,data:i,onSendCodeBefore:function(){return WY(void 0,void 0,void 0,(function(){return GY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,r.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})),"email"===c&&y().createElement(wU,HY({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:n("common.inputFourVerifyCode",{length:b}),prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Nc.SELF_UNLOCKING_VERIFY_CODE,maxLength:b,data:i,onSendCodeBefore:function(){return WY(void 0,void 0,void 0,(function(){return GY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,r.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))},value:i})))}),[c,r,i,k,n,b]);return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(sT,{name:"resetPassword",form:r,onFinish:function(e){return WY(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,s,l,d,h,v,y,b,w,C,S;return GY(this,(function(x){switch(x.label){case 0:return t=e.identify,n=e.code,r=e.password||"",[4/*yield*/,null===(y=null===(v=f.options)||void 0===v?void 0:v.encryptFunction)||void 0===y?void 0:y.call(v,r,g)];case 1:return o=x.sent(),
|
|
18613
18611
|
// 密码,经过加密后的, 仅“验证码”时不传 password 字段
|
|
18614
|
-
r="password-captcha"===E?o:void 0,"email"!==c?[3/*break*/,3]:[4/*yield*/,m("unlock-account-by-email",{email:t,code:n,password:r})];case 2:i=x.sent(),l=i.isFlowEnd,d=i.data,h=i.onGuardHandling,null===(b=u.current)||void 0===b||b.onSpin(!1),l?null===(w=null==p?void 0:p.onLogin)||void 0===w||w.call(p,d,f):null==h||h(),x.label=3;case 3:return"phone"!==c?[3/*break*/,5]:(a=uj(k,t).phoneNumber,[4/*yield*/,m("unlock-account-by-phone",{phone:a,code:n,password:r})]);case 4:s=x.sent(),l=s.isFlowEnd,d=s.data,h=s.onGuardHandling,null===(C=u.current)||void 0===C||C.onSpin(!1),l?null===(S=null==p?void 0:p.onLogin)||void 0===S||S.call(p,d,f):null==h||h(),x.label=5;case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(xV,{name:"identify",className:"authing-g2-input-form",methods:["email-code","phone-code"],currentMethod:RY[c]},y().createElement(OH,{methods:["email-code","phone-code"],className:"authing-g2-input",autoComplete:"off",autoFocus:!d,size:"large",value:i,onChange:function(e){var t=e.target.value;a(t)
|
|
18612
|
+
r="password-captcha"===E?o:void 0,"email"!==c?[3/*break*/,3]:[4/*yield*/,m("unlock-account-by-email",{email:t,code:n,password:r})];case 2:i=x.sent(),l=i.isFlowEnd,d=i.data,h=i.onGuardHandling,null===(b=u.current)||void 0===b||b.onSpin(!1),l?null===(w=null==p?void 0:p.onLogin)||void 0===w||w.call(p,d,f):null==h||h(),x.label=3;case 3:return"phone"!==c?[3/*break*/,5]:(a=uj(k,t).phoneNumber,[4/*yield*/,m("unlock-account-by-phone",{phone:a,code:n,password:r})]);case 4:s=x.sent(),l=s.isFlowEnd,d=s.data,h=s.onGuardHandling,null===(C=u.current)||void 0===C||C.onSpin(!1),l?null===(S=null==p?void 0:p.onLogin)||void 0===S||S.call(p,d,f):null==h||h(),x.label=5;case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(xV,{name:"identify",className:"authing-g2-input-form",methods:["email-code","phone-code"],currentMethod:RY[c]},y().createElement(OH,{methods:["email-code","phone-code"],className:"authing-g2-input",autoComplete:"off",autoFocus:!d,size:"large",value:i,onChange:function(e){var t=e.target.value;a(t),fQ("email",t)?l("email"):l("phone")},prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:YY([],KY(pQ(n("common.captchaCode"))),!1)},y().createElement(S,null)),"password-captcha"===E&&y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:YY([],KY(pQ(n("common.password"))),!1)},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:n("user.inputOldPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Cj,{className:"forget-password",text:n("common.unlock"),ref:u}))))},rJ=y().useRef,oJ=function(){var e=Pu().t,t=fL(),n=dL().changeModule,r=rJ("");return fB(),y().createElement("div",{className:"g2-view-container g2-forget-password"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==t?void 0:t.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},e("login.selfUnlock")),y().createElement("div",{className:"title-explain"},e("login.selfUnlockText"))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(nJ,{identifyRef:r})),y().createElement("div",{className:"g2-tips-line"},y().createElement("span",null,e("user.unlockTip")," "),y().createElement("span",{className:"link-like",onClick:function(){return null==n?void 0:n(ML.ANY_QUESTIONS,{identify:r.current})}},e("common.feedback")),y().createElement("div",{className:"link-like back-to-login",onClick:function(){return null==n?void 0:n(ML.LOGIN)}},e("common.backLoginPage"))))},iJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},aJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},sJ=y().useCallback,cJ=y().useMemo,lJ=function(){var e=fL(),t=uL(),n=WL(),r=iL().post,o=cJ((function(){return e.loadingComponent}),[e.loadingComponent]),i=cL();fB();var a=sJ((function(e){return iJ(void 0,void 0,void 0,(function(){var o,i,a,s,c;return aJ(this,(function(l){switch(l.label){case 0:return[4/*yield*/,r("/interaction/federation/binding/select",{account:e.id})];case 1:return o=l.sent(),i=o.isFlowEnd,a=o.data,s=o.onGuardHandling,i?null===(c=null==t?void 0:t.onLogin)||void 0===c||c.call(t,a,n):null==s||s(),[2/*return*/]}}))}))}),[n,r,t]),s=cJ((function(){return i?null==i?void 0:i.accounts.map((function(e){var t=e.id,n=e.photo,r=e.phone,o=e.email,i=e.username,s=e.nickname,c=e.name||s||i||void 0,l=r||o;return y().createElement("li",{className:"g2-select-account__li",key:t,onClick:function(){return a(e)}},y().createElement("img",{className:"g2-select-account__avatar",alt:"",src:n||""}),y().createElement("div",{className:"g2-select-account__body"},c&&y().createElement("span",{className:"g2-select-account__title"},c),y().createElement("span",{className:c?"g2-multiple__desc":"g2-multiple__title"},l)))})):null}),[a,i]),c=cJ((function(){return i?i.i18n:""}),[i]);return y().createElement(y().Fragment,null,i?y().createElement("div",{className:"g2-view-container"},y().createElement("div",{className:"g2-view-header"},y().createElement(Bj,{src:null==e?void 0:e.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},c)),y().createElement("div",{className:"g2-view-tabs"},y().createElement("ul",{className:"g2-select-account_wrapper"},s))):o)},uJ=function(){return uJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uJ.apply(this,arguments)},dJ=function(e){var t,n=e.avatar,r=e.title,o=e.description,i=e.tags,a="string"==typeof n?{shape:"square",size:48,src:n}:n;return y().createElement("div",{className:"g2-view-header"},y().createElement(yv,uJ({className:"g2-view-avatar icon"},a)),y().createElement("div",{className:"title"},r),y().createElement("div",{className:"title-description"},o),null===(t=null==i?void 0:i.map)||void 0===t?void 0:t.call(i,(function(e,t){
|
|
18615
18613
|
// @ts-ignore
|
|
18616
|
-
return y().createElement(gE,
|
|
18614
|
+
return y().createElement(gE,uJ({key:t,className:"authing-header-tag"},e))})))},fJ=function(){return fJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fJ.apply(this,arguments)},pJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},hJ=function(e){var t=e.dataSource,n=e.onSelect,r=e.gap,o=void 0===r?20:r,i=pJ(e,["dataSource","onSelect","gap"]);
|
|
18617
18615
|
// @ts-ignore
|
|
18618
|
-
return y().createElement(TI,
|
|
18616
|
+
return y().createElement(TI,fJ({split:!1,size:"small"},i,{className:MU()(i.className,"authing-guard-select-list"),dataSource:t,renderItem:function(e,r){
|
|
18619
18617
|
// @ts-ignore
|
|
18620
|
-
return y().createElement(TI.Item,{actions:null==e?void 0:e.actions,extra:null==e?void 0:e.extra,key:r,onClick:function(){return null==n?void 0:n(e,r)},className:
|
|
18621
|
-
var hJ,mJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},vJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},gJ=y().useRef,yJ=(y().useState,y().useEffect),bJ=function(e){var t=e.email,n=e.setSent,r=e.onFinish,o=Pu().t,i=MQ(),a=i.post,s=(i.get,oL()),c=null==s?void 0:s.verifyCodeLength,l=gJ(null);return yJ((function(){setTimeout((function(){var e;null===(e=l.current)||void 0===e||e.click()}))}),[]),y().createElement(y().Fragment,null,y().createElement($j,{name:"emailCode",codeLength:c,ruleKeyword:o("common.captchaCode")},y().createElement(Xj,{length:c,onFinish:r})),y().createElement(wq,{btnRef:l,setSent:n,beforeSend:function(){return mJ(void 0,void 0,void 0,(function(){var e,r,i,s,c;return vJ(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4/*yield*/,a("/api/v2/email/send",{email:t,scene:v.VerifyCode})];case 1:return e=l.sent(),r=e.code,i=e.message,2080===e.apiCode?(
|
|
18622
|
-
// 一分钟只能发一次邮箱验证码的提示信息,特殊处理
|
|
18623
|
-
vC.error(i),[2/*return*/,!1]):200===r?(n(!0),[2/*return*/,!0]):(vC.error(o("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:return"ECONNABORTED"===(s=l.sent()).code?(vC.error(o("login.sendCodeTimeout")),[2/*return*/,!1]):(c=JSON.parse(s.message),vC.error(c.message),[2/*return*/,!1]);case 3:return[2/*return*/]}}))}))},type:"link",className:"authing-join-send-btn"}))},wJ=function(){return wJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wJ.apply(this,arguments)},CJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},EJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.JoinTenant="join-tenant-portal",e.CreateTenant="create-tenant-portal"}(hJ||(hJ={}));var kJ,SJ,xJ=function(e,t){return CJ(void 0,void 0,void 0,(function(){return EJ(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,RQ().authFlow)(e,wJ({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},PJ=function(){return PJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PJ.apply(this,arguments)},_J=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},TJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},OJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},NJ=y().useMemo,IJ=y().useState,AJ=y().useRef,RJ=y().useCallback,MJ=function(e){var t,n,r=e.onBack,o=Pu().t,i=uL(),a=oL(),s=WL(),c=iL(),l=OJ(IJ(null),2),u=l[0],d=l[1],f=OJ(IJ(eJ.InputTenantCode),2),p=f[0],h=f[1],m=OJ(sT.useForm(),1)[0],v=AJ(null),g=OJ(IJ(!1),2),b=g[0],w=g[1],C=OJ(IJ(""),2),E=C[0],k=C[1],S=function(e,t){return _J(void 0,void 0,void 0,(function(){var n,r,o,a,l,u;return TJ(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),(null==e?void 0:e.host)?c.setBaseUrl(null==e?void 0:e.host):c.setBaseUrl(window.location.origin),!(null==e?void 0:e.isUserPool)&&(null==e?void 0:e.tenantId)?c.setTenantId(null==e?void 0:e.tenantId):c.setTenantId(""),[4/*yield*/,xJ(hJ.JoinTenant,{tenantId:e.tenantId,email:E||void 0,passCode:t})];case 1:return n=d.sent(),r=n.isFlowEnd,o=n.data,a=n.onGuardHandling,null===(u=null==i?void 0:i.onTenantSelect)||void 0===u||u.call(i,e),r?setTimeout((function(){var e;null===(e=null==i?void 0:i.onLogin)||void 0===e||e.call(i,o,s)})):null==a||a(),[3/*break*/,3];case 2:return(null==(l=d.sent())?void 0:l.message)&&vC.error(null==l?void 0:l.message),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},x=RJ((function(){return _J(void 0,void 0,void 0,(function(){var e,t,n,r;return TJ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,7,,8]),[4/*yield*/,(s=m.getFieldValue("code"),CJ(void 0,void 0,void 0,(function(){return EJ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,RQ().get)("/api/v3/get-tenant-public-info-by-code",{code:s})];case 1:return[2/*return*/,e.sent()]}}))})))];case 1:return e=i.sent(),t=e.data,n=e.message,d(t),t?a.enableVerifyDomainInJoinTenant?((null===(r=t.enterpriseDomains)||void 0===r?void 0:r.length)?
|
|
18624
|
-
// 输入企业邮箱
|
|
18625
|
-
h(eJ.InputEnterpriseEmail):
|
|
18626
|
-
// 当前组织管理员未设置企业邮箱域名,请联系管理员设置后加入组织。
|
|
18627
|
-
h(eJ.NoEnterpriseDomain),[3/*break*/,4]):[3/*break*/,2]:[3/*break*/,5];case 2:return[4/*yield*/,S(t)];case 3:i.sent(),i.label=4;case 4:return[3/*break*/,6];case 5:vC.error(n),i.label=6;case 6:return[3/*break*/,8];case 7:return i.sent(),vC.error(o("common.codeError")),[3/*break*/,8];case 8:return[2/*return*/]}var s}))}))}),[]),P=NJ((function(){var e;return[{key:eJ.InputTenantCode,title:o("common.joinTenant"),okBtnText:o("common.sure"),formFields:[{type:"text",placeholder:o("common.tenantExample"),name:"code",rules:[{required:!0}],prefix:y().createElement(YD,{type:"authing-account-circle-line",style:{color:"#878A95"}}),inputClassName:"authing-g2-input"}],onNext:function(){x()},onPrevOrCancel:function(){r()}},{key:eJ.InputEnterpriseEmail,title:o("common.emailVerify"),okBtnText:o("common.verify"),formFields:[{type:"text",placeholder:o("common.inputBusinessEmail"),name:"email",rules:[{required:!0}],addonAfter:"@".concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]),inputClassName:"authing-g2-input-group authing-g2-input-group-email"}],onNext:function(){var e;h(eJ.VerifyEmailCode),k("".concat(m.getFieldValue("email"),"@").concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]))},onPrevOrCancel:function(){h(eJ.InputTenantCode)}},{key:eJ.NoEnterpriseDomain,title:o("common.emailVerify"),hiddenConfirm:!0,formFields:[{type:"custom",customComponent:y().createElement("div",{className:"authing-warning-tips"},y().createElement(YD,{type:"authing-information-fill",className:"authing-warning-tips-icon"}),y().createElement("span",null,o("common.domainNotFound")))}],onPrevOrCancel:function(){h(eJ.InputTenantCode)}},{key:eJ.VerifyEmailCode,title:o("common.inputCode"),description:b?"".concat(o("login.verifyCodeSended")," ").concat(iZ(E)):o("common.emailMfaCheck"),okBtnText:o("common.sure"),formFields:[{type:"custom",customComponent:y().createElement(bJ,{email:E,setSent:w,onFinish:function(){var e;S(u,null===(e=m.getFieldValue("emailCode"))||void 0===e?void 0:e.join(""))}}),noStyle:!0}],hiddenConfirm:!0,onPrevOrCancel:function(){h(eJ.InputEnterpriseEmail)}}]}),[u,E,b,w]),_=NJ((function(){return P.find((function(e){return e.key===p}))}),[p,P]),T=NJ((function(){return y().createElement(lB,{onBack:null==_?void 0:_.onPrevOrCancel},o("common.back"))}),[o,_]);return y().createElement("div",{className:"g2-view-container g2-view-join"},T,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"authing-g2-join-title"},null==_?void 0:_.title),y().createElement("p",{className:"authing-g2-join-description"},null==_?void 0:_.description),y().createElement(sT,{form:m,onFinish:null==_?void 0:_.onNext,style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=v.current)||void 0===e?void 0:e.onError()}},null===(n=null===(t=null==_?void 0:_.formFields)||void 0===t?void 0:t.map)||void 0===n?void 0:n.call(t,(function(e){return y().createElement(sT.Item,{className:"authing-g2-input-form",name:null==e?void 0:e.name,rules:null==e?void 0:e.rules,noStyle:null==e?void 0:e.noStyle},function(e){switch(e.type){case"text":return y().createElement(rO,{className:e.inputClassName,autoComplete:"off",size:"large",addonBefore:e.addonBefore,addonAfter:e.addonAfter,prefix:e.prefix,suffix:e.suffix,disabled:e.disabled,placeholder:e.placeholder,readOnly:e.readOnly,style:PJ({},e.style),maxLength:e.maxLength});case"custom":return e.customComponent}}(e))})),!(null==_?void 0:_.hiddenConfirm)&&y().createElement(Cj,{text:o("common.sure"),ref:v,className:"authing-g2-join-button"}))))},DJ=function(e){var t=e.className,n=e.onClick,r=e.style,o=Pu().t;return y().createElement("div",{className:uq()("authing-add-button",t),onClick:n,style:r},y().createElement("span",{className:"authing-add-button-icon"},y().createElement(YD,{type:"authing-add-line"})),o("common.joinTenant"))},LJ=function(e){var t=e.className,n=e.onClick,r=e.style,o=Pu().t;return y().createElement("div",{className:uq()("authing-create-button",t),onClick:n,style:r},o("common.createTenantDesc"),y().createElement("span",null," ",o("common.createTenant")))},FJ=function(){return FJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FJ.apply(this,arguments)},jJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},UJ=y().useMemo,VJ=y().useRef,$J=function(e){var t=e.onBack,n=Pu().t,r=uL(),o=WL(),i=iL(),a=oL(),s=null==a?void 0:a.cdnBase,c=lL().moduleName,l=qJ(sT.useForm(),1)[0],u=VJ(null),d=UJ((function(){return y().createElement(lB,{onBack:t},n("common.back"))}),[n]);return y().createElement("div",{className:"g2-view-container g2-view-join"},d,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"authing-g2-join-title"},n("common.createTenant")),y().createElement(sT,{layout:"vertical",form:l,onFinish:function(){return jJ(void 0,void 0,void 0,(function(){var e,t,n,a,u,d,f,p,h,m,v,g;return BJ(this,(function(y){switch(y.label){case 0:return e=l.getFieldsValue(),[4/*yield*/,xJ(hJ.CreateTenant,FJ(FJ({},e),{logo:"".concat(s,"/tenant-default-logo.svg")}))];case 1:return t=y.sent(),n=t.isFlowEnd,a=t.data,u=t.onGuardHandling,d=t.apiCode,n?(setTimeout((function(){var e;null===(e=null==r?void 0:r.onLogin)||void 0===e||e.call(r,a,o)})),[3/*break*/,5]):[3/*break*/,2];case 2:return 1708!==d?[3/*break*/,4]:(f=FJ({},a),null===(g=null==r?void 0:r.onTenantSelect)||void 0===g||g.call(r,f),(null==f?void 0:f.host)?i.setBaseUrl(null==f?void 0:f.host):i.setBaseUrl(window.location.origin),!(null==f?void 0:f.isUserPool)&&(null==f?void 0:f.tenantId)?i.setTenantId(null==f?void 0:f.tenantId):i.setTenantId(""),[4/*yield*/,i.authFlow(c)]);case 3:return p=y.sent(),h=p.isFlowEnd,m=p.onGuardHandling,v=p.data,h?setTimeout((function(){var e;return null===(e=null==r?void 0:r.onLogin)||void 0===e?void 0:e.call(r,v,o)})):null==m||m(),[3/*break*/,5];case 4:null==u||u(),y.label=5;case 5:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()}},y().createElement(sT.Item,{className:"authing-g2-input-form",name:"name",label:n("common.tenantName"),required:!0,rules:[{required:!0}]},y().createElement(rO,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(sT.Item,{className:"authing-g2-input-form",name:"enterpriseDomains",label:n("common.tenantEmail")},y().createElement(rO,{className:"authing-g2-input-group",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput"),addonBefore:"@"})),y().createElement(sT.Item,{className:"authing-g2-input-form",name:"description",label:n("common.tenantDesc")},y().createElement(rO.TextArea,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(Cj,{text:n("common.sure"),ref:u,className:"authing-g2-join-button"}))))},zJ=function(){return zJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zJ.apply(this,arguments)},HJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},WJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},GJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},KJ=y().useCallback,YJ=y().useMemo,JJ=y().useState,QJ=function(){var e=Pu().t,t=lL().moduleName,n=cL(),r=n.list,o=n.title,i=n.description,a=n.logo,s=uL(),c=WL(),l=iL(),u=GJ(JJ("default"),2),d=u[0],f=u[1];fB();var p=KJ((function(e){return HJ(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return WJ(this,(function(d){switch(d.label){case 0:return n=hd()(e,["avatar","extra","userName","title"]),null===(u=null==s?void 0:s.onTenantSelect)||void 0===u||u.call(s,n),(null==e?void 0:e.host)?l.setBaseUrl(null==e?void 0:e.host):l.setBaseUrl(window.location.origin),!(null==e?void 0:e.isUserPool)&&(null==e?void 0:e.tenantId)?l.setTenantId(null==e?void 0:e.tenantId):l.setTenantId(""),[4/*yield*/,l.authFlow(t)];case 1:return r=d.sent(),o=r.isFlowEnd,i=r.onGuardHandling,a=r.data,o?setTimeout((function(){var e;return null===(e=null==s?void 0:s.onLogin)||void 0===e?void 0:e.call(s,a,c)})):null==i||i(),[2/*return*/]}}))}))}),[c,s,l,t]),h=YJ((function(){var t;return null===(t=null==r?void 0:r.map)||void 0===t?void 0:t.call(r,(function(t){return zJ(zJ({},t),{title:t.isUserPool?y().createElement(y().Fragment,null,t.tenantName,y().createElement(gE,{className:"authing-tag blue"},e("common.visitor"))):t.tenantName,
|
|
18628
|
-
// description: it.userName!,
|
|
18629
|
-
avatar:{size:40,src:t.tenantLogo,style:{borderRadius:4}},extra:y().createElement("div",{className:"authing-gaurd-select-extra"},y().createElement("span",null,e("common.enter")),y().createElement(YD,{type:"authing-arrow-left-s-line",className:"authing-gaurd-select-extra-icon"}))})}))}),[r]),m={default:y().createElement("div",{className:"g2-view-container"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement(uJ,{title:o,description:i,avatar:a}),(null==h?void 0:h.length)?y().createElement(y().Fragment,null,y().createElement(pJ,{dataSource:h,onSelect:p,className:"g2-view-container-tenant",gap:8}),y().createElement("div",{className:"g2-view-container-tenant"},y().createElement(DJ,{style:{padding:"8px 16px ",marginTop:8},onClick:function(){f("join")}}))):y().createElement("div",{className:"g2-error-content g2-error-content-tenant"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:e("common.noTenant")}}),y().createElement(DJ,{className:"authing-tenant-join",onClick:function(){f("join")}}))),y().createElement(LJ,{onClick:function(){return f("create")}})),join:y().createElement(MJ,{onBack:function(){f("default")}}),create:y().createElement($J,{onBack:function(){f("default")}})};return y().createElement(y().Fragment,null,m[d])},ZJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},XJ=y().useEffect,eQ=y().useRef,tQ=y().useState,nQ=function(){var e=Pu().t,t=cL(),n=dL().changeModule,r=ZJ(tQ(5),2),o=r[0],i=r[1],a=eQ(0),s=oL();fB();var c=null!=t?t:{},l=c.title,u=void 0===l?e("login.resetPassword.successTip"):l,d=c.message,f=void 0===d?e("login.resetPassword.successTipMsg"):d,p=c.text,h=void 0===p?e("login.resetPassword.back"):p,m=c.countDesc,v=void 0===m?e("login.resetPassword.backLogin"):m,
|
|
18618
|
+
return y().createElement(TI.Item,{actions:null==e?void 0:e.actions,extra:null==e?void 0:e.extra,key:r,onClick:function(){return null==n?void 0:n(e,r)},className:MU()("authing-guard-select-list-item"),style:(null==t?void 0:t.length)!==r+1?{marginBottom:o}:{}},y().createElement(TI.Item.Meta,{avatar:"string"==typeof(null==e?void 0:e.avatar)?y().createElement(yv,{size:40,src:e.avatar}):y().createElement(yv,fJ({size:40},e.avatar)),title:null==e?void 0:e.title,description:null==e?void 0:e.description}))}}))},mJ=function(){return mJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mJ.apply(this,arguments)},vJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},gJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},yJ=y().useCallback,bJ=y().useMemo,wJ=function(){var e=lL().moduleName,t=cL(),n=t.list,r=t.title,o=t.description,i=t.logo,a=uL(),s=WL(),c=iL();fB();var l=yJ((function(t){return vJ(void 0,void 0,void 0,(function(){var n,r,o,i,l,u;return gJ(this,(function(d){switch(d.label){case 0:return n=hd()(t,["avatar","extra","userName","title"]),null===(u=null==a?void 0:a.onTenantSelect)||void 0===u||u.call(a,n),(null==t?void 0:t.host)?c.setBaseUrl(null==t?void 0:t.host):c.setBaseUrl(window.location.origin),!(null==t?void 0:t.isUserPool)&&(null==t?void 0:t.tenantId)?c.setTenantId(null==t?void 0:t.tenantId):c.setTenantId(""),[4/*yield*/,c.authFlow(e)];case 1:return r=d.sent(),o=r.isFlowEnd,i=r.onGuardHandling,l=r.data,o?setTimeout((function(){var e;return null===(e=null==a?void 0:a.onLogin)||void 0===e?void 0:e.call(a,l,s)})):null==i||i(),[2/*return*/]}}))}))}),[s,a,c,e]),u=bJ((function(){var e;return null===(e=null==n?void 0:n.map)||void 0===e?void 0:e.call(n,(function(e){return mJ(mJ({},e),{title:e.tenantName,description:e.userName,avatar:{size:40,src:e.tenantLogo},extra:y().createElement(YD,{type:"authing-arrow-left-s-line",className:"authing-gaurd-select-extra-icon"})})}))}),[n]);return y().createElement("div",{className:"g2-view-container"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement(dJ,{title:r,description:o,avatar:i}),!!(null==u?void 0:u.length)&&y().createElement(hJ,{dataSource:u,onSelect:l})))},CJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},EJ=y().useEffect,kJ=y().useRef,SJ=y().useState,xJ=function(){var e=Pu().t,t=cL(),n=dL().changeModule,r=CJ(SJ(5),2),o=r[0],i=r[1],a=kJ(0),s=oL();fB();var c=null!=t?t:{},l=c.title,u=void 0===l?e("login.resetPassword.successTip"):l,d=c.message,f=void 0===d?e("login.resetPassword.successTipMsg"):d,p=c.text,h=void 0===p?e("login.resetPassword.back"):p,m=c.countDesc,v=void 0===m?e("login.resetPassword.backLogin"):m,
|
|
18630
18619
|
// changeModule = GuardModuleType.LOGIN,
|
|
18631
18620
|
g=c.needBack,
|
|
18632
18621
|
// changeModule = GuardModuleType.LOGIN,
|
|
18633
|
-
b=void 0===g||g,w=c.goBack,C=void 0===w?function(){return null==n?void 0:n(ML.LOGIN)}:w,E=null==s?void 0:s.cdnBase;return
|
|
18622
|
+
b=void 0===g||g,w=c.goBack,C=void 0===w?function(){return null==n?void 0:n(ML.LOGIN)}:w,E=null==s?void 0:s.cdnBase;return EJ((function(){return a.current=setInterval((function(){i((function(e){return e-1}))}),1e3),function(){return clearInterval(a.current)}}),[]),EJ((function(){o<=0&&(clearInterval(a.current),b&&(null==C||C()))}),[o,b,C]),y().createElement("div",{className:"g2-view-container g2-submit-success g2-view-container-submit-success"},y().createElement("div",{className:"g2-view-tabs g2-questions-send-success-pageWrap"},y().createElement(Bj,{className:"plate-submit-success",src:"".concat(E,"/questions-send-ok.png"),alt:"",width:157,height:120}),y().createElement("div",{className:"success-page-title "},u),y().createElement("div",{className:"success-page-message"},f),b&&y().createElement(y().Fragment,null,y().createElement(Cj,{className:"success-page-btn",onClick:function(){null==C||C()},text:h}),y().createElement("div",{className:"success-page-timer-tip"},o," ",v))))},PJ=function(){return PJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},PJ.apply(this,arguments)},_J=y().useEffect,TJ=y().useMemo,OJ="authing-ant";vC.config({prefixCls:"".concat(OJ,"-message")}),function(e){e.zhCn="zh-CN",e.enUs="en-US",e.jaJp="ja-JP",e.zhTw="zh-TW"}(tJ||(tJ={}));var NJ,IJ,AJ,RJ=((eJ={})[tJ.zhCn]=GD.zhCN,eJ[tJ.enUs]=GD.enUS,eJ[tJ.jaJp]=GD.jaJP,eJ[tJ.zhTw]=GD.zhTW,eJ),MJ=function(e){var t,n,r,o,i=e.guardProps,a=ZD(tL).defaultMergedConfig,s=ZD(tL).contextLoaded,c=lL().moduleName,l=iL(),u=dL().changeModule,d=(o=nL.Provider,{GuardButtonProvider:function(e){var t=e.children,n=QD(y().useState(!1),2),r=n[0],i=n[1];return y().createElement(o,{value:{spin:r,spinChange:function(e){i(e)}}},t)}}).GuardButtonProvider,f=TJ((function(){return a.loadingComponent}),[a]),p=(
|
|
18634
18623
|
// Error
|
|
18635
18624
|
(t={})[ML.ERROR]=function(e){return y().createElement(vV,{key:e})},
|
|
18636
18625
|
// Login
|
|
@@ -18650,11 +18639,11 @@ t[ML.DOWNLOAD_AT]=function(e){return y().createElement(hV,{key:e})},
|
|
|
18650
18639
|
// 忘记密码 -> 重置密码
|
|
18651
18640
|
t[ML.FORGET_PWD]=function(e){return y().createElement(GV,{key:e})},
|
|
18652
18641
|
// 首次登录修改密码
|
|
18653
|
-
t[ML.FIRST_LOGIN_PASSWORD]=function(e){return y().createElement(
|
|
18642
|
+
t[ML.FIRST_LOGIN_PASSWORD]=function(e){return y().createElement(rU,{key:e})},
|
|
18654
18643
|
// 提示修改密码
|
|
18655
|
-
t[ML.NOTICE_PASSWORD_RESET]=function(e){return y().createElement(
|
|
18644
|
+
t[ML.NOTICE_PASSWORD_RESET]=function(e){return y().createElement(aU,{key:e})},
|
|
18656
18645
|
// 登陆安全策略 密码轮换
|
|
18657
|
-
t[ML.FORCED_PASSWORD_RESET]=function(e){return y().createElement(
|
|
18646
|
+
t[ML.FORCED_PASSWORD_RESET]=function(e){return y().createElement(iU,{key:e})},
|
|
18658
18647
|
// 绑定 TOTP
|
|
18659
18648
|
t[ML.BIND_TOTP]=function(e){return y().createElement(CB,{key:e})},
|
|
18660
18649
|
// 问题反馈
|
|
@@ -18666,74 +18655,72 @@ t[ML.SUBMIT_SUCCESS]=function(e){return y().createElement(AY,{key:e})},
|
|
|
18666
18655
|
// 注册信息补全
|
|
18667
18656
|
t[ML.REGISTER_COMPLETE_INFO]=function(e){return y().createElement(dV,{key:e})},
|
|
18668
18657
|
// 切换登录身份
|
|
18669
|
-
t[ML.SELECT_ACCOUNT_2_LOGIN]=function(e){return y().createElement(
|
|
18658
|
+
t[ML.SELECT_ACCOUNT_2_LOGIN]=function(e){return y().createElement(pU,{key:e})},
|
|
18670
18659
|
// 登录信息补全
|
|
18671
18660
|
t[ML.LOGIN_COMPLETE_INFO]=function(e){return y().createElement(uV,{key:e})},
|
|
18672
18661
|
// 注册密码补全
|
|
18673
|
-
t[ML.REGISTER_PASSWORD]=function(e){return y().createElement(
|
|
18662
|
+
t[ML.REGISTER_PASSWORD]=function(e){return y().createElement(sU,{key:e})},
|
|
18674
18663
|
// 自助解锁
|
|
18675
|
-
t[ML.SELF_UNLOCK]=function(e){return y().createElement(
|
|
18676
|
-
// [GuardModuleType.JOIN_TENANT]: key => <JoinTenantView />
|
|
18677
|
-
,t);
|
|
18664
|
+
t[ML.SELF_UNLOCK]=function(e){return y().createElement(oJ,{key:e})},t[ML.UNSAFE_PASSWORD_RESET]=function(e){return y().createElement(oU,{key:e})},t[ML.FLOW_SELECT_ACCOUNT]=function(e){return y().createElement(lJ,{key:e})},t[ML.TENANT_PORTAL]=function(e){return y().createElement(wJ,null)},t[ML.New_SUBMIT_SUCCESS]=function(e){return y().createElement(xJ,{key:e})},t);
|
|
18678
18665
|
// 初始化 请求拦截器 (Error Code)
|
|
18679
|
-
|
|
18666
|
+
_J((function(){if(l&&u){l.initErrorCodeInterceptor((function(e,t){var n;
|
|
18680
18667
|
// 判断有没有 flowHandle
|
|
18681
|
-
t.flowHandle&&PL(t.flowHandle);var r=((n={})[
|
|
18668
|
+
t.flowHandle&&PL(t.flowHandle);var r=((n={})[IJ.CHANGE_MODULE]=function(){var e=GJ[t.apiCode],n=t.data;return u(e,n),IJ.CHANGE_MODULE},n[IJ.RENDER_MESSAGE]=function(){var e;return vC.error(null!==(e=t.message)&&void 0!==e?e:t.messages),IJ.RENDER_MESSAGE},n[IJ.FLOW_END]=function(){return IJ.FLOW_END},n)[e];if(!r)return t;if(t.apiCode===AJ.FLOW_END){var o=t.data.user;return PJ(PJ({},t),{onGuardHandling:r,isFlowEnd:!0,data:o?PJ({},o):t})}return PJ(PJ({},t),{onGuardHandling:r})}))}
|
|
18682
18669
|
// 错误码处理回调 切换 module 和 错误信息提示
|
|
18683
|
-
}),[l,u]);var h=
|
|
18670
|
+
}),[l,u]);var h=TJ((function(){return s?
|
|
18684
18671
|
// 传入的渲染指令不正确的情况处理
|
|
18685
|
-
c&&p[c]?p[c]((new Date).toString()):y().createElement(vV,{error:new Error("未知错误!moduleName 为 <b>".concat(c,"</b> 无法识别"))}):f||null}),[p,s,f,c]),m=
|
|
18672
|
+
c&&p[c]?p[c]((new Date).toString()):y().createElement(vV,{error:new Error("未知错误!moduleName 为 <b>".concat(c,"</b> 无法识别"))}):f||null}),[p,s,f,c]),m=TJ((function(){return i.visible}),[i.visible]),v=TJ((function(){return y().createElement(d,null,h)}),[d,h]);return y().createElement(iE,{prefixCls:OJ,locale:RJ[su.resolvedLanguage]},a.mode===Ys.Modal?y().createElement(uA,{className:"authing-g2-render-module-modal",closeIcon:y().createElement(YD,{type:"authing-close-line",className:"g2-modal-close"}),closable:null===(n=a.clickCloseable)||void 0===n||n,open:m,onCancel:null==i?void 0:i.onClose,keyboard:a.escCloseable,maskClosable:!1,getContainer:null!==(r=a.target)&&void 0!==r&&r},y().createElement("div",{className:"authing-g2-render-module"},v)):y().createElement("div",{style:a.style,className:"authing-g2-render-module ".concat(a.__internalRequest__?"":"authing-g2-render-module-normal")},v))},DJ=function(e){if(!e)return!0;var t=function(e){return CG=e}(e);return fd()(t,e)},LJ=function(e){var t,n=e.guardProps,r=e.initState;return t=n.facePlugin,DJ(t),y().createElement(XF,{guardProps:n,initState:r},y().createElement(MJ,{guardProps:n}))},FJ=function(){return FJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FJ.apply(this,arguments)},jJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},BJ=y().memo,qJ=y().useEffect,UJ=y().useRef,VJ=y().useState,$J=BJ((function(e){var t,n,r=e.config,o=UJ(null),i=jJ(VJ(!1),2),a=i[0],s=i[1];
|
|
18686
18673
|
// 锁定 Guard 中 window 指向
|
|
18687
|
-
|
|
18674
|
+
qJ((function(){if(null==o?void 0:o.current){var e=IQ(o.current);ad(e),s(!0)}}),[]);
|
|
18688
18675
|
// 首页 init 数据
|
|
18689
|
-
var c={moduleName:null!==(t=null==r?void 0:r.defaultScenes)&&void 0!==t?t:ML.LOGIN,initData:null!==(n=null==r?void 0:r.defaultInitData)&&void 0!==n?n:{}};return y().createElement("div",{ref:o},a&&y().createElement(
|
|
18676
|
+
var c={moduleName:null!==(t=null==r?void 0:r.defaultScenes)&&void 0!==t?t:ML.LOGIN,initData:null!==(n=null==r?void 0:r.defaultInitData)&&void 0!==n?n:{}};return y().createElement("div",{ref:o},a&&y().createElement(LJ,{guardProps:e,initState:c}))}),(function(e,t){return NQ(e,t)}));function zJ(e){return qJ((function(){var t,n,r,o;t={container:document.querySelector("#authing-guard-container-v4"),element:y().createElement($J,FJ({},e))},n=t.container,r=t.element,(o=C.findIndex((function(e){return e===n})))>-1?C.splice(o,1,n):C.push(n),w().render(r,n)}),[e]),y().createElement("div",{id:"authing-guard-container-v4"})}!function(e){
|
|
18690
18677
|
// 切换 Module
|
|
18691
18678
|
e.CHANGE_MODULE="changeModule",
|
|
18692
18679
|
// 渲染 错误信息
|
|
18693
18680
|
e.RENDER_MESSAGE="renderMessage",
|
|
18694
18681
|
// 流程 结束
|
|
18695
|
-
e.FLOW_END="flowEnd"}(
|
|
18682
|
+
e.FLOW_END="flowEnd"}(IJ||(IJ={})),function(e){e[e.IDENTITY_BINDING_ASK=1641]="IDENTITY_BINDING_ASK",e[e.IDENTITY_BINDING=1640]="IDENTITY_BINDING",e[e.IDENTITY_BINDING_NO_ASK=1666]="IDENTITY_BINDING_NO_ASK",e[e.APP_MFA=1636]="APP_MFA",e[e.MFA=1635]="MFA",e[e.ABORT_FLOW=1699]="ABORT_FLOW",e[e.COMPLETE_INFO=1642]="COMPLETE_INFO",e[e.UNLOCK=1643]="UNLOCK",e[e.FLOW_END=1600]="FLOW_END",e[e.FIRST_LOGIN_PASSWORD=1639]="FIRST_LOGIN_PASSWORD",e[e.FORCED_PASSWORD_RESET=2058]="FORCED_PASSWORD_RESET",e[e.UNSAFE_PASSWORD_TIP=2061]="UNSAFE_PASSWORD_TIP",e[e.UNSAFE_PASSWORD_RESET=2071]="UNSAFE_PASSWORD_RESET",e[e.FLOW_SELECT_ACCOUNT=2921]="FLOW_SELECT_ACCOUNT",e[e.TENANT_PORTAL=1644]="TENANT_PORTAL",e[e.SELECT_ACCOUNT_2_LOGIN=2930]="SELECT_ACCOUNT_2_LOGIN",e[e.RESET_ACCOUNT_NAME=1108]="RESET_ACCOUNT_NAME"}(AJ||(AJ={}));var HJ,WJ,GJ=((NJ={})[AJ.IDENTITY_BINDING]=ML.IDENTITY_BINDING,NJ[AJ.IDENTITY_BINDING_ASK]=ML.IDENTITY_BINDING_ASK,NJ[AJ.IDENTITY_BINDING_NO_ASK]=ML.IDENTITY_BINDING_NO_ASK,NJ[AJ.RESET_ACCOUNT_NAME]=ML.RESET_ACCOUNT_NAME,NJ[AJ.APP_MFA]=ML.MFA,NJ[AJ.MFA]=ML.MFA,NJ[AJ.ABORT_FLOW]=ML.LOGIN,NJ[AJ.COMPLETE_INFO]=ML.LOGIN_COMPLETE_INFO,NJ[AJ.FIRST_LOGIN_PASSWORD]=ML.FIRST_LOGIN_PASSWORD,NJ[AJ.FORCED_PASSWORD_RESET]=ML.FORCED_PASSWORD_RESET,NJ[AJ.UNLOCK]=ML.SELF_UNLOCK,NJ[AJ.UNSAFE_PASSWORD_RESET]=ML.UNSAFE_PASSWORD_RESET,NJ[AJ.FLOW_SELECT_ACCOUNT]=ML.FLOW_SELECT_ACCOUNT,NJ[AJ.SELECT_ACCOUNT_2_LOGIN]=ML.SELECT_ACCOUNT_2_LOGIN,NJ[AJ.TENANT_PORTAL]=ML.TENANT_PORTAL,NJ),KJ=function(e,t){if(-1===e.code)return vC.error(su.t("common.timeout")),e;if(-2===e.code)return vC.error(su.t("common.fetchError")),e;if(!e.statusCode)return e;var n,r=e.statusCode,o=e.apiCode,i=(n=r,Math.floor(n/100));return 3===i?o===AJ.FLOW_END?t(IJ.FLOW_END,e):t(IJ.CHANGE_MODULE,e):4===i||6===i?t(IJ.RENDER_MESSAGE,e):e},YJ=function(){return YJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},YJ.apply(this,arguments)},JJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},QJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ZJ=kL();!function(e){e.ERROR_CODE="errorCode"}(WJ||(WJ={}));var XJ,eQ=/** @class */function(){function e(e){var t=this;this.headers={"x-authing-userpool-id":"","x-authing-app-id":"","x-authing-sdk-version":ZJ,"x-authing-request-from":"Guard@".concat(ZJ)},this.responseInterceptorMap=new Map,this.getHeaders=function(){return t.headers},this.get=function(e,n,r){return void 0===n&&(n={}),JJ(t,void 0,void 0,(function(){var t;return QJ(this,(function(o){switch(o.label){case 0:return[4/*yield*/,AL.get(e,n,YJ(YJ({},r),{headers:YJ(YJ({},this.headers),null==r?void 0:r.headers)}))];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.post=function(e,n,r){return JJ(t,void 0,void 0,(function(){var t;return QJ(this,(function(o){switch(o.label){case 0:return[4/*yield*/,AL.post(e,n,{headers:YJ(YJ({},this.headers),null==r?void 0:r.headers)})];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.postForm=function(e,n,r){return JJ(t,void 0,void 0,(function(){var t;return QJ(this,(function(o){switch(o.label){case 0:return[4/*yield*/,AL.postForm(e,n,{headers:YJ(YJ({},this.headers),null==r?void 0:r.headers)})];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.authFlow=function(e,n){return JJ(t,void 0,void 0,(function(){var t,r;return QJ(this,(function(o){switch(o.label){case 0:return"/interaction/authFlow",t=xL(),[4/*yield*/,AL.post("/interaction/authFlow",{action:e,data:n,flowHandle:t},{headers:YJ({},this.headers)})];case 1:return r=o.sent(),[2/*return*/,this.responseIntercept(r)]}}))}))},
|
|
18696
18683
|
// 初始化 Error code 拦截器
|
|
18697
18684
|
this.initErrorCodeInterceptor=function(e){
|
|
18698
18685
|
// 初始化 errorCode 响应拦截器
|
|
18699
|
-
if(!t.responseInterceptorMap.has(
|
|
18700
|
-
)),t},this.responseIntercept=function(e){return 0===t.responseInterceptorMap.size?e:Array.from(t.responseInterceptorMap.values()).reduce((function(e,t){return t(e)}),e)},e&&this.getRequestClient().setBaseUrl(e)}return e.prototype.getRequestClient=function(){return this.requestClient||(this.requestClient=AL),this.requestClient},e.prototype.setUserpoolId=function(e){return this.headers["x-authing-userpool-id"]=e,this},e.prototype.setAppId=function(e){return this.headers["x-authing-app-id"]=e,this},e.prototype.setTenantId=function(e){return this.headers["x-authing-app-tenant-id"]=e,this},e.prototype.setDeviceId=function(e){return this.headers["x-authing-device-id"]=e,this},e.prototype.setBaseUrl=function(e){return this.getRequestClient().setBaseUrl(e),this},e}(),
|
|
18686
|
+
if(!t.responseInterceptorMap.has(WJ.ERROR_CODE))return t.responseInterceptorMap.set(WJ.ERROR_CODE,(function(t){return KJ(t,e)}// 传入调度拦截器回调
|
|
18687
|
+
)),t},this.responseIntercept=function(e){return 0===t.responseInterceptorMap.size?e:Array.from(t.responseInterceptorMap.values()).reduce((function(e,t){return t(e)}),e)},e&&this.getRequestClient().setBaseUrl(e)}return e.prototype.getRequestClient=function(){return this.requestClient||(this.requestClient=AL),this.requestClient},e.prototype.setUserpoolId=function(e){return this.headers["x-authing-userpool-id"]=e,this},e.prototype.setAppId=function(e){return this.headers["x-authing-app-id"]=e,this},e.prototype.setTenantId=function(e){return this.headers["x-authing-app-tenant-id"]=e,this},e.prototype.setDeviceId=function(e){return this.headers["x-authing-device-id"]=e,this},e.prototype.setBaseUrl=function(e){return this.getRequestClient().setBaseUrl(e),this},e}(),tQ=function(e){if(!HJ){var t=new eQ(e);HJ=t}return HJ},nQ=function(){if(!HJ)throw new Error("Please initialize Http Client");return HJ},rQ=function(){return nQ()},oQ=function(e,t){var n=void 0===t?{w:585,h:649}:t,r=n.w,o=n.h,i=VQ();if(i){var a=i.document,s=void 0!==i.screenLeft?i.screenLeft:i.screenX,c=void 0!==i.screenTop?i.screenTop:i.screenY,l=i.innerWidth?i.innerWidth:a.documentElement.clientWidth?a.documentElement.clientWidth:i.screen.width,u=i.innerHeight?i.innerHeight:a.documentElement.clientHeight?a.documentElement.clientHeight:i.screen.height,d=l/i.screen.availWidth,f=(l-r)/2/d+s,p=(u-o)/2/d+c,h=i.open(e,"_blank","\n toolbar=no,\n menubar=no,\n scrollbars=no,\n resizable=no,\n location=no,\n status=no\n width=".concat(r/d,", \n height=").concat(o/d,", \n top=").concat(p,", \n left=").concat(f,"\n "));
|
|
18701
18688
|
// Fixes dual-screen position Most browsers Firefox
|
|
18702
|
-
null==h||h.focus()}};!function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(
|
|
18689
|
+
null==h||h.focus()}};!function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(XJ||(XJ={}));var iQ,aQ=/** @class */function(){function e(){}
|
|
18703
18690
|
/**
|
|
18704
18691
|
* 打印日志
|
|
18705
18692
|
* @param message 日志信息
|
|
18706
18693
|
* @param type 日志类型
|
|
18707
|
-
*/return e.log=function(e,t){void 0===t&&(t=
|
|
18694
|
+
*/return e.log=function(e,t){void 0===t&&(t=XJ.INFO)},e.info=function(e){this.log(e,XJ.INFO)},e.warn=function(e){this.log(e,XJ.WARN)},e.error=function(e){this.log(e,XJ.ERROR)},e.printType=[XJ.ERROR],e}(),sQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},cQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},lQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},uQ=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},dQ={
|
|
18708
18695
|
// https://emailregex.com/
|
|
18709
18696
|
// eslint-disable-next-line no-control-regex
|
|
18710
18697
|
email:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
18711
18698
|
// https://cloud.tencent.com/developer/article/1751120
|
|
18712
18699
|
// email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
|
18713
18700
|
// 以下的来自 authing-user-portal 项目
|
|
18714
|
-
phone:/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,ip:/^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/,host:/^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+.?$/,username:/.?/}
|
|
18701
|
+
phone:/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,ip:/^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/,host:/^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+.?$/,username:/.?/},fQ=function(e,t){return dQ[e].test(t)},pQ=function(e,t){return[{required:!0,validateTrigger:["onChange"],message:t||su.t("common.isMissing",{name:e}),whitespace:!0}]};function hQ(){var e=VQ();if(e){var t=e.navigator.userAgent,n=e.navigator.platform,r=null;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(n)?r="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(n)?r="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(n)?r="Windows":/Android/.test(t)?r="Android":!r&&/Linux/.test(n)&&(r="Linux"),r}}
|
|
18715
18702
|
/**
|
|
18716
18703
|
* 传对象 {'background-color': 'red'}
|
|
18717
18704
|
* 传字符串 "CSS 样式"
|
|
18718
|
-
*/var
|
|
18705
|
+
*/var mQ={appConfig:null,userConfig:null},vQ=function(e,t){var n=VQ();if(n){var r,o,i=n.document;if(i.createStyleSheet)
|
|
18719
18706
|
// IE
|
|
18720
18707
|
o=i.createStyleSheet();else{var a=i.getElementsByTagName("head")[0];r=i.createElement("style"),a.appendChild(r),o=i.styleSheets[i.styleSheets.length-1]}if("string"==typeof e)r?r.innerHTML=e:o.cssText=e;// IE
|
|
18721
|
-
else{var s=0;for(var c in e)if(o.insertRule){var l=c+" {"+e[c]+"}";o.insertRule(l,s++)}else o.addRule(c,e[c],s++)}t&&(
|
|
18708
|
+
else{var s=0;for(var c in e)if(o.insertRule){var l=c+" {"+e[c]+"}";o.insertRule(l,s++)}else o.addRule(c,e[c],s++)}t&&(mQ[t]=r||o)}},gQ=function(e){var t;if(mQ[e]){var n=mQ[e];null===(t=n.parentNode)||void 0===t||t.removeChild(n),mQ[e]=null}},yQ=function(e){return e.filter(Boolean).join(" ")};
|
|
18722
18709
|
/**
|
|
18723
18710
|
* 在托管页下上传query中指定的用户自定义字段进行补全
|
|
18724
18711
|
* @param params 指定上传的用户自定义字段
|
|
18725
18712
|
*/
|
|
18726
|
-
var
|
|
18713
|
+
var bQ,wQ=function(e){var t=Fc().parse(window.location.search,{ignoreQueryPrefix:!0});return Object.keys(t).map((function(e){return{key:e,value:t[e]}})).filter((function(e){return e.value})).filter((function(t){return!e||e.includes(t.key)}))};!function(e){e[e.NoCheck=0]="NoCheck",e[e.Low=1]="Low",e[e.Middle=2]="Middle",e[e.High=3]="High",e[e.AUTO=4]="AUTO",e[e.Custom=5]="Custom"}(bQ||(bQ={}));var CQ=((iQ={})[bQ.NoCheck]={placeholder:function(){return su.t("login.inputPwd")},validateMessage:function(){return su.t("login.inputPwd")}},iQ[bQ.Low]={placeholder:function(){return su.t("login.setPwdLimit1")},validateMessage:function(){return su.t("login.setPwdLimitMsg1")}},iQ[bQ.Middle]={placeholder:function(){return su.t("login.login.setPwdLimit2")},validateMessage:function(){return su.t("login.setPwdLimitMsg2")}},iQ[bQ.High]={placeholder:function(){return su.t("login.login.setPwdLimit3")},validateMessage:function(){return su.t("login.setPwdLimitMsg3")}},iQ[bQ.AUTO]={placeholder:function(){return su.t("login.inputPwd")},validateMessage:function(){return su.t("login.inputPwd")}},iQ[bQ.Custom]={placeholder:function(){return su.t("login.inputPwd")},validateMessage:function(){return su.t("login.inputPwd")}},iQ),EQ=[/\d+/,/[a-zA-Z]/,/[`~!@#$%^&*()_\-+=<>?:"{}|,.\\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/],kQ=function(e){return EQ.map((function(t){return t.test(e)})).filter((function(e){return e})).length},SQ=function(e,t,n,r){var o;void 0===e&&(e=bQ.NoCheck),void 0===t&&(t={});var i=nQ().post,a=uQ([],lQ(pQ(su.t("common.password"),n)),!1),s=((o={})[bQ.NoCheck]=uQ([],lQ(a),!1),o[bQ.Low]=uQ(uQ([],lQ(a),!1),[{validateTrigger:"onBlur",validator:function(e,t){return t&&t.length<6?Promise.reject(CQ[bQ.Low].validateMessage()):Promise.resolve()}}],!1),o[bQ.Middle]=uQ(uQ([],lQ(a),!1),[{validateTrigger:"onBlur",validator:function(e,t){return t&&(t.length<6||kQ(t)<2)?Promise.reject(CQ[bQ.Middle].validateMessage()):Promise.resolve()}}],!1),o[bQ.High]=uQ(uQ([],lQ(a),!1),[{validateTrigger:"onBlur",validator:function(e,t){return t&&(t.length<6||kQ(t)<3)?Promise.reject(CQ[bQ.High].validateMessage()):Promise.resolve(!0)}}],!1),o[bQ.AUTO]=uQ(uQ([],lQ(a),!1),[{validateTrigger:"onBlur",pattern:null==t?void 0:t.regex,message:"zh-CN"===su.resolvedLanguage&&(null==t?void 0:t.zhMessageOpen)?null==t?void 0:t.zhMessage:"en-US"===su.resolvedLanguage&&(null==t?void 0:t.enMessageOpen)?null==t?void 0:t.enMessage:"ja-JP"===su.resolvedLanguage&&(null==t?void 0:t.jaMessageOpen)?null==t?void 0:t.jaMessage:"ja-JP"===su.resolvedLanguage&&(null==t?void 0:t.jpMessageOpen)?null==t?void 0:t.jpMessage:"zh-TW"===su.resolvedLanguage&&(null==t?void 0:t.twMessageOpen)?null==t?void 0:t.twMessage:null==t?void 0:t.message}],!1),o[bQ.Custom]=[
|
|
18727
18714
|
// ...required,
|
|
18728
|
-
{validateTrigger:"onBlur",validator:function(e,t){var n,o;return
|
|
18715
|
+
{validateTrigger:"onBlur",validator:function(e,t){var n,o;return sQ(this,void 0,void 0,(function(){var e;return cQ(this,(function(a){switch(a.label){case 0:return t&&0!==(null==t?void 0:t.length)?[3/*break*/,1]:[2/*return*/,Promise.reject(su.t("login.inputPwd"))];case 1:return[4/*yield*/,i("/api/v2/password/user-action/check",{password:t,userId:r})];case 2:return 200===(null==(e=a.sent())?void 0:e.code)?(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.valid)?[2/*return*/,Promise.resolve(!0)]:[2/*return*/,Promise.reject(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.message)]:[2/*return*/,Promise.reject(null==e?void 0:e.message)];case 3:return[2/*return*/]}}))}))}}],o);return s[e]},xQ=function(e,t,n,r,o){var i;void 0===e&&(e=bQ.NoCheck),void 0===t&&(t={});var a=nQ().post,s=uQ([],lQ(pQ(su.t("common.password"),r)),!1),c=((i={})[bQ.NoCheck]=uQ([],lQ(s),!1),i[bQ.Low]=uQ(uQ([],lQ(s),!1),[{validateTrigger:n,validator:function(e,t){return t&&t.length<6?Promise.reject(CQ[bQ.Low].validateMessage()):Promise.resolve()}}],!1),i[bQ.Middle]=uQ(uQ([],lQ(s),!1),[{validateTrigger:n,validator:function(e,t){return t&&(t.length<6||kQ(t)<2)?Promise.reject(CQ[bQ.Middle].validateMessage()):Promise.resolve()}}],!1),i[bQ.High]=uQ(uQ([],lQ(s),!1),[{validateTrigger:n,validator:function(e,t){return t&&(t.length<6||kQ(t)<3)?Promise.reject(CQ[bQ.High].validateMessage()):Promise.resolve(!0)}}],!1),i[bQ.AUTO]=uQ(uQ([],lQ(s),!1),[{validateTrigger:n,pattern:null==t?void 0:t.regex,message:"zh-CN"===su.resolvedLanguage&&(null==t?void 0:t.zhMessageOpen)?null==t?void 0:t.zhMessage:"en-US"===su.resolvedLanguage&&(null==t?void 0:t.enMessageOpen)?null==t?void 0:t.enMessage:"ja-JP"===su.resolvedLanguage&&(null==t?void 0:t.jaMessageOpen)?null==t?void 0:t.jaMessage:"ja-JP"===su.resolvedLanguage&&(null==t?void 0:t.jpMessageOpen)?null==t?void 0:t.jpMessage:"zh-TW"===su.resolvedLanguage&&(null==t?void 0:t.twMessageOpen)?null==t?void 0:t.twMessage:null==t?void 0:t.message}],!1),i[bQ.Custom]=[
|
|
18729
18716
|
// ...required,
|
|
18730
|
-
{validateTrigger:n,validator:function(e,t){var n,r;return
|
|
18717
|
+
{validateTrigger:n,validator:function(e,t){var n,r;return sQ(this,void 0,void 0,(function(){var e;return cQ(this,(function(i){switch(i.label){case 0:return t&&0!==(null==t?void 0:t.length)?[3/*break*/,1]:[2/*return*/,Promise.reject(su.t("login.inputPwd"))];case 1:return[4/*yield*/,a("/api/v2/password/user-action/check",{password:t,userId:o})];case 2:return 200===(null==(e=i.sent())?void 0:e.code)?(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.valid)?[2/*return*/,Promise.resolve(!0)]:[2/*return*/,Promise.reject(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.message)]:[2/*return*/,Promise.reject(null==e?void 0:e.message)];case 3:return[2/*return*/]}}))}))}}],i);return c[e]},PQ=function(e){return new Promise((function(t){return setTimeout(t,e)}))},_Q=function(e){switch(e){case Gs.Phone:case Gs.EmailCode:case Ks.EmailCode:return Ks.Phone;case Gs.Email:return Ks.Email;default:return e}},TQ=function(e){var t=e.split("@");return t[0].substr(0,1)+"***"+"@"+t[1]},OQ=function(e){return e.replace(/(\d{3})\d*(\d{4})/,"$1****$2")},NQ=function(e,t){var n=Object.keys(e).filter((function(e){return e.startsWith("on")})),r=Object.keys(t).filter((function(e){return e.startsWith("on")}));return fd()(hd()(e,n),hd()(t,r))},IQ=function(e){return"#document"===e.nodeName?e:IQ(e.parentNode)},AQ=function(e,t){var n,r,o,i,a=null==e?void 0:e.loginTabs.list,s=null!==(r=null===(n=null==e?void 0:e.verifyCodeTabConfig)||void 0===n?void 0:n.enabledLoginMethods)&&void 0!==r?r:[],c=null!==(i=null===(o=null==e?void 0:e.passwordTabConfig)||void 0===o?void 0:o.enabledLoginMethods)&&void 0!==i?i:[];// 支持的密码登录方式
|
|
18731
18718
|
// 通过手机验证码注册成功
|
|
18732
18719
|
return t===Gs.Phone?a.includes($s.PhoneCode)&&s.includes("phone-code")?{specifyDefaultLoginMethod:$s.PhoneCode,lockMethod:"phone-code"}:a.includes($s.Password)&&c.includes("phone-password")?{specifyDefaultLoginMethod:$s.Password}:void 0:
|
|
18733
18720
|
// 通过邮箱验证码注册成功
|
|
18734
18721
|
t===Gs.EmailCode?a.includes($s.PhoneCode)&&s.includes("email-code")?{specifyDefaultLoginMethod:$s.PhoneCode,lockMethod:"email-code"}:a.includes($s.Password)&&c.includes("email-password")?{specifyDefaultLoginMethod:$s.Password}:void 0:
|
|
18735
18722
|
// 通过邮箱密码注册成功
|
|
18736
|
-
t===Gs.Email?a.includes($s.Password)&&c.includes("email-password")?{specifyDefaultLoginMethod:$s.Password}:a.includes($s.PhoneCode)&&s.includes("email-code")?{specifyDefaultLoginMethod:$s.PhoneCode,lockMethod:"email-code"}:void 0:void 0},
|
|
18723
|
+
t===Gs.Email?a.includes($s.Password)&&c.includes("email-password")?{specifyDefaultLoginMethod:$s.Password}:a.includes($s.PhoneCode)&&s.includes("email-code")?{specifyDefaultLoginMethod:$s.PhoneCode,lockMethod:"email-code"}:void 0:void 0},RQ=function(e){return fQ("phone",e)||fQ("email",e)?e:""},MQ=function(){var e,t;return Object.keys(wL).includes(su.resolvedLanguage)?su.resolvedLanguage:null===(e=null==su?void 0:su.languages)||void 0===e?void 0:e[(null===(t=null==su?void 0:su.languages)||void 0===t?void 0:t.length)-1]},DQ=function(e){var t=/^\/(.*)\/([a-z]*)$/.exec(e);return t?new RegExp(t[1],t[2]):null},LQ=function(e,t,n){var r,o,i,a,s,c,l=MQ(),u=e.split("-")[0];return t.get(u)?null!==(c=null!==(i=null===(o=null===(r=t.get(u))||void 0===r?void 0:r.i18n)||void 0===o?void 0:o[l])&&void 0!==i?i:null===(s=null===(a=t.get(u))||void 0===a?void 0:a.i18n)||void 0===s?void 0:s[n])&&void 0!==c?c:t.get(u).label:""},FQ=function(e,t,n){var r=[];return e.forEach((function(e){var o=LQ(e,t,n);o&&r.push(o)})),r.join(" / ")},jQ=function(e,t){var n=e.findIndex((function(e){return e===t}));if(n>0){var r=e.splice(n,1);e.unshift(r[0])}return e},BQ=function(e){if(["work.weixin.qq.com","tencent.com"].filter((function(t){return new RegExp("".concat(t,"$")).test(e.origin)})).length){var t=e.data;if(t&&"string"==typeof t&&/^http/.test(t))return!0}return!1},qQ=function(e){return"https://login.dingtalk.com"===e},UQ=y().useEffect,VQ=function(){if("undefined"!=typeof window){var e=id(),t=null==e?void 0:e.defaultView;return t||window}},$Q=function(e,t,n){UQ((function(){t&&(e(Date.now()),function(e){void 0===e&&(e={}),e}(n),(null==n?void 0:n.publicConfig)&&tZ(t,n.publicConfig),(null==n?void 0:n.pageConfig)&&oZ(t,n.pageConfig))}),[t,n,e])},zQ=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);var n=VQ();if(n&&e.length>0){var r=function(e,t,n){var r=i(2655);return!!(t.includes(n)||zc()(t,(function(e){return!!r(e,n)}))||e.includes(n)||zc()(e,(function(e){return!!r(e,n)})))}(e,t,n.location.origin);if(!r)throw new Error("".concat(su.t("common.corsErrorMessage")).concat(su.t("common.corsErrorMessage2")))}},HQ=function(){return HQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},HQ.apply(this,arguments)},WQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},GQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},KQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},YQ=y().useCallback,JQ=y().useEffect,QQ=y().useMemo,ZQ=y().useState,XQ={},eZ=function(e){return null==XQ?void 0:XQ[e]},tZ=function(e,t){return XQ[e]=t},nZ={},rZ=function(e){return null==nZ?void 0:nZ[e]},oZ=function(e,t){return nZ[e]=t},iZ=function(e,t){return WQ(void 0,void 0,void 0,(function(){var n,r,o,i;return GQ(this,(function(a){switch(a.label){case 0:r=t.get,a.label=1;case 1:return a.trys.push([1,3,,4]),[4/*yield*/,r("/api/v2/applications/".concat(e,"/public-config"))];case 2:return n=a.sent(),[3/*break*/,4];case 3:throw a.sent(),aQ.error("Please check your config or network"),new Error("Please check your config or network");case 4:if(200!==n.code||!n.data)throw aQ.error(null!==(o=null==n?void 0:n.message)&&void 0!==o?o:"Please check your config"),new Error(null!==(i=null==n?void 0:n.message)&&void 0!==i?i:"Please check your config");return zQ(n.data.allowedOrigins,n.data.corsWhitelist),tZ(e,n.data),t.setUserpoolId(n.data.userPoolId),[2/*return*/,eZ(e)]}}))}))},aZ=function(e,t){return WQ(void 0,void 0,void 0,(function(){var n,r,o,i;return GQ(this,(function(a){switch(a.label){case 0:r=t.get,a.label=1;case 1:return a.trys.push([1,3,,4]),[4/*yield*/,r("/api/v2/applications/".concat(e,"/components-public-config/guard"))];case 2:return n=a.sent(),[3/*break*/,4];case 3:throw a.sent(),aQ.error("Please check your config or network"),new Error("Please check your config or network");case 4:if(200!==n.code||!n.data)throw aQ.error(null!==(o=null==n?void 0:n.message)&&void 0!==o?o:"Please check your config"),new Error(null!==(i=null==n?void 0:n.message)&&void 0!==i?i:"Please check your config");return oZ(e,n.data),[2/*return*/,rZ(e)]}}))}))},sZ=function(e,t){var n=KQ(ZQ(),2),r=n[0],o=n[1];return JQ((function(){o(HQ(HQ({},e),t))}),[e,t]),r},cZ=function(e,t){var n,r,o,i,a,s,c,l,u,d,f,p,h,m,v,g,y,b,w,C,E=null!==(n=e.autoRegister)&&void 0!==n?n:t.ssoPageComponentDisplay.autoRegisterThenLoginHintInfo,k=null===(r=t.passwordTabConfig.validRegisterMethods)||void 0===r?void 0:r.concat((null===(i=null===(o=t.verifyCodeTabConfig)||void 0===o?void 0:o.validRegisterMethods)||void 0===i?void 0:i.map((function(e){return function(e){switch(e){case Ks.Email:return Gs.Email;case Ks.EmailCode:return Gs.EmailCode;case Ks.Phone:return Gs.Phone;default:return e}}(e)})))||[]),S=Vc()&&$s.PhoneCode;return HQ(HQ({},e),{title:null!==(a=e.title)&&void 0!==a?a:t.name,logo:e.logo?e.logo:t.logo,loginMethods:null!==(l=null!==(s=null==e?void 0:e.loginMethods)&&void 0!==s?s:null===(c=t.loginTabs)||void 0===c?void 0:c.list)&&void 0!==l?l:[],passwordLoginMethods:null!==(d=null!==(u=null==e?void 0:e.passwordLoginMethods)&&void 0!==u?u:t.passwordTabConfig.validLoginMethods)&&void 0!==d?d:[],
|
|
18737
18724
|
// 默认登录方式
|
|
18738
18725
|
defaultLoginMethod:S||e.defaultLoginMethod||t.loginTabs.default,
|
|
18739
18726
|
// 禁止重制密码
|
|
@@ -18745,6 +18732,6 @@ disableRegister:!!(null!==(g=e.disableRegister)&&void 0!==g?g:!t.ssoPageComponen
|
|
|
18745
18732
|
// publicKey
|
|
18746
18733
|
publicKey:null!==(y=e.publicKey)&&void 0!==y?y:t.publicKey,
|
|
18747
18734
|
// 注册协议
|
|
18748
|
-
agreementEnabled:null!==(b=e.agreementEnabled)&&void 0!==b?b:t.agreementEnabled,agreements:null!==(w=e.agreements)&&void 0!==w?w:t.agreements,contentCss:null!==(C=e.contentCss)&&void 0!==C?C:t.css})},
|
|
18735
|
+
agreementEnabled:null!==(b=e.agreementEnabled)&&void 0!==b?b:t.agreementEnabled,agreements:null!==(w=e.agreements)&&void 0!==w?w:t.agreements,contentCss:null!==(C=e.contentCss)&&void 0!==C?C:t.css})},lZ=function(e,t,n,r,o){var i=KQ(ZQ(),2),a=i[0],s=i[1],c=KQ(ZQ(),2),l=c[0],u=c[1],d=YQ((function(){return WQ(void 0,void 0,void 0,(function(){var e,n,i,a;return GQ(this,(function(c){switch(c.label){case 0:if(!r||!t)return[3/*break*/,7];if(eZ(t))return[3/*break*/,6];c.label=1;case 1:return c.trys.push([1,5,,6]),n=(e=Promise).all,[4/*yield*/,iZ(t,r)];case 2:return i=[c.sent()],[4/*yield*/,aZ(t,r)];case 3:return[4/*yield*/,n.apply(e,[i.concat([c.sent()])])];case 4:return c.sent(),[3/*break*/,6];case 5:return a=c.sent(),o(a),[3/*break*/,6];case 6:s(eZ(t)),u(rZ(t)),c.label=7;case 7:return[2/*return*/]}}))}))}),[t,r,o]);JQ((function(){d()}),[d,e]);return QQ((function(){return a&&n&&l?{finallyConfig:HQ(HQ({},cZ(n,a)),{host:(e=n.host,t=a.requestHostname,r=new URL(e),"core.authing.cn"===r.hostname?r.protocol+"//"+t:e)}),guardPageConfig:l}:{finallyConfig:void 0,guardPageConfig:void 0};var e,t,r}),[n,l,a])}})// CONCATENATED MODULE: ./src/index.tsx
|
|
18749
18736
|
(),a;
|
|
18750
18737
|
/******/})()));
|