2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{_ as S,b,r as o,t as k,v as x,x as N,g as y,o as M,c as B,k as C,y as E,f as T,u as R,h as u,a as U}from"./index.db81687b.js";import{d as O}from"./jsencrypt.ed0a786e.js";const j={class:"login"},q={class:"zr"},z={__name:"Transitional",setup(D){U();const g=b(),p=R();let d=o("\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u4FAF....."),e=o({username:"",password:"",rememberMe:!1,code:"",uuid:""});k(()=>{e.value.password="",i()}),window.localStorage.getItem("userName")&&c();function i(a){var r=document.location.href,s=new Object,f=r.indexOf("?");if(f!=-1){var I=r.substr(f+1);let t=I.split("&");for(var n=0;n<t.length;n++)s[t[n].split("=")[0]]=t[n].split("=")[1]}s.ticket&&(window.localStorage.setItem("ticket",s.ticket),x.get(`http://36.134.45.201:8000/prod-api/system/external/getInfo?ticket=${s.ticket}`).then(t=>{window.localStorage.setItem("divisions",t.data.data.user.dept.deptCode),window.localStorage.setItem("deptName",t.data.data.user.dept.deptName),window.localStorage.setItem("userName",t.data.data.user.userName)}).catch(t=>{})),window.localStorage.getItem("userName")?e.value.username=window.localStorage.getItem("userName"):setTimeout(()=>{i()},300)}N(()=>e.value.username,()=>{c()});function c(){if(window.localStorage.getItem("divisions").length>9){localStorage.clear(),d.value="\u6682\u65E0\u6743\u9650";return}e.value.username&&(e.value.password="123456",g.login(e.value).then(()=>{p.push({path:w.value||"/"})}).catch(()=>{_.value=!1,l.value&&m()}))}const v=o(""),_=o(!1),l=o(!0);o(!1);const w=o(void 0);function m(){y().then(a=>{l.value=a.captchaEnabled===void 0?!0:a.captchaEnabled,l.value&&(v.value="data:image/gif;base64,"+a.img,e.value.uuid=a.uuid)})}function h(){const a=u.get("username"),r=u.get("password"),s=u.get("rememberMe");e.value={username:a===void 0?e.value.username:a,password:r===void 0?e.value.password:O(r),rememberMe:s===void 0?!1:Boolean(s)}}return m(),h(),(a,r)=>(M(),B("div",j,[C("div",q,E(T(d)),1)]))}},$=S(z,[["__scopeId","data-v-d1caf053"]]);export{$ as default};
|