1 |
- import{a1 as u}from"./vue-A59npLRR.js";import{a as c,r as a}from"./index-EwE51S_X.js";import{l,i}from"./oauth-flw5HISP.js";async function w(){const t=d(),o=c();if(console.log(t),t.code&&t.state){const e=await l(t.code,t.state);if(console.log(e.data),e.code==1)return e.data.type=="bind"?new Promise(n=>{a.push({path:"/admin/routine/adminInfo"}),n(i()?{type:"reload",url:s()}:{type:"jump",url:{name:"dashboard"}})}):(console.log(e.data),o.dataFill(e.data.userInfo),e.data.type=="login"&&a.push({path:e.data.routePath}),new Promise(n=>{n(i()?{type:"reload",url:s()}:{type:"continue"})}))}return new Promise(e=>{e({type:"continue"})})}function d(){const t=u(),o=window.location.search;return o.includes("code=")&&o.includes("state=")&&(!t.query.code||!t.query.state)?f():t.query}function f(){const o=window.location.search.substring(1).split("&"),e={};for(let n=0;n<o.length;n++){const r=o[n].split("=");e[r[0]]=r[1]}return e}function s(){return window.location.href.includes("?")?window.location.href.replace(/\?(.*?)(\/|#\/)/,"$2").replace(/(.*\/\/)(.*)(\/\/)(.*)/g,"$1$2/$4"):window.location.href}export{w as u};
|