officialAccount/unpackage/dist/build/web/assets/pages-login-callback.Bto4ku...

2 lines
1.8 KiB
JavaScript
Raw Normal View History

2025-06-11 17:33:34 +08:00
import{r as e,D as o,c as s,w as n,E as t,G as a,y as c,i as l,o as r,a as i,b as p,g as d}from"./index-BWFbK6MW.js";import{_ as u}from"./nu.C7Ggybbs.js";import{o as m}from"./uni-app.es.Bupuy4O7.js";import{b as h}from"./index.DHEE3adT.js";import{_ as f}from"./_plugin-vue_export-helper.BCo6x5W8.js";const k=f({__name:"callback",setup(f){e(0);const k=o({name:"",openid:"",accessToken:""});e("");const g=()=>{const e=`${h}/h5Api/nuBizAdvisoryInfo/queryWeixinInfo?openId=${encodeURIComponent(k.openid)}`;fetch(e).then((e=>e.json())).then((e=>{console.log("个人信息打印",e),a("token",e.result.token),a("serverUrl",e.result.serverUrl),console.log("???token存储",e.result.token),e.result.tel?(c({url:"/pages/login/threeselectone"}),a("tel",e.result.tel)):c({url:"/pages/login/phonebumber"}),v()}))},_=e([]),v=()=>{fetch(`${h}/sys/sysDepart/queryInstitutionsList`).then((e=>e.json())).then((e=>{_.value=[...e],console.log("机构打印",_.value)}))};return e([]),m((()=>{var e;const o=null==(e=window.location.href.split("?")[1])?void 0:e.split("#")[0],s={};o&&o.split("&").forEach((e=>{const[o,n]=e.split("=");s[o]=decodeURIComponent(n)})),console.log("解析到的 query 参数:",s),s.code&&(e=>{const o=`${h}/weixin/wechat/callback?code=${encodeURIComponent(e)}`;fetch(o).then((e=>e.json())).then((e=>{k.name=e.data.nickname,k.openid=e.data.openid,k.accessToken=e.accessToken,t({key:"openid",data:{openid:e.data.openid,accessToken:e.accessToken}}),g()})).catch((e=>{console.error("❌ 获取用户信息失败:",e)}))})(s.code)})),(e,o)=>{const t=d,a=l;return r(),s(a,{class:"login-container"},{default:n((()=>[i(t,{class:"imge",src:u}),i(a,{class:"font"},{default:n((()=>[p(" 页面跳转中,请稍后... ")])),_:1})])),_:1})}}},[["__scopeId","data-v-2e590b37"]]);export{k as default};