guest-reception-system/dist_rootowned_old/js/index.Bg6AlVg6.js

3 lines
8.4 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./InvitationForm.QGTZTe_T.js","./right-arrow.Ca_LZHAz.js",".pnpm.CF2hm8if.js","../assets/.pnpm-V-R_OuXr.css","./invitationOptions.C9q7AXPg.js","../assets/invitationOptions-CLfNPvWe.css","../assets/InvitationForm-CSJIqMlq.css","./SubmissionSuccess.CKx12cPv.js","./PagePlaceholder.CH5iciU9.js","../assets/PagePlaceholder-D6F-W26k.css","./PassCode.DuQb6DNF.js","../assets/PassCode-BqpR2Olg.css","./unauthorized.pLjvxD6q.js","./NotFound.E9RSKCdr.js","./TeacherLayout.BbMOlfKr.js","../assets/TeacherLayout-C10MIOo0.css","./TeacherHome.Rla5O7cw.js","../assets/TeacherHome-S8GCqmk3.css","./TeacherMine.DtwnBQU9.js","./logo.C0Q7FAT1.js","../assets/TeacherMine-Bn0Zlcef.css","./InvitationData.6d8Naabs.js","../assets/InvitationData-BnDT1mqQ.css","./SubmissionSuccess.BM7Cyj_-.js","../assets/SubmissionSuccess-4_1ZP63l.css","./ReceptionLayout.Bag3gqdv.js","../assets/ReceptionLayout-DWqWycGl.css","./ReceptionTask.CsvScA5S.js","../assets/ReceptionTask-CLnpoVVi.css","./ReceptionMine.CiopDOav.js","../assets/ReceptionMine-D2Xcj9jF.css","./ReceptionData.CYnsmFQ-.js","../assets/ReceptionData-Cg87fQhp.css","./ReceptionRecord.g2DeYe3p.js","../assets/ReceptionRecord-CoRAqY4U.css"])))=>i.map(i=>d[i]);
import{r as D,d as C,c as g,a as x,o as A,w as R,K as z,u as B,b as j,T as N,e as $,C as y,f as K,g as U,h as W,i as J,j as F,s as O,k as H,l as M,m as Y}from"./.pnpm.CF2hm8if.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const i of n.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function a(r){if(r.ep)return;r.ep=!0;const n=o(r);fetch(r.href,n)}})();const Z=D([]),G=C({__name:"App",setup(e){const t=[];return(o,a)=>{const r=x("router-view");return A(),g(r,null,{default:R(({Component:n,route:i})=>[(A(),g(z,{include:t,exclude:B(Z)},[j(N,{name:"fade-slide",mode:"out-in"},{default:R(()=>{var u;return[(A(),g($(n),{key:((u=i.matched[0])==null?void 0:u.path)??i.path,class:"h-screen w-screen"}))]}),_:2},1024)],1032,["exclude"]))]),_:1})}}}),Q=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},X=Q(G,[["__scopeId","data-v-db37e9a8"]]),I="8aWi3cPzmEB8zrzLato9jj6D9xZuJdML",ee={setItem(e,t){const o=y.AES.encrypt(t,I).toString();localStorage.setItem(e,o)},getItem(e){const t=localStorage.getItem(e);return t&&y.AES.decrypt(t,I).toString(y.enc.Utf8)||null}},k=K();k.use(U({storage:ee}));const te="modulepreload",re=function(e,t){return new URL(e,t).href},b={},s=function(t,o,a){let r=Promise.resolve();if(o&&o.length>0){let i=function(c){return Promise.all(c.map(m=>Promise.resolve(m).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),P=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));r=i(o.map(c=>{if(c=re(c,a),c in b)return;b[c]=!0;const m=c.endsWith(".css"),f=m?'[rel="stylesheet"]':"";if(!!a)for(let _=u.length-1;_>=0;_--){const E=u[_];if(E.href===c&&(!m||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const l=document.createElement("link");if(l.rel=m?"stylesheet":te,m||(l.as="script"),l.crossOrigin="",l.href=c,P&&l.setAttribute("nonce",P),document.head.appendChild(l),m)return new Promise((_,E)=>{l.addEventListener("load",_),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${c}`)))})}))}function n(i){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=i,window.dispatchEvent(u),!u.defaultPrevented)throw i}return r.then(i=>{for(const u of i||[])u.status==="rejected"&&n(u.reason);return t().catch(n)})},oe=[{path:"/",redirect:"/teacher"},{path:"/invite/:token",name:"visitor-invitation",meta:{title:"家长参观信息"},component:()=>s(()=>import("./InvitationForm.QGTZTe_T.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)},{path:"/invite/:token/success",name:"visitor-submission-success",meta:{title:"提交成功"},component:()=>s(()=>import("./SubmissionSuccess.CKx12cPv.js"),__vite__mapDeps([7,8,2,3,9]),import.meta.url)},{path:"/invite/:token/pass",name:"visitor-pass-code",meta:{title:"入校通行码"},component:()=>s(()=>import("./PassCode.DuQb6DNF.js"),__vite__mapDeps([10,2,3,11]),import.meta.url)},{path:"/unauthorized",name:"unauthorized",meta:{title:"无访问权限"},component:()=>s(()=>import("./unauthorized.pLjvxD6q.js"),__vite__mapDeps([12,8,2,3,9]),import.meta.url)},{path:"/:pathMatch(.*)*",name:"not-found",meta:{title:"页面不存在"},component:()=>s(()=>import("./NotFound.E9RSKCdr.js"),__vite__mapDeps([13,8,2,3,9]),import.meta.url)}],ne=[{path:"/teacher",component:()=>s(()=>import("./TeacherLayout.BbMOlfKr.js"),__vite__mapDeps([14,2,3,15]),import.meta.url),meta:{requiresAuth:!0},children:[{path:"",name:"teacher-invitation-form",meta:{title:"参观邀约表",requiresAuth:!0},component:()=>s(()=>import("./TeacherHome.Rla5O7cw.js"),__vite__mapDeps([16,1,2,3,4,5,17]),import.meta.url)},{path:"mine",name:"teacher-mine",meta:{title:"我的",requiresAuth:!0},component:()=>s(()=>import("./TeacherMine.DtwnBQU9.js"),__vite__mapDeps([18,19,1,2,3,20]),import.meta.url)},{path:"invitation-data",name:"teacher-invitation-data",meta:{title:"邀约数据",requiresAuth:!0,hideTabbar:!0},component:()=>s(()=>import("./InvitationData.6d8Naabs.js"),__vite__mapDeps([21,2,3,22]),import.meta.url)},{path:"success",name:"teacher-submission-success",meta:{title:"参观邀约表",requiresAuth:!0,hideTabbar:!0},component:()=>s(()=>import("./SubmissionSuccess.BM7Cyj_-.js"),__vite__mapDeps([23,2,3,24]),import.meta.url)}]},{path:"/reception",component:()=>s(()=>import("./ReceptionLayout.Bag3gqdv.js"),__vite__mapDeps([25,2,3,26]),import.meta.url),meta:{requiresAuth:!0},children:[{path:"",name:"reception-task",meta:{title:"接待任务",requiresAuth:!0},component:()=>s(()=>import("./ReceptionTask.CsvScA5S.js"),__vite__mapDeps([27,2,3,28]),import.meta.url)},{path:"mine",name:"reception-mine",meta:{title:"我的",requiresAuth:!0},component:()=>s(()=>import("./ReceptionMine.CiopDOav.js"),__vite__mapDeps([29,19,1,2,3,30]),import.meta.url)},{path:"data",name:"reception-data",meta:{title:"接待数据",requiresAuth:!0,hideTabbar:!0},component:()=>s(()=>import("./ReceptionData.CYnsmFQ-.js"),__vite__mapDeps([31,2,3,32]),import.meta.url)},{path:"record/:id",name:"reception-record",meta:{title:"接待记录",requiresAuth:!0,hideTabbar:!0},component:()=>s(()=>import("./ReceptionRecord.g2DeYe3p.js"),__vite__mapDeps([33,2,3,34]),import.meta.url)}]}];function se(){return[...ne,...oe]}const T=W({history:J(),routes:se()});T.beforeEach(e=>{const t=e.meta.role;return t!=null&&t.length?t.includes("admin")?!0:{name:"unauthorized"}:!0});T.afterEach(e=>{e.meta.title&&(document.title=e.meta.title)});const ie=F("user",{persist:!0,state:()=>({token:""}),getters:{getToken(e){return e.token}},actions:{setToken(e){this.token=e}}}),S=[],V=[],q=[],p={request:{use:e=>S.push(e)},response:{use:e=>V.push(e)},error:{use:e=>q.push(e)}},le=async e=>{for(const t of S)await t(e)},me=async e=>{for(const t of V){const o=await t(e);if(o!==void 0)return o}return e.data},pe=async e=>{let t={error:"Network error",code:-1};for(const o of q){const a=await o(e);a!==void 0&&(t=a)}return t};let h=0,v=null;const ae=()=>{h++,h===1&&!v&&(v=setTimeout(()=>{H({message:"加载中...",forbidClick:!0,duration:0})},800))},w=()=>{h=Math.max(0,h-1),h===0&&(v&&(clearTimeout(v),v=null),M())};p.request.use(e=>{const t=ie().getToken;t&&!("Authorization"in e.config.headers)&&(e.config.headers.Authorization=`Bearer ${t}`)});p.request.use(e=>{e.config.silent||ae()});p.response.use(({ctx:e})=>{e.config.silent||w()});p.response.use(({response:e,data:t})=>{if(!e.ok)return O(t.message||t.error||`请求失败(${e.status})`),{error:t.message||"Request failed",code:e.status}});p.response.use(({data:e})=>{e&&e.code===2&&setTimeout(()=>location.reload(),1e3)});p.error.use(({ctx:e})=>{e.config.silent||w()});p.error.use(({error:e})=>(O("网络异常,请稍后重试"),console.error(e),{error:"Network error",code:-1}));const L=Y(X);L.use(k);L.use(T);L.mount("#app");export{Q as _,me as a,pe as b,le as r};