This commit is contained in:
gaoshuaixing
2023-07-06 13:58:07 +08:00
parent f9fbbc4c95
commit e8623d7931
12 changed files with 20 additions and 20 deletions

View File

@@ -1,10 +1,10 @@
import Vue from 'vue'
import antd from 'ant-design-vue'
import antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.less';
import App from './App'
import router from './router'
import { VueAxios } from './utils/request'
import { ipc } from '@/utils/ipcRenderer'
import Vue from 'vue';
import App from './App';
import router from './router';
import { ipc } from './utils/ipcRenderer';
import { VueAxios } from './utils/request';
// 使用antd
Vue.use(antd)

View File

@@ -27,7 +27,7 @@ const ipc = Renderer.ipcRenderer || undefined;
*/
const isEE = ipc ? true : false;
export default {
export {
Renderer, ipc, isEE
}
};

View File

@@ -4,4 +4,4 @@
::-webkit-scrollbar-track{background:0 0}
::-webkit-scrollbar-thumb{background:#E6FFEE;-webkit-transition:.3s;transition:.3s}
::-webkit-scrollbar-thumb:hover{background-color:#07C160}
::-webkit-scrollbar-thumb:active{background-color:#07C160}</style><link href="css/chunk-09b6db32.420fdb6d.css" rel="prefetch"><link href="css/chunk-0b695420.01116c37.css" rel="prefetch"><link href="css/chunk-0c3ec28a.57f7ab37.css" rel="prefetch"><link href="css/chunk-1ac5e88a.4a15bba1.css" rel="prefetch"><link href="css/chunk-1caa1be6.198b3d4f.css" rel="prefetch"><link href="css/chunk-2bb45275.7b3b5479.css" rel="prefetch"><link href="css/chunk-2c1b05fb.c240d69c.css" rel="prefetch"><link href="css/chunk-2ed2f5b2.4abd2c84.css" rel="prefetch"><link href="css/chunk-31638db2.dd7e28b0.css" rel="prefetch"><link href="css/chunk-41d5921a.3febd410.css" rel="prefetch"><link href="css/chunk-4508ae8b.32cffba8.css" rel="prefetch"><link href="css/chunk-45af09d4.38508275.css" rel="prefetch"><link href="css/chunk-5c6e7977.3a28c15a.css" rel="prefetch"><link href="css/chunk-5c9637cf.0e8925eb.css" rel="prefetch"><link href="css/chunk-68d57b43.2dda727d.css" rel="prefetch"><link href="css/chunk-69fb44ca.f714bef4.css" rel="prefetch"><link href="css/chunk-6b482e42.e21cb584.css" rel="prefetch"><link href="css/chunk-72ffb39f.af4f6a12.css" rel="prefetch"><link href="css/chunk-c19bf770.80cd7ae2.css" rel="prefetch"><link href="css/chunk-e16c8452.c241bcac.css" rel="prefetch"><link href="css/chunk-ec5e0b1e.8389c666.css" rel="prefetch"><link href="js/chunk-09b6db32.78adb757.js" rel="prefetch"><link href="js/chunk-0b695420.a3fd2f88.js" rel="prefetch"><link href="js/chunk-0c3ec28a.9aad6973.js" rel="prefetch"><link href="js/chunk-1ac5e88a.8235ec8e.js" rel="prefetch"><link href="js/chunk-1caa1be6.7d0684f9.js" rel="prefetch"><link href="js/chunk-2bb45275.f4608420.js" rel="prefetch"><link href="js/chunk-2c1b05fb.a967f24b.js" rel="prefetch"><link href="js/chunk-2ed2f5b2.5a19baa0.js" rel="prefetch"><link href="js/chunk-31638db2.0e39434a.js" rel="prefetch"><link href="js/chunk-41d5921a.f0a16fa7.js" rel="prefetch"><link href="js/chunk-4508ae8b.909c575f.js" rel="prefetch"><link href="js/chunk-45af09d4.86f080bb.js" rel="prefetch"><link href="js/chunk-5c6e7977.fe68e3ca.js" rel="prefetch"><link href="js/chunk-5c9637cf.044e9bf5.js" rel="prefetch"><link href="js/chunk-68d57b43.4691343a.js" rel="prefetch"><link href="js/chunk-69fb44ca.4e8421b3.js" rel="prefetch"><link href="js/chunk-6b482e42.1ca10db8.js" rel="prefetch"><link href="js/chunk-72ffb39f.07568d94.js" rel="prefetch"><link href="js/chunk-c19bf770.844b9dd3.js" rel="prefetch"><link href="js/chunk-e16c8452.17d51e99.js" rel="prefetch"><link href="js/chunk-ec5e0b1e.14969463.js" rel="prefetch"><link href="js/chunk-ef5c6832.7db6bab4.js" rel="prefetch"><link href="css/app.8ada1737.css" rel="preload" as="style"><link href="css/chunk-vendors.f4913a35.css" rel="preload" as="style"><link href="js/app.62fa9244.js" rel="preload" as="script"><link href="js/chunk-vendors.20126134.js" rel="preload" as="script"><link href="css/chunk-vendors.f4913a35.css" rel="stylesheet"><link href="css/app.8ada1737.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but it doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.20126134.js"></script><script src="js/app.62fa9244.js"></script></body></html>
::-webkit-scrollbar-thumb:active{background-color:#07C160}</style><link href="css/chunk-09b6db32.420fdb6d.css" rel="prefetch"><link href="css/chunk-0b695420.01116c37.css" rel="prefetch"><link href="css/chunk-0c3ec28a.57f7ab37.css" rel="prefetch"><link href="css/chunk-1ac5e88a.4a15bba1.css" rel="prefetch"><link href="css/chunk-1caa1be6.198b3d4f.css" rel="prefetch"><link href="css/chunk-2bb45275.7b3b5479.css" rel="prefetch"><link href="css/chunk-2c1b05fb.c240d69c.css" rel="prefetch"><link href="css/chunk-2ed2f5b2.4abd2c84.css" rel="prefetch"><link href="css/chunk-31638db2.dd7e28b0.css" rel="prefetch"><link href="css/chunk-41d5921a.3febd410.css" rel="prefetch"><link href="css/chunk-4508ae8b.32cffba8.css" rel="prefetch"><link href="css/chunk-45af09d4.38508275.css" rel="prefetch"><link href="css/chunk-5c6e7977.3a28c15a.css" rel="prefetch"><link href="css/chunk-5c9637cf.0e8925eb.css" rel="prefetch"><link href="css/chunk-68d57b43.2dda727d.css" rel="prefetch"><link href="css/chunk-69fb44ca.f714bef4.css" rel="prefetch"><link href="css/chunk-6b482e42.e21cb584.css" rel="prefetch"><link href="css/chunk-72ffb39f.af4f6a12.css" rel="prefetch"><link href="css/chunk-c19bf770.80cd7ae2.css" rel="prefetch"><link href="css/chunk-e16c8452.c241bcac.css" rel="prefetch"><link href="css/chunk-ec5e0b1e.8389c666.css" rel="prefetch"><link href="js/chunk-09b6db32.78adb757.js" rel="prefetch"><link href="js/chunk-0b695420.a3fd2f88.js" rel="prefetch"><link href="js/chunk-0c3ec28a.9aad6973.js" rel="prefetch"><link href="js/chunk-1ac5e88a.8235ec8e.js" rel="prefetch"><link href="js/chunk-1caa1be6.7d0684f9.js" rel="prefetch"><link href="js/chunk-2bb45275.f4608420.js" rel="prefetch"><link href="js/chunk-2c1b05fb.a967f24b.js" rel="prefetch"><link href="js/chunk-2ed2f5b2.5a19baa0.js" rel="prefetch"><link href="js/chunk-31638db2.0e39434a.js" rel="prefetch"><link href="js/chunk-41d5921a.f0a16fa7.js" rel="prefetch"><link href="js/chunk-4508ae8b.909c575f.js" rel="prefetch"><link href="js/chunk-45af09d4.86f080bb.js" rel="prefetch"><link href="js/chunk-5c6e7977.fe68e3ca.js" rel="prefetch"><link href="js/chunk-5c9637cf.044e9bf5.js" rel="prefetch"><link href="js/chunk-68d57b43.4691343a.js" rel="prefetch"><link href="js/chunk-69fb44ca.4e8421b3.js" rel="prefetch"><link href="js/chunk-6b482e42.6160e42f.js" rel="prefetch"><link href="js/chunk-72ffb39f.07568d94.js" rel="prefetch"><link href="js/chunk-c19bf770.844b9dd3.js" rel="prefetch"><link href="js/chunk-e16c8452.17d51e99.js" rel="prefetch"><link href="js/chunk-ec5e0b1e.d9fff16a.js" rel="prefetch"><link href="js/chunk-ef5c6832.7db6bab4.js" rel="prefetch"><link href="css/app.8ada1737.css" rel="preload" as="style"><link href="css/chunk-vendors.f4913a35.css" rel="preload" as="style"><link href="js/app.3954b134.js" rel="preload" as="script"><link href="js/chunk-vendors.8b83a546.js" rel="preload" as="script"><link href="css/chunk-vendors.f4913a35.css" rel="stylesheet"><link href="css/app.8ada1737.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but it doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.8b83a546.js"></script><script src="js/app.3954b134.js"></script></body></html>

File diff suppressed because one or more lines are too long

1
public/dist/js/app.3954b134.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b482e42"],{"23ba":function(e,n,t){"use strict";t.r(n);var s=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{attrs:{id:"app-base-socket-ipc"}},[e._m(0),t("div",{staticClass:"one-block-2"},[t("a-space",[t("a-button",{on:{click:e.handleInvoke}},[e._v("发送 - 回调")]),e._v(" 结果:"+e._s(e.message1)+" ")],1),t("p"),t("a-space",[t("a-button",{on:{click:e.handleInvoke2}},[e._v("发送 - async/await")]),e._v(" 结果:"+e._s(e.message2)+" ")],1)],1),e._m(1),t("div",{staticClass:"one-block-2"},[t("a-space",[t("a-button",{on:{click:e.handleSendSync}},[e._v("同步消息")]),e._v(" 结果:"+e._s(e.message3)+" ")],1)],1),e._m(2),t("div",{staticClass:"one-block-2"},[t("a-space",[t("a-button",{on:{click:e.sendMsgStart}},[e._v("开始")]),t("a-button",{on:{click:e.sendMsgStop}},[e._v("结束")]),e._v(" 结果:"+e._s(e.messageString)+" ")],1)],1),e._m(3),t("div",{staticClass:"one-block-2"},[t("a-space",[t("a-button",{on:{click:function(n){return e.createWindow(0)}}},[e._v("打开新窗口2")]),t("a-button",{on:{click:function(n){return e.sendTosubWindow()}}},[e._v("向新窗口2发消息")])],1)],1)])},i=[function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"one-block-1"},[t("span",[e._v(" 1. 发送异步消息 ")])])},function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"one-block-1"},[t("span",[e._v(" 2. 同步消息(不推荐,阻塞执行) ")])])},function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"one-block-1"},[t("span",[e._v(" 3. 长消息: 服务端持续向前端页面发消息 ")])])},function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"one-block-1"},[t("span",[e._v(" 4. 多窗口通信:子窗口与主进程通信,子窗口互相通信 ")])])}],c=t("1da1"),o=(t("96cf"),t("a358")),a={data:function(){return{messageString:"",message1:"",message2:"",message3:"",windowName:"window-ipc",newWcId:0,views:[{type:"vue",content:"#/special/subwindow",windowName:"window-ipc",windowTitle:"ipc window"}]}},mounted:function(){this.init()},methods:{init:function(){var e=this;this.$ipc.removeAllListeners(o["a"].ipcSendMsg),this.$ipc.on(o["a"].ipcSendMsg,(function(n,t){console.log("[ipcRenderer] [socketMsgStart] result:",t),e.messageString=t,n.sender.send(o["a"].hello,"electron-egg")})),this.$ipc.removeAllListeners(o["c"].window2ToWindow1),this.$ipc.on(o["c"].window2ToWindow1,(function(n,t){e.$message.info(t)}))},sendMsgStart:function(){var e={type:"start",content:"开始"};this.$ipc.send(o["a"].ipcSendMsg,e)},sendMsgStop:function(){var e={type:"end",content:""};this.$ipc.send(o["a"].ipcSendMsg,e)},handleInvoke:function(){var e=this;this.$ipc.invoke(o["a"].ipcInvokeMsg,"异步-回调").then((function(n){console.log("r:",n),e.message1=n}))},handleInvoke2:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$ipc.invoke(o["a"].ipcInvokeMsg,"异步");case 2:t=n.sent,console.log("msg:",t),e.message2=t;case 5:case"end":return n.stop()}}),n)})))()},handleSendSync:function(){var e=this.$ipc.sendSync(o["a"].ipcSendSyncMsg,"同步");this.message3=e},createWindow:function(e){this.$ipc.invoke(o["a"].createWindow,this.views[e]).then((function(e){console.log("[createWindow] id:",e)}))},sendTosubWindow:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$ipc.invoke(o["a"].getWCid,e.windowName);case 2:e.newWcId=n.sent,e.$ipc.sendTo(e.newWcId,o["c"].window1ToWindow2,"窗口1通过 sendTo 给窗口2发送消息");case 4:case"end":return n.stop()}}),n)})))()}}},r=a,d=(t("9c4c"),t("2877")),u=Object(d["a"])(r,s,i,!1,null,"a8bb976a",null);n["default"]=u.exports},"9c4c":function(e,n,t){"use strict";t("f038")},f038:function(e,n,t){}}]);
//# sourceMappingURL=chunk-6b482e42.1ca10db8.js.map
//# sourceMappingURL=chunk-6b482e42.6160e42f.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ec5e0b1e"],{"4b7c":function(n,e,s){},"7a64":function(n,e,s){"use strict";s.r(e);var t=function(){var n=this,e=n.$createElement,s=n._self._c||e;return s("div",{attrs:{id:"app-base-subwindow-ipc"}},[n._m(0),s("div",{staticClass:"one-block-2"},[s("a-space",[s("a-button",{on:{click:n.handleInvoke}},[n._v("发送 - 回调")]),n._v(" 结果:"+n._s(n.message1)+" ")],1),s("p"),s("a-space",[s("a-button",{on:{click:n.handleInvoke2}},[n._v("发送 - async/await")]),n._v(" 结果:"+n._s(n.message2)+" ")],1)],1),n._m(1),s("div",{staticClass:"one-block-2"},[s("a-space",[s("a-button",{on:{click:n.handleSendSync}},[n._v("同步消息")]),n._v(" 结果:"+n._s(n.message3)+" ")],1)],1),n._m(2),s("div",{staticClass:"one-block-2"},[s("a-space",[s("a-button",{on:{click:n.sendMsgStart}},[n._v("开始")]),s("a-button",{on:{click:n.sendMsgStop}},[n._v("结束")]),n._v(" 结果:"+n._s(n.messageString)+" ")],1)],1),n._m(3),s("div",{staticClass:"one-block-2"},[s("a-space",[s("a-button",{on:{click:function(e){return n.sendTosubWindow()}}},[n._v("向主窗口发消息")])],1)],1)])},i=[function(){var n=this,e=n.$createElement,s=n._self._c||e;return s("div",{staticClass:"one-block-1"},[s("span",[n._v(" 1. 发送异步消息 ")])])},function(){var n=this,e=n.$createElement,s=n._self._c||e;return s("div",{staticClass:"one-block-1"},[s("span",[n._v(" 2. 同步消息(不推荐,阻塞执行) ")])])},function(){var n=this,e=n.$createElement,s=n._self._c||e;return s("div",{staticClass:"one-block-1"},[s("span",[n._v(" 3. 长消息: 服务端持续向前端页面发消息 ")])])},function(){var n=this,e=n.$createElement,s=n._self._c||e;return s("div",{staticClass:"one-block-1"},[s("span",[n._v(" 4. 多窗口通信:窗口之间互相通信 ")])])}],c=s("1da1"),a=(s("96cf"),s("a358")),o={data:function(){return{messageString:"",message1:"",message2:"",message3:"",mainWCid:0}},mounted:function(){this.init()},methods:{init:function(){var n=this,e=this;this.$ipc.removeAllListeners(a["a"].ipcSendMsg),this.$ipc.on(a["a"].ipcSendMsg,(function(n,s){console.log("[ipcRenderer] [socketMsgStart] result:",s),e.messageString=s,n.sender.send(a["a"].hello,"electron-egg")})),this.$ipc.removeAllListeners(a["c"].window1ToWindow2),this.$ipc.on(a["c"].window1ToWindow2,(function(e,s){n.$message.info(s)}))},sendMsgStart:function(){var n={type:"start",content:"开始"};this.$ipc.send(a["a"].ipcSendMsg,n)},sendMsgStop:function(){var n={type:"end",content:""};this.$ipc.send(a["a"].ipcSendMsg,n)},handleInvoke:function(){var n=this;this.$ipc.invoke(a["a"].ipcInvokeMsg,"异步-回调").then((function(e){console.log("r:",e),n.message1=e}))},handleInvoke2:function(){var n=this;return Object(c["a"])(regeneratorRuntime.mark((function e(){var s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.$ipc.invoke(a["a"].ipcInvokeMsg,"异步");case 2:s=e.sent,console.log("msg:",s),n.message2=s;case 5:case"end":return e.stop()}}),e)})))()},handleSendSync:function(){var n=this.$ipc.sendSync(a["a"].ipcSendSyncMsg,"同步");this.message3=n},sendTosubWindow:function(){var n=this;this.$ipc.invoke(a["a"].getWCid,"main").then((function(e){n.mainWCid=e,n.$ipc.sendTo(n.mainWCid,a["c"].window2ToWindow1,"窗口2 通过 sendTo 给主窗口发送消息")}))}}},r=o,d=(s("803e"),s("2877")),l=Object(d["a"])(r,t,i,!1,null,"59c87dd9",null);e["default"]=l.exports},"803e":function(n,e,s){"use strict";s("4b7c")}}]);
//# sourceMappingURL=chunk-ec5e0b1e.14969463.js.map
//# sourceMappingURL=chunk-ec5e0b1e.d9fff16a.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long