import{_ as e,i as l,a as s,l as a,b as o,o as t,c as n,f as i,e as r,w as c,h as d,p as u,k}from"./index-4c6e30ca.js";const p={data:()=>({type:1,serverUrl:""}),methods:{info(){l.invoke(s.crossInfo,{}).then((e=>{console.log("res:",e)}))},getUrl(){l.invoke(s.getCrossUrl,{name:"goapp"}).then((e=>{this.serverUrl=e,this.$message.info(`服务地址: ${e}`)}))},kill(){l.invoke(s.killCrossServer,{type:"one",name:"goapp"})},killAll(){l.invoke(s.killCrossServer,{type:"all",name:"goapp"})},create(){l.invoke(s.createCrossServer,{program:"go"})},request(e){if(1!=e||""!=this.serverUrl)if(1==e){const e=this.serverUrl+"/api/hello";a({method:"get",url:e,params:{id:"111"},timeout:1e3}).then((e=>{console.log("res:",e);const l=e.data.data||null;this.$message.info(`服务返回: ${l}`)}))}else l.invoke(s.requestApi,{name:"goapp",urlPath:"/api/hello"}).then((e=>{console.log("res:",e);const l=e.data||null;this.$message.info(`服务返回: ${l}`)}));else this.$message.info("请先获取服务地址")}}},f=e=>(u("data-v-e1875343"),e=e(),k(),e),v={id:"app-cross-go"},g=f((()=>i("div",{class:"one-block-1"},[i("span",null," 1. 基础控制 ")],-1))),h={class:"one-block-2"},m=f((()=>i("div",{class:"one-block-1"},[i("span",null," 2. 发送http请求 ")],-1))),_={class:"one-block-2"},C=f((()=>i("div",{class:"one-block-1"},[i("span",null," 3. 多个服务 ")],-1))),b={class:"one-block-2"};const U=e(p,[["render",function(e,l,s,a,u,k){const p=o("a-button"),f=o("a-space");return t(),n("div",v,[g,i("div",h,[r(f,null,{default:c((()=>[r(p,{onClick:l[0]||(l[0]=e=>k.create())},{default:c((()=>[d(" 启动 ")])),_:1}),r(p,{onClick:l[1]||(l[1]=e=>k.getUrl())},{default:c((()=>[d(" 获取地址 ")])),_:1}),r(p,{onClick:l[2]||(l[2]=e=>k.kill())},{default:c((()=>[d(" kill ")])),_:1}),r(p,{onClick:l[3]||(l[3]=e=>k.info())},{default:c((()=>[d(" test ")])),_:1})])),_:1})]),m,i("div",_,[r(f,null,{default:c((()=>[r(p,{onClick:l[4]||(l[4]=e=>k.request(1))},{default:c((()=>[d(" 前端发送 ")])),_:1}),r(p,{onClick:l[5]||(l[5]=e=>k.request(2))},{default:c((()=>[d(" 主进程发送 ")])),_:1})])),_:1})]),C,i("div",b,[r(f,null,{default:c((()=>[r(p,{onClick:l[6]||(l[6]=e=>k.create())},{default:c((()=>[d(" 启动 ")])),_:1}),r(p,{onClick:l[7]||(l[7]=e=>k.killAll())},{default:c((()=>[d(" kill所有 ")])),_:1})])),_:1})])])}],["__scopeId","data-v-e1875343"]]);export{U as default};
