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