import{av as V,aw as g,$ as c,aj as _,s as i,k,j as u,o as l,w as e,d as a,l as y,B as d,q as C,t as f,C as m,z as h,i as x,al as B,M as T,x as w,y as N}from"./index-BBhBboPS.js";import{V as S,a as j}from"./VRow-DPRU2lkb.js";import{V as R}from"./VContainer-CvKHPctk.js";const b={__name:"authorize",setup(q){const p=V(),n=g(),s=c("processing"),r=c("正在验证授权信息...");_(async()=>{try{const t=p.query.token;if(!t){s.value="error",r.value="未获取到授权令牌";return}i("server.kvToken",t);const o=k("device.uuid");o&&o!=="00000000-0000-4000-8000-000000000000"?(i("device.uuid","00000000-0000-4000-8000-000000000000"),r.value="授权成功！已完成数据迁移。"):r.value="授权成功！",s.value="success",n.push("/")}catch(t){console.error("授权处理失败:",t),s.value="error",r.value=`授权失败: ${t.message}`}});const v=()=>{n.push("/")};return(t,o)=>(l(),u(R,{class:"fill-height",fluid:""},{default:e(()=>[a(S,{align:"center",justify:"center"},{default:e(()=>[a(j,{cols:"12",md:"6",sm:"8"},{default:e(()=>[a(y,null,{default:e(()=>[a(C,{class:"text-h5"},{default:e(()=>[f(m(s.value==="processing"?"正在处理授权...":s.value==="success"?"授权成功":"授权失败"),1)]),_:1}),a(h,null,{default:e(()=>[s.value==="processing"?(l(),u(B,{key:0,class:"mb-4",color:"primary",indeterminate:""})):d("",!0),x("p",null,m(r.value),1)]),_:1}),s.value!=="processing"?(l(),u(T,{key:0},{default:e(()=>[a(w),a(N,{color:"primary",onClick:v},{default:e(()=>[...o[0]||(o[0]=[f("返回首页",-1)])]),_:1})]),_:1})):d("",!0)]),_:1})]),_:1})]),_:1})]),_:1}))}};export{b as default};
