| 1 |
- import{_ as m}from"./logo_lark-DULIW3z6.js";import{cQ as u,gU as g,fr as f,ft as h,cs as w,cp as e,gx as k,F as _}from"./builder-DygomDiV.js";const x={class:"flex-center mb-16"},Q=u({__name:"larkQrCode",props:{config:{}},setup(n){const{load:c}=g("https://lf-package-cn.feishucdn.com/obj/feishu-static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.3.js"),a=n,d=async()=>{if(!await c(!0)){console.error("飞书二维码 SDK 加载失败");return}const t={agentId:a.config.app_key,appSecret:a.config.app_secret},p=encodeURIComponent(`${window.location.origin}${window.MaxKB.prefix}/api/lark`),s=`https://passport.feishu.cn/suite/passport/oauth/authorize?client_id=${t.agentId}&redirect_uri=${p}&response_type=code&state=fit2cloud-lark-qr`,i=window.QRLogin({id:"lark-qr",goto:s,width:"266",height:"266",style:"width:280px;height:280px;border:1px solid #e8e8e8;margin:0 auto;border-radius:8px;"});window.addEventListener("message",async o=>{if(i.matchOrigin(o.origin)&&i.matchData(o.data)){const l=o.data.tmp_code;window.location.href=`${s}&tmp_code=${l}`}})};return f(()=>{d()}),(r,t)=>(h(),w(_,null,[e("div",x,[t[0]||(t[0]=e("img",{src:m,alt:"",width:"24px",class:"mr-4"},null,-1)),e("h2",null,k(r.$t("views.system.authentication.scanTheQRCode.larkQrCode")),1)]),t[1]||(t[1]=e("div",{id:"lark-qr",class:"lark-qrName"},null,-1))],64))}});export{Q as default};
|