zhuguifei
2025-06-17 c1cc49dd93d38f51790558541d6835d1598ecccf
1
2
3
import{m as t,n as e,d as r,r as n,o as s,a as i,g as a,f as o,t as h,i as u,e as c,w as f,k as l,b as _,_ as p}from"./index-CdSAAqTC.js";import{i as v}from"./index-B8zeLGbR.js";import{i as g}from"./ipcRenderer-CjF5QmVd.js";import{a as m}from"./index-C4oe9NZ0.js";var d,y,k,w,b,I={exports:{}};
/*! store2 - v2.14.4 - 2024-12-26
* Copyright (c) 2024 Nathan Bubna; Licensed MIT */d=I,y=t,k=t&&t.define,(b=(w={version:"2.14.4",areas:{},apis:{},nsdelim:".",inherit:function(t,e){for(var r in t)e.hasOwnProperty(r)||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},stringify:function(t,e){return void 0===t||"function"==typeof t?t+"":JSON.stringify(t,e||w.replace)},parse:function(t,e){try{return JSON.parse(t,e||w.revive)}catch(r){return t}},fn:function(t,e){for(var r in w.storeAPI[t]=e,w.apis)w.apis[r][t]=e},get:function(t,e){return t.getItem(e)},set:function(t,e,r){t.setItem(e,r)},remove:function(t,e){t.removeItem(e)},key:function(t,e){return t.key(e)},length:function(t){return t.length},clear:function(t){t.clear()},Store:function(t,e,r){var n=w.inherit(w.storeAPI,(function(t,e,r){return 0===arguments.length?n.getAll():"function"==typeof e?n.transact(t,e,r):void 0!==e?n.set(t,e,r):"string"==typeof t||"number"==typeof t?n.get(t):"function"==typeof t?n.each(t):t?n.setAll(t,e):n.clear()}));n._id=t;try{var s="__store2_test";e.setItem(s,"ok"),n._area=e,e.removeItem(s)}catch(i){n._area=w.storage("fake")}return n._ns=r||"",w.areas[t]||(w.areas[t]=n._area),w.apis[n._ns+n._id]||(w.apis[n._ns+n._id]=n),n},storeAPI:{area:function(t,e){var r=this[t];return r&&r.area||(r=w.Store(t,e,this._ns),this[t]||(this[t]=r)),r},namespace:function(t,e,r){if(r=r||this._delim||w.nsdelim,!t)return this._ns?this._ns.substring(0,this._ns.length-r.length):"";var n=t,s=this[n];if(!(s&&s.namespace||((s=w.Store(this._id,this._area,this._ns+n+r))._delim=r,this[n]||(this[n]=s),e)))for(var i in w.areas)s.area(i,w.areas[i]);return s},isFake:function(t){return t?(this._real=this._area,this._area=w.storage("fake")):!1===t&&(this._area=this._real||this._area),"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(t){return this._area.has?this._area.has(this._in(t)):!!(this._in(t)in this._area)},size:function(){return this.keys().length},each:function(t,e){for(var r=0,n=w.length(this._area);r<n;r++){var s=this._out(w.key(this._area,r));if(void 0!==s&&!1===t.call(this,s,this.get(s),e))break;n>w.length(this._area)&&(n--,r--)}return e||this},keys:function(t){return this.each((function(t,e,r){r.push(t)}),t||[])},get:function(t,e){var r,n=w.get(this._area,this._in(t));return"function"==typeof e&&(r=e,e=null),null!==n?w.parse(n,r):null!=e?e:n},getAll:function(t){return this.each((function(t,e,r){r[t]=e}),t||{})},transact:function(t,e,r){var n=this.get(t,r),s=e(n);return this.set(t,void 0===s?n:s),this},set:function(t,e,r){var n,s=this.get(t);return null!=s&&!1===r?e:("function"==typeof r&&(n=r,r=void 0),w.set(this._area,this._in(t),w.stringify(e,n),r)||s)},setAll:function(t,e){var r,n;for(var s in t)n=t[s],this.set(s,n,e)!==n&&(r=!0);return r},add:function(t,e,r){var n=this.get(t);if(n instanceof Array)e=n.concat(e);else if(null!==n){var s=typeof n;if(s===typeof e&&"object"===s){for(var i in e)n[i]=e[i];e=n}else e=n+e}return w.set(this._area,this._in(t),w.stringify(e,r)),e},remove:function(t,e){var r=this.get(t,e);return w.remove(this._area,this._in(t)),r},clear:function(){return this._ns?this.each((function(t){w.remove(this._area,this._in(t))}),1):w.clear(this._area),this},clearAll:function(){var t=this._area;for(var e in w.areas)w.areas.hasOwnProperty(e)&&(this._area=w.areas[e],this.clear());return this._area=t,this},_in:function(t){return"string"!=typeof t&&(t=w.stringify(t)),this._ns?this._ns+t:t},_out:function(t){return this._ns?t&&0===t.indexOf(this._ns)?t.substring(this._ns.length):void 0:t}},storage:function(t){return w.inherit(w.storageAPI,{items:{},name:t})},storageAPI:{length:0,has:function(t){return this.items.hasOwnProperty(t)},key:function(t){var e=0;for(var r in this.items)if(this.has(r)&&t===e++)return r},setItem:function(t,e){this.has(t)||this.length++,this.items[t]=e},removeItem:function(t){this.has(t)&&(delete this.items[t],this.length--)},getItem:function(t){return this.has(t)?this.items[t]:null},clear:function(){for(var t in this.items)this.removeItem(t)}}}).Store("local",function(){try{return localStorage}catch(t){}}())).local=b,b._=w,b.area("session",function(){try{return sessionStorage}catch(t){}}()),b.area("page",w.storage("page")),"function"==typeof k&&void 0!==k.amd?k("store2",[],(function(){return b})):d.exports?d.exports=b:(y.store&&(w.conflict=y.store),y.store=b);const S=e(I.exports),A={id:"app-socket-http"},x={class:"one-block-2"},O={class:"one-block-2"},P=p(r({__name:"HttpServer",setup(t){const e=n("关闭"),r=n("无");function p(t){"关闭"!=e.value?function(t,e){const r=S.get("httpServiceConfig"),n=(r.server||"http://localhost:7071")+"/"+t;console.log("url:",n),m({url:n,method:"post",data:e,timeout:6e4})}(v.framework.doHttpRequest,{id:t}):l.error("http服务未开启")}return s((()=>{g.invoke(v.framework.checkHttpServer,{}).then((t=>{t.enable&&(e.value="开启",r.value=t.server,S.set("httpServiceConfig",t))}))})),(t,n)=>{const s=i("a-button");return _(),a("div",A,[n[6]||(n[6]=o("div",{class:"one-block-1"},[o("span",null," 1. 使用http与主进程通信 ")],-1)),o("div",x,[o("p",null,"* 状态:"+h(e.value),1),o("p",null,"* 地址:"+h(r.value),1),o("p",null,[n[3]||(n[3]=u("* 发送请求: ")),c(s,{onClick:n[0]||(n[0]=t=>p("pictures"))},{default:f((()=>n[2]||(n[2]=[u(" 打开【我的图片】 ")]))),_:1})])]),n[7]||(n[7]=o("div",{class:"one-block-1"},[o("span",null," 2. 使用http与服务端通信 ")],-1)),o("div",O,[o("p",null,[c(s,{onClick:n[1]||(n[1]=t=>(console.log("GO_URL:","http://www.test.com"),void m({baseURL:"http://www.test.com",method:"get",url:"/hello",timeout:3e3}).then((t=>{console.log("res:",t);const e=t.data||null;l.info(`go服务返回: ${e}`)}))))},{default:f((()=>n[4]||(n[4]=[u(" 发送请求 ")]))),_:1}),n[5]||(n[5]=u(" (请自行创建服务) "))])])])}}}),[["__scopeId","data-v-fe493b70"],["__file","/Users/gsx/www/gofile/src/ee/ee-demo-ts/frontend/src/views/framework/socket/HttpServer.vue"]]);export{P as default};