import{i}from"./http-f4d6e1af.js";import{r as s,o as c,c as f,a as e,t as r}from"./app-dd51f5ed.js";const o=e("h3",null,"流量补给",-1),u={key:0},d={key:1},h={name:"Sign",setup(_){const a=s({last_sign_at:null,traffic:0});i.get("user").then(t=>{a.value.traffic=t.data.traffic});function l(){i.post("traffic").then(t=>{a.value=t.data;let n=`获得了 ${t.data.traffic} GB 流量！`;t.data.traffic===0&&(n="没有获得流量～"),alert(n)}).finally(()=>{i.get("user").then(t=>{a.value.traffic=t.data.traffic}).finally(()=>{})})}return(t,n)=>(c(),f("div",null,[o,e("div",null,[e("p",null,"当前流量: "+r(a.value.traffic)+"GB",1),a.value.is_signed?(c(),f("div",u,"今日已签到")):(c(),f("div",d,[e("button",{class:"btn btn-primary",onClick:l},"试试手气")]))])]))}};export{h as default};
