1 |
- import{W as Pe,e as ke}from"./emitter.5c87e4ab.js";import{d as Ee,j as Le,o as Me,c as Ae,a as We}from"./vue.86c1cb21.js";import{_ as xe}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.59c4c6ab.js";import"./elementPlus.8e650391.js";const T=typeof window<"u"?window:void 0,b=typeof document<"u"?document:void 0,d=typeof navigator<"u"?navigator:void 0,P=typeof location<"u"?location:void 0;function Re(){return(P==null?void 0:P.href)||""}const y=(d==null?void 0:d.userAgent)||"",Ie=(d==null?void 0:d.platform)||"";var we;(we=y==null?void 0:y.match(/wxwork\/([\d.]+)/i))==null||we[1];Ne();function Ne(){const e=(d==null?void 0:d.maxTouchPoints)??1,t=/Mac/i.test(Ie);return t&&e>2?{isMac:!1,isIOS:!0}:{isMac:t,isIOS:/\b(iPhone|iPad|iPod)\b/i.test(y)}}const Oe={config:"preVerifyJsApi",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareWechat:"menu:share:wechat",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress",getBrandWCPayRequest:"getBrandWCPayRequest"};for(const e of Object.keys(Oe));function Be(...e){console.error("[wwsdk]",...e)}Re();function Ve(e,t,n){if(qe(e))try{return e.call(n,t)}catch(o){Be(o)}}function qe(e){return typeof e=="function"}let V=!!(T!=null&&T.WeixinJSBridge);Promise.resolve();V||new Promise(e=>{b==null||b.addEventListener("WeixinJSBridgeReady",()=>{V=!0,e()})});function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var q,F,D,z,j,J,Y,G,H,K,Q,$,U,Z,X,ee,te,ne,oe,ae,ie,re,se,ce;function Fe(e){const t=document.createElement("iframe"),{style:n}=t;n.display="block",n.border="none",n.background="transparent",t.referrerPolicy="origin",t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true");const o=De(e);return o&&o.appendChild(t),t}function De(e){return typeof e=="string"?document.querySelector(e):e}(function(e){e.CLProximityUnknown="0",e.CLProximityImmediate="1",e.CLProximityNear="2",e.CLProximityFar="3"})(q||(q={})),function(e){e.wgs84="wgs84",e.gcj02="gcj02"}(F||(F={})),function(e){e.wifi="wifi",e.network2g="2g",e.network3g="3g",e.network4g="4g",e.none="none",e.unknown="unknown"}(D||(D={})),function(e){e.original="original",e.compressed="compressed"}(z||(z={})),function(e){e.album="album",e.camera="camera"}(j||(j={})),function(e){e.normal="normal",e.batch="batch",e.front="front",e.batch_front="batch_front"}(J||(J={})),function(e){e[e.common=0]="common",e[e.corp_training=1]="corp_training",e[e.edu_normal_class=2]="edu_normal_class",e[e.edu_small_class=3]="edu_small_class"}(Y||(Y={})),function(e){e[e.normal=0]="normal",e[e.scan=1]="scan"}(G||(G={})),function(e){e[e.chat=0]="chat",e[e.qrcode=1]="qrcode"}(H||(H={})),function(e){e.contact_profile="contact_profile",e.single_chat_tools="single_chat_tools",e.group_chat_tools="group_chat_tools",e.chat_attachment="chat_attachment",e.single_kf_tools="single_kf_tools",e.chain_single_chat_tools="chain_single_chat_tools",e.chain_group_chat_tools="chain_group_chat_tools",e.normal="normal"}(K||(K={})),function(e){e.permission="permission",e.datazone_permission="datazone_permission"}(Q||(Q={})),function(e){e.release="release",e.trial="trial",e.develop="develop"}($||($={})),function(e){e[e.internal=1]="internal",e[e.external=2]="external"}(U||(U={})),function(e){e[e.mediaid=1]="mediaid",e[e.url=2]="url",e[e.localId=4]="localId"}(Z||(Z={})),function(e){e.None="None",e.HWOpenTalk="HWOpenTalk",e.VoIP="VoIP",e.SystemCall="SystemCall"}(X||(X={})),function(e){e.qrCode="qrCode",e.barCode="barCode"}(ee||(ee={})),function(e){e.single="single",e.multi="multi"}(te||(te={})),function(e){e.department="department",e.user="user"}(ne||(ne={})),function(e){e.single="single",e.multi="multi"}(oe||(oe={})),function(e){e.department="department",e.user="user"}(ae||(ae={})),function(e){e[e.all=0]="all",e[e.unselected=1]="unselected"}(ie||(ie={})),function(e){e.single="single",e.multi="multi"}(re||(re={})),function(e){e.create_approval="10001",e.view_approval="10002"}(se||(se={})),function(e){e.link="link",e.text="text"}(ce||(ce={}));const ze=Ye();let je=0;function Je(){return`${ze}-${je++}`}function Ye(){return Math.random().toString(36).slice(2)}function Ge(e){return e&&typeof e=="object"?{...e,message:e.message,stack:e.stack}:e}function le(e){try{return typeof e=="string"?JSON.parse(e):e}catch{}}function He(e,t){const n=new Map;return{invoke:function(o,a){return a!=null&&a.dropResult?(e({type:"ww-iframe-handle:call",args:o},a),Promise.resolve(void 0)):new Promise((r,c)=>{const l=Je();n.set(l,{resolve:r,reject:c}),e({type:"ww-iframe-handle:call",uid:l,args:o},a)})},handleCallMessage:async function(o,a){if(!o.uid)return t(o.args,a);try{e({type:"ww-iframe-handle:response",uid:o.uid,kind:"resolve",args:await t(o.args,a)})}catch(r){throw e({type:"ww-iframe-handle:response",uid:o.uid,kind:"reject",args:Ge(r)}),r}},handleResponseMessage:function(o){const a=n.get(o.uid);a&&(a[o.kind](o.args),n.delete(o.uid))}}}function Ke(e,t,n){const o=[];let a=!1,r=!1;function c(s){if(s.origin!==t||e.contentWindow!==s.source)return;const i=le(s.data);typeof(i==null?void 0:i.type)=="string"&&i.type.startsWith("ww-iframe-handle:")&&B(i,s)}window.addEventListener("message",c);const l=new MessageChannel;l.port1.onmessage=s=>{B(le(s.data),s)};const{invoke:u,handleCallMessage:Te,handleResponseMessage:be}=He(function(s,i){a?_(s,i):o.push({msg:s,opts:i})},n);function B(s,i){switch(s.type){case"ww-iframe-handle:ready":return function(w){if(!a){a=!0,w.supportChannel&&(_({type:"ww-iframe-handle:set-port",port:l.port2},{transfer:[l.port2],serialize:!1}),r=!0);for(const h of o)_(h.msg,h.opts)}}(s);case"ww-iframe-handle:call":return Te(s,i);case"ww-iframe-handle:response":return void be(s)}}function _(s,i){var h;const w=(i==null?void 0:i.serialize)===!1?s:JSON.stringify(s);r?l.port1.postMessage(w,i==null?void 0:i.transfer):(h=e.contentWindow)==null||h.postMessage(w,t,i==null?void 0:i.transfer)}return e.addEventListener("load",()=>{a||_({type:"ww-iframe-handle:init"})}),{el:e,invoke:u,dispose:function(){window.removeEventListener("message",c),l.port1.onmessage=null}}}function Qe(e,t,n){Ve(t[e.name],e.payload||e.data,n)}for(var Tt={null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},$e="await break case catch class const continue debugger default delete do else enum export extends false finally for function if import in instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),Ue={},k=0,ue=$e;k<ue.length;k++){var Ze=ue[k];Ue[Ze]=!0}var pe,de,fe,f;(function(e){e.serviceApp="ServiceApp",e.corpApp="CorpApp"})(pe||(pe={})),function(e){e.zh="zh",e.en="en"}(de||(de={})),function(e){e.top="top",e.callback="callback",e.self="self"}(fe||(fe={})),function(e){e.middle="middle",e.small="small"}(f||(f={}));const me={[f.middle]:["480px","416px"],[f.small]:["320px","380px"]};function Xe(e){var l;const{width:t,height:n}=et((l=e.params)==null?void 0:l.panel_size),o=Fe(e.el),{style:a}=o;a.width=t,a.height=n;const{dispose:r}=Ke(o,"https://login.work.weixin.qq.com",u=>{if(u.type==="call")return Qe(u,e);throw new Error(`Unknown message type '${u.type}'`)}),c=new URL("https://login.work.weixin.qq.com/wwlogin/sso/login");for(const u of Object.keys(e.params||{}))c.searchParams.set(u,e.params[u]);return c.searchParams.set("version","2.2.4"),o.src=c.href,{el:o,unmount(){var u;r(),(u=o.parentNode)==null||u.removeChild(o)}}}function et(e=f.middle){const t=me[e]||me[f.middle];return{width:t[0],height:t[1]}}function ye(e){return typeof Symbol=="function"?Symbol(e):e}var he;(function(e){e[e.int32=1]="int32",e[e.float64=2]="float64",e[e.boolean=3]="boolean",e[e.null=4]="null",e[e[void 0]=5]="undefined",e[e.valueRef=6]="valueRef"})(he||(he={}));var ge,_e;(function(e){e[e.set=1]="set",e[e.call=2]="call",e[e.dispose=3]="dispose"})(ge||(ge={})),function(e){e[e.value=1]="value",e[e.ref=2]="ref"}(_e||(_e={}));const I=ye("__WECOM_REFLECT_ID__");function tt(e,t){return t.get?t.get.call(e):t.value}function ve(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return tt(e,ve(e,t,"get"))}function nt(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function C(e,t,n){nt(e,t),t.set(e,n)}function ot(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function S(e,t,n){return ot(e,ve(e,t,"set"),n),n}const x=new WeakMap,R=new WeakMap;function N(e,t){x.set(e,t),R.set(t,e)}function Ce(e){return x.has(e)?x.get(e):e}function Se(e){return R.has(e)?R.get(e):e}var E=new WeakMap,L=new WeakMap;let at=I;class it{setTransform(t){v(this,L).setTransform(t),v(this,E).call(this,"setTransform",[t])}constructor(t,n){g(this,at,void 0),C(this,E,{writable:!0,value:void 0}),C(this,L,{writable:!0,value:void 0}),S(this,E,t),S(this,L,n),t.bind(this),N(this,n)}}var M=new WeakMap,A=new WeakMap;let rt=I;class W{addColorStop(t,n){v(this,A).addColorStop(t,n),v(this,M).call(this,"addColorStop",[t,n])}constructor(t,n){g(this,rt,void 0),C(this,M,{writable:!0,value:void 0}),C(this,A,{writable:!0,value:void 0}),S(this,M,t),S(this,A,n),t.bind(this),N(this,n)}}const st=["fillStyle","filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle"],ct=["direction","font","fontKerning","fontStretch","fontVariantCaps","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","textAlign","textBaseline","textRendering","wordSpacing"],lt=["arc","arcTo","beginPath","bezierCurveTo","clip","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect","reset","resetTransform","restore","rotate","roundRect","save","scale","setLineDash","setTransform","transform","translate"],ut=["clearRect","drawFocusIfNeeded","drawImage","fill","fillRect","fillText","stroke","strokeRect","strokeText"],pt=["getContextAttributes","getLineDash","getTransform","isContextLost","isPointInPath","isPointInStroke","measureText"],dt=[["createConicGradient",W],["createLinearGradient",W],["createPattern",it],["createRadialGradient",W]],p=ye("__WECOM_INTERNAL__");let ft=p,mt=I;class ht{constructor(t,n,o){g(this,"canvas",void 0),g(this,ft,void 0),g(this,mt,void 0),this.canvas=t,this[p]={store:n,native:o,props:Object.create(null)},n.bind(this),N(this,o)}}const m=ht.prototype;for(const e of st)Object.defineProperty(m,e,{configurable:!0,enumerable:!0,get(){const{native:t,props:n}=this[p];return n[e]??Se(t[e])},set(t){const{store:n,props:o}=this[p];o[e]=Ce(t),n.set(this,e,t)}});for(const e of ct)Object.defineProperty(m,e,{configurable:!0,enumerable:!0,get(){return Se(this[p].native[e])},set(t){const{store:n,native:o}=this[p];o[e]=Ce(t),n.set(this,e,t)}});for(const e of pt)m[e]=function(...t){const{native:n}=this[p];return O(n,e,t)};for(const e of lt)m[e]=function(...t){const{store:n,native:o}=this[p];O(o,e,t),n.call(this,e,t)};for(const e of ut)m[e]=function(...t){const{store:n}=this[p];n.call(this,e,t)};for(const[e,t]of dt)m[e]=function(...n){const{store:o,native:a}=this[p],r=O(a,e,n),c=new t(o,r);return o.call(this,e,n,c),c};function O(e,t,n){switch(n.length){case 1:return e[t](n[0]);case 2:return e[t](n[0],n[1]);case 3:return e[t](n[0],n[1],n[2]);case 4:return e[t](n[0],n[1],n[2],n[3]);case 5:return e[t](n[0],n[1],n[2],n[3],n[4]);case 6:return e[t](n[0],n[1],n[2],n[3],n[4],n[5]);default:return e[t](...n)}}const gt={class:"login-scan-container"},_t=Ee({__name:"scan",props:{isScan:{type:Boolean,default:!1}},setup(e){const t=e;function n(){Xe({el:"#wx_qrcode",params:{login_type:"CorpApp",appid:"ww467ec1685e8262e6",agentid:"1000074",redirect_uri:"http://asset.zositechc.cn/web/",state:"Wechat",scope:"snsapi_privateinfo",redirect_type:"callback"},onCheckWeComLogin({isWeComLogin:a}){},onLoginSuccess({code:a}){o({code:a,state:"Wechat"})},onLoginFail(a){}})}async function o(a){try{const r=await Pe(a);r&&ke.emit("scan-wecomLogin",{loginInfo:r})}catch(r){console.log("error:",r)}}return Le(()=>{t.isScan&&n()}),(a,r)=>(Me(),Ae("div",gt,r[0]||(r[0]=[We("div",{id:"wx_qrcode"},null,-1)])))}});const bt=xe(_t,[["__scopeId","data-v-82d64351"]]);export{bt as default};
|