import{g as e,s as t,r as a,u as s,a as o,b as n,c as r,d as c,w as i,i as u,o as l,e as d,f as p,t as g,h}from"./index-C0ioWTxp.js";import{r as f}from"./resources.DipqUmnN.js";import{_ as k}from"./_plugin-vue_export-helper.BCo6x5W8.js";const y=k({data:()=>({startup:f.startup.main,title:"",token:""}),onLoad(){if(e("isUpdate"))return;const s=e("launchFlag"),o=e("token")||"";console.log(s,999),s?(alert(1),o?t({url:"/pages/index/index"}):a({url:"/pages/login/index"})):(alert(2),o?(alert(3),t({url:"/pages/index/index"})):(localStorage.getItem("hasLogin")||(alert(4),a({url:"/pages/login/qywxLogin"})),this.$route.query.code&&(alert(5),localStorage.setItem("auth_code",this.$route.query.code),this.getToken())))},methods:{getToken:function(){const e=this,a=s(),n={nonPassword:"nonPassword",grant_type:"password",code:this.$route.query.code};o({url:"https://dj.ccnu.edu.cn/api/oauth/wechat/getToken",data:JSON.stringify(n),method:"POST",success:function(s){alert("res:"+s.data.data+"code:"+e.$route.query.code),e.title=e.$route.query.code,a.setToken(token),a.getCurrentUser().then((e=>{t({url:"/pages/index/index"})})).catch((()=>{}))}})},copy:function(){n({data:this.$route.query.code,success:()=>{r({title:"倍刢成功",duration:2e3,icon:"success"})}})}}},[["render",function(e,t,a,s,o,n){const r=h,f=u;return l(),c(f,{class:"launch-v"},{default:i((()=>[d(r,{class:"title",onClick:n.copy},{default:i((()=>[p(g(o.title),1)])),_:1},8,["onClick"]),d(r,{class:"title",onClick:n.copy},{default:i((()=>[p(g(o.token),1)])),_:1},8,["onClick"])])),_:1})}],["__scopeId","data-v-57a4818d"]]);export{y as default};