3 lines
9.9 KiB
JavaScript
3 lines
9.9 KiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dingtalkQrCode-JFQ7DNCz.js","./logo_dingtalk-CyDPr22R.js","./chat-5z0zeJ6U.js","./chat-CQu7LEiR.css","./dingtalkQrCode-CulsC8mV.css","./larkQrCode-C0vkyJUQ.js","./logo_lark-DULIW3z6.js","./wecomQrCode-CtPGIqO-.js","./wecomQrCode-DezZNILo.css"])))=>i.map(i=>d[i]);
|
|||
|
|
import{aW as Y,bj as Z,aZ as r,bp as ee,a$ as R,b0 as i,b1 as A,b2 as f,bc as x,be as te,cr as se,cs as re,bk as y,bd as F,ct as M,bN as ie,cu as ue,aX as N,aU as b,bU as G,aY as ce,bq as de,br as pe,b3 as h,b8 as Q,cv as fe,b5 as k,b7 as H,bl as J,bv as me,co as W,cw as ge,c6 as ve,cx as he,c7 as _e,ce as be}from"./chat-5z0zeJ6U.js";import{_ as ye,a as we,f as q,d as ke}from"./index-D6PBAPYq.js";import{L as xe,a as Ce}from"./LoginContainer-CA403ns6.js";import{a as X}from"./auth-setting-COpL1qD6.js";const Le={key:0,class:"text-center mt-16"},$e=Y({__name:"QrCodeTab",props:{tabs:{},defaultTab:{}},setup(U){const{login:C}=Z(),p=U,u=r(""),$=r([]),S=r({app_key:"",app_secret:""});async function c(){try{return await C.getQrSource()}catch{return[]}}ee(async()=>{p.tabs.length>0&&(u.value=p.tabs[0].key),$.value=await c(),T(u.value),console.log(p.defaultTab),p.defaultTab&&D(p.defaultTab)});const T=m=>{const g=$.value.find(I=>I.auth_type===m);g&&g.config&&(S.value=g.config)},D=m=>{u.value=m,T(m)};return(m,g)=>{const I=R("el-tab-pane"),s=R("el-tabs");return i(),A(s,{modelValue:u.value,"onUpdate:modelValue":g[0]||(g[0]=w=>u.value=w),onTabChange:D},{default:f(()=>[(i(!0),x(F,null,te(U.tabs,w=>(i(),A(I,{key:w.key,label:w.value,name:w.key},{default:f(()=>[w.key===u.value?(i(),x("div",Le,[(i(),A(se(re(()=>ye(Object.assign({"./dingtalkQrCode.vue":()=>M(()=>import("./dingtalkQrCode-JFQ7DNCz.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),"./larkQrCode.vue":()=>M(()=>import("./larkQrCode-C0vkyJUQ.js"),__vite__mapDeps([5,6,2,3]),import.meta.url),"./wecomQrCode.vue":()=>M(()=>import("./wecomQrCode-CtPGIqO-.js"),__vite__mapDeps([7,2,3,8]),import.meta.url)}),`./${w.key}QrCode.vue`,2))),{config:S.value},null,8,["config"]))])):y("",!0)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])}}}),Ae={key:0,class:"mb-24"},De={key:1},Ie={class:"mb-24"},Ee={class:"mb-24"},Re={key:0,class:"mb-24"},Se={class:"flex-between w-full"},Oe=["src"],Ve={class:"operate-container flex-between mt-12"},Pe={key:2},Qe={key:3,class:"login-gradient-divider lighter mt-24"},Te={class:"text-center mt-16"},Ue=Y({__name:"index",setup(U){const C=ie(),{login:p,user:u,theme:$}=Z(),{locale:S}=ue({useScope:"global"}),c=r(!1),T=N(),D=r(""),m=r(),g=r(null),I=r(""),s=r({username:"",password:"",captcha:""}),w=r({username:[{required:!0,message:b("views.login.loginForm.username.requiredMessage"),trigger:"blur"}],password:[{required:!0,message:b("views.login.loginForm.password.requiredMessage"),trigger:"blur"}],captcha:[{required:!1,message:b("views.login.loginForm.captcha.requiredMessage"),trigger:"blur"}]}),K=()=>{m.value&&m.value.validate(t=>{if(t)if(c.value=!0,L.value==="LDAP")p.asyncLdapLogin(s.value).then(()=>{S.value=localStorage.getItem("MaxKB-locale")||W()||"en-US",C.push({name:"home"})}).catch(()=>{c.value=!1});else{const e=q.pki.publicKeyFromPem(u.rasKey),a=JSON.stringify(s.value),o=q.util.encodeUtf8(a),_=e.encrypt(o,"RSAES-PKCS1-V1_5"),n=q.util.encode64(_);p.asyncLogin({encryptedData:n,username:s.value.username}).then(()=>{S.value=localStorage.getItem("MaxKB-locale")||W()||"en-US",localStorage.setItem("workspace_id","default"),C.push({name:"home"})}).catch(()=>{const v=s.value.username;c.value=!1,B(v)})}})};function B(t){ge.getCaptcha(t).then(e=>{e&&e.data&&e.data.captcha&&(D.value=e.data.captcha)}).catch(e=>{console.error("Failed to get captcha:",e)})}function ae(t){B(t)}G(()=>{u.asyncGetProfile().then(t=>{u.isPE()||u.isEE()?X.getLoginAuthSetting().then(e=>{if(Object.keys(e.data).length>0?g.value=e.data:g.value={max_attempts:1,default_value:"LOCAL"},T.query.login_mode!=="manual"){const o=g.value.default_value;["lark","wecom","dingtalk"].includes(o)?(V("QR_CODE",!1),I.value=o):V(o,!1)}}):g.value={max_attempts:1,default_value:"LOCAL"}})});const E=r([""]),j=r([""]),L=r(""),O=r(!1),z=r([]);function oe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const le=ce(()=>{var e,a,o;return!((e=$.themeInfo)!=null&&e.slogan)||"融合AI-RAG技术的智能知识问答及思维导图综<EFBFBD><EFBFBD>
|