You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.3 KiB
2 lines
1.3 KiB
import{cr as u,f1 as g,cu as m,cy as h,cz as f,cC as e,cK as k,cD as w}from"./index-6b91f299.js";const _="/ui/assets/logo_lark-040c9608.svg",y={class:"flex-center mb-16"},x=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"),s=n,d=async()=>{if(!await c(!0)){console.error("飞书二维码 SDK 加载失败");return}const t={agentId:s.config.app_key,appSecret:s.config.app_secret},p=encodeURIComponent(`${window.location.origin}/api/feishu`),r=`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:r,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=`${r}&tmp_code=${l}`}})};return m(()=>{d()}),(a,t)=>(h(),f(w,null,[e("div",y,[t[0]||(t[0]=e("img",{src:_,alt:"",width:"24px",class:"mr-4"},null,-1)),e("h2",null,k(a.$t("views.system.authentication.scanTheQRCode.larkQrCode")),1)]),t[1]||(t[1]=e("div",{id:"lark-qr",class:"lark-qrName"},null,-1))],64))}});export{x as default};
|