import{s as e,g as r,a,r as s,o,c as t,i as n}from"./index-6dd6c134.js";import{o as c}from"./uni-app.es.67f4ac91.js";import{g as i}from"./getParams.10f08682.js";import{m as p}from"./api.14bd61a2.js";const u={__name:"index",setup(u){const d="https://chtech.ncjti.edu.cn/carstop/carbook/appopenid.action";c((()=>{m()}));const m=()=>{const r=i("card_number");if(r)e("bus_card_number",r),_();else{"weixin"===i("type")?jWeixin.miniProgram.reLaunch({url:"/pages/index/index"}):g()}},_=async()=>{const o=r("bus_card_number"),t=await p({url:"/appget_user.action",data:{card_number:o}});e("bus-userInfo",JSON.stringify(t.data)),"教师"===t.data.user_zz||"临时人员"===t.data.user_zz?a({url:"/pages/home/home"}):"车队长"===t.data.user_zz?s({url:"/pages/record/record"}):"司机"===t.data.user_zz?s({url:"/pages/recordDriver/recordDriver"}):s({url:"/pages/404/404"})},g=()=>{window.location.href=`https://open.wecard.qq.com/connect/oauth/authorize?app_key=4AA7B3944BDF3739&response_type=code&scope=snsapi_base&ocode=1015730314&redirect_uri=${d}&state=${d}`};return(e,r)=>{const a=n;return o(),t(a)}}};export{u as default};
