PageSourceSearch

https://vapps-res.media.io/mediaai/_nuxt/test-vapi-ip-BnesH2Mw.js

js media.io collected 2026-10-01 10:23:10 UTC 2,777 bytes, 1 lines download raw bytes

1import{E as S,j as C,G as R}from"./CkuPa5Yr.js";import{d as E,c as f,O as w,r as p,o as P,y as n,z as a,A as e,J as y,D as t,E as i}from"./chunk-vue-TRwxe8i9.js";import"./chunk-pinia-DfnRCC0j.js";import"./chunk-i18n-CEBPY5W3.js";import"./chunk-alioss-Co3x7qJ6.js";import"./chunk-fabric-NyCWrAO1.js";const B={class:"p-8"},D={class:"space-y-4"},L={class:"border p-4 rounded"},N={key:0,class:"text-blue-600"},A={key:1,class:"text-red-600"},G={key:2,class:"text-green-600"},I={class:"bg-gray-100 p-2 rounded text-sm"},J={class:"border p-4 rounded"},O={key:0,class:"text-blue-600"},U={key:1,class:"text-red-600"},V={key:2,class:"text-green-600"},q={class:"bg-gray-100 p-2 rounded text-sm"},z={class:"border p-4 rounded bg-blue-50"},M={class:"text-sm"},T={class:"text-blue-700"},$={class:"border p-4 rounded"},j=["disabled"],F=["disabled"],se=E({__name:"test-vapi-ip",async setup(H){let l,m;const g=S(),r=f(()=>g.query.ip),h=f(()=>{const o={};return r.value&&(o.ip=r.value),o}),{data:x,pending:_,error:b,refresh:k}=([l,m]=w(()=>R("/v1/common/ip",{method:"GET",params:h.value,server:!0,lazy:!1})),l=await l,m(),l),d=p(null),c=p(!1),u=p(""),v=async()=>{c.value=!0,u.value="",d.value=null;try{const o={};r.value&&(o.ip=r.value);const s=await $fetch("/v1/common/ip",{baseURL:C().public.ApiBase,method:"GET",params:o});d.value=s}catch(o){u.value=o.message||"请求失败",console.error("[客户端请求错误]",o)}finally{c.value=!1}};return P(()=>{v()}),(o,s)=>(a(),n("div",B,[s[6]||(s[6]=e("h1",{class:"text-2xl font-bold mb-4"},"IP 查询测试页面",-1)),e("div",D,[e("div",L,[s[1]||(s[1]=e("h2",{class:"text-xl mb-2 font-semibold"},"SSR 请求结果 (Setup)",-1)),t(_)?(a(),n("div",N,"加载中...")):t(b)?(a(),n("div",A," 错误: "+i(t(b).message),1)):t(x)?(a(),n("div",G,[e("pre",I,i(JSON.stringify(t(x),null,2)),1)])):y("",!0)]),e("div",J,[s[2]||(s[2]=e("h2",{class:"text-xl mb-2 font-semibold"},"客户端请求结果 (onMounted)",-1)),t(c)?(a(),n("div",O,"加载中...")):t(u)?(a(),n("div",U," 错误: "+i(t(u)),1)):t(d)?(a(),n("div",V,[e("pre",q,i(JSON.stringify(t(d),null,2)),1)])):y("",!0)]),e("div",z,[s[4]||(s[4]=e("h2",{class:"text-xl mb-2 font-semibold"},"URL 参数",-1)),e("p",M,[s[3]||(s[3]=e("span",{class:"font-medium"},"IP 参数:",-1)),e("span",T,i(t(r)||"(未传入)"),1)]),s[5]||(s[5]=e("p",{class:"text-xs text-gray-600 mt-2"}," 提示: 可以在 URL 中添加 ?ip=xxx.xxx.xxx.xxx 参数来查询指定 IP ",-1))]),e("div",$,[e("button",{class:"bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 mr-2",disabled:t(_),onClick:s[0]||(s[0]=K=>t(k)())}," 刷新 SSR 数据 ",8,j),e("button",{class:"bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600",disabled:t(c),onClick:v}," 重新请求客户端数据 ",8,F)])])]))}});export{se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.