企微助手 ,仓库名 短剧

extend.1675334753472.js 1.9KB

1
  1. "use strict";(self["webpackChunkqwh5"]=self["webpackChunkqwh5"]||[]).push([[501],{5275:function(e,t,n){function r(e){const t=window.location.href,n={};if(-1!=t.indexOf("?")){let e="",r=[];t.split("?").forEach(((t,o)=>{if(0!=o){e=t,r=e.split("&");for(let e=0;e<r.length;e++)n[r[e].split("=")[0]]=decodeURIComponent(r[e].split("=")[1])}}))}return e?n[e]?n[e]:"":n}function o(e){if("string"!=typeof e)return!1;try{let t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(t){return!1}}n.d(t,{W:function(){return r},p:function(){return o}})},4709:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}});var r=n(3396),o=n(5275),i=n(9733),c=n(2595),a=(0,r.aZ)({__name:"extend",setup(e){const{proxy:t}=(0,r.FN)(),n=async e=>{try{const t="/api/oauth2/warnReport",n={step:e,corpid:(0,o.W)("corpid")||"0",link:window.location.href};await c.Z.get(t,{...n})}catch(t){console.log("error =>",t)}};(0,r.wF)((()=>{if((0,o.W)("againJump"))a();else{(0,o.W)("corpid")||n(1);let e=encodeURIComponent(window.location.href+"&againJump=true"),t=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${(0,o.W)("corpid")}&redirect_uri=${e}&response_type=code&scope=snsapi_base&state=1&agentid=1000012#wechat_redirect`;s(t)}}));const a=()=>{(0,o.W)("code")||n(2),(0,o.W)("state")||n(3),i.F.loading({duration:0,message:"加载中...",forbidClick:!0}),t.$axios.get("/api/oauth2/userInfo",{corpid:(0,o.W)("corpid"),code:(0,o.W)("code"),state:(0,o.W)("state")},!0).then((e=>{if(i.F.clear(),e.rst)if((0,o.W)("jumpLink")){let t=decodeURIComponent((0,o.W)("jumpLink"));if(-1!=t.indexOf("?")){let n=t+"&params="+e.rst.external_userid+"&userId="+e.rst.external_userid;s(n)}else{let n=t+"?params="+e.rst.external_userid+"&userId="+e.rst.external_userid;s(n)}}else(0,i.F)("无回跳链接!"),n(5);else n(4)})).catch((e=>{i.F.clear()}))};function s(e){let t=document.createElement("a");t.href=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)}return(e,t)=>null}});const s=a;var d=s}}]);