dromara / electron-egg Goto Github PK
View Code? Open in Web Editor NEWA simple, cross platform, enterprise desktop software development framework
Home Page: https://www.kaka996.com
License: Apache License 2.0
A simple, cross platform, enterprise desktop software development framework
Home Page: https://www.kaka996.com
License: Apache License 2.0
在electron文件夹下的utils文件夹的foo.js里有一个数组barList用于在服务端缓存着一些数据库的数据,希望在服务端一启动时就从数据库中拿到数据并记录在这个barList中,但是同在服务端里,如何在foo.js中去查询数据库并得到返回的结果?
建议增加sqllite的加密支持,例如better-sqlite3-sqlcipher
内置socket服务如何推送消息给浏览器等客户端
什么时候整一版electron+midwayjs+vue2的?
请教一下,看到框架内有加载chrome插件的代码和目录
代码【\electron\addon\chromeExtension\index.js】
目录【\build\extraResources\chromeExtension】
配置【\electron\config\config.default.js】
现在想请教下如何加载vue-devtools这个插件呢。下面是我做的尝试
1、配置中打开了chromeExtension:enable:true
2、拓展目录中我放了解压后的插件【olofadcdnkkjdfgjcmjaadnlehnnihnl】,子文件夹是【6.5.0_0】这是版本号吧。我把【6.5.0_0】下的内容都复制到【olofadcdnkkjdfgjcmjaadnlehnnihnl】目录下了。
3、在vue项目加载后通过$ipc调用了,我写的一个加载方法,就是调用了下this.app.addon.chromeExtension.create()。最终效果没有报错日志了,也打印日志[addon:chromeExtension] extensionPath:xxxx了
调用this.app.addon.chromeExtension.create()遇到的报错
1、通过删除插件中manifest.json的相关配置项解决
Unrecognized manifest key 'browser_action'.
Unrecognized manifest key 'update_url'.
2、修改插件中_metadata为metadata解决
Cannot load extension with file or directory name metadata. Filenames starting with "" are reserved for use by the system.
相关版本:由于要兼容win7,用的老的版本
node:12.9.1
electron": 12.2.3
electron-builder: 22.10.5
electron-rebuild: 2.3.4
翻遍了文档,没找到相关说明,至今没有解决,万请解答~~
如题,尝试在egg controller里获取ipcMain模块和electron主进程通讯,无效,获取的ipcMain是undefined,在egg里直接require electron,返回结果是electron.exe,所以无法加载其子模块,有什么解决方案么
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.16.1
使用问题反馈:
Mac(Big Sur 11.6.1) 对网站生成dmg 安装之后 打开应用 关闭应用之后 底栏EE图标还在 并且右键 点击quit 也不行 必须强制退出(force quit)才行
不知是什么原因?
首先感谢开源, ee对于初学者来说是一个封装非常好的electron框架。
请教下如何实现多窗口? 如何实现多进程(比如后台的服务进程)?
麻烦添加使用remoteUrl的同时使用egg的功能
npm警告已弃用[email protected]:请使用@aelectron/aar向前移动。没有API更改,只有包名称更改
npm警告已弃用[email protected]:请使用@electron/osx符号向前移动。注意API略有不同
问题反馈:
对vue项目 打包之后 运行 动态内容没有 静态内容倒是有 接口跨域导致
相当于 localhost域名 调用 foo.com/api/XXX 接口跨域导致 动态内容空白
而实际情况中 vue pc端访问的域名也是foo.com 所以没有跨域的问题
像这种情况 不知道有没办法解决呢?
老哥 开个B站 弄些教学视频吧! 能火
能否提供下随系统启动的功能?或是提供下解决思路,谢谢!
frontend目录下执行
npm run serve
OK
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.3.155:8080/
访问 http://localhost:8080/ 也是OK的
但是 根目录下 执行
npm run dev
生成的弹窗 空白页面 不停的转圈 不知何故
EE 确实是不错的项目,正在调研这个项目,请问会有端口占用问题吗,有的话应该怎么避免?
[email protected] build-l-arm64
electron-builder -l=deb --arm64
• electron-builder version=23.6.0 os=21.6.0
• loaded configuration file=package.json ("build" field)
• electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies
To ensure your native dependencies are always matched electron version, simply add script "postinstall": "electron-builder install-app-deps" to your
package.json`
• writing effective config file=out/builder-effective-config.yaml
• rebuilding native dependencies [email protected] platform=linux arch=arm64
• install prebuilt binary name=better-sqlite3 version=8.3.0 platform=linux arch=arm64 napi=
⨯ cannot build native dependency reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
cause=exit status 1
errorOut=prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install warn install prebuilt binaries enforced with --force!
prebuild-install warn install prebuilt binaries may be out of date!
prebuild-install info looking for local prebuild @ prebuilds/better-sqlite3-v8.3.0-electron-v109-linux-arm64.tar.gz
prebuild-install info looking for cached prebuild @ .../.npm/_prebuilds/3dbf98-better-sqlite3-v8.3.0-electron-v109-linux-arm64.tar.gz
prebuild-install http request GET https://github.com/WiseLibs/better-sqlite3/releases/download/v8.3.0/better-sqlite3-v8.3.0-electron-v109-linux-arm64.tar.gz
prebuild-install http 404 https://github.com/WiseLibs/better-sqlite3/releases/download/v8.3.0/better-sqlite3-v8.3.0-electron-v109-linux-arm64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=21.4.4 runtime=electron arch=arm64 libc= platform=linux)
command=.../node_modules/prebuild-install/bin.js' --platform=linux --arch=arm64 --target=21.4.4 --runtime=electron --verbose --force
workingDir=.../node_modules/better-sqlite3
目前发现版本3.4.0打包exe后网络请求里面没有携带cookie,导致前后端分离无法登陆
求一分react代码示例
默认情况下,使用JSON数据库,存储的数据在哪里,打包发布后,发现测试环境的数据还在😓
主要是想找到存储数据的json文件
打包前:项目根目录
electron-egg/data/xxx.json
语雀上面这个地方说的,自定义json文件,需要在什么地方关联吗?
望解答,谢谢Thanks♪(・ω・)ノ
有支持ts的计划么?
dmg打包,运行报错
Uncaught Exception:
AssertionError [ERR_ASSERTION]: Directory /Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/electron not exists
at new EeCore (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/node_modules/ee-core/core/lib/ee.js:26:5)
at new BaseApp (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/node_modules/ee-core/lib/baseApp.js:16:5)
at new EeApp (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/node_modules/ee-core/lib/eeApp.js:12:5)
at new Appliaction (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/node_modules/ee-core/lib/application.js:67:5)
at new Main (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/main.js:6:5)
at Object.<anonymous> (/Users/baor/Documents/js/electron-egg/out/mac/ee.app/Contents/Resources/app.asar/main.js:48:1)
at Module._compile (internal/modules/cjs/loader.js:1078:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
Utils.getExtraResourcesDir()在macos12平台打包后获取路径为/app/Contents/MacOS,但是我的资源不在MacOS路径下,而在/app/Contents/下面,如果把/app/Contents/MacOS改成/app/Contents就正常了,求修复
只要從config.default.js 將 tray enable 設定成 false 就會噴錯
2023-06-02 13:57:55,380 ERROR 38532 nodejs.unhandledRejectionError: Addon class 'tray' not exists or do not call directly at the top!
at Object.get (D:\electron-egg-master\node_modules\ee-core\addon\index.js:28:13)
at D:\electron-egg-master\electron\preload\index.js:12:10
at AppLoader.loadFile (D:\electron-egg-master\node_modules\ee-core\core\lib\loader\ee_loader.js:259:13)
at Index._loderPreload (D:\electron-egg-master\node_modules\ee-core\ee\eeApp.js:216:33)
at Index.createWindow (D:\electron-egg-master\node_modules\ee-core\ee\eeApp.js:85:16)
name: "unhandledRejectionError"
希望添加跟浏览器一样的视频解码器(例如MP4类型视频浏览器支持的通过框架打包exe之后不支持画面播放只有声音。),否者自己手动添加太麻烦。
electron part
ee-core rd --dist_dir=./frontend/dist
建议检查下public\dist是否存在,不存在则新建public\dist,现在是报错
public\dist目录有时候不想放在git中提交
发觉应用会自动在用户目录下建一个的目录,想修改这个目录位置到userData目录下,Electron通过getPath('userData')可以得到:
Mac OS: ~/Library/Application Support/<Your App Name (taken from the name property in package.json)>
Windows: C:\Users<you>\AppData\Local<Your App Name>
Linux: ~/.config/
但直接修改storage.js,在其中require('electron')会返回一个electron的可执行文件的string path,比如“/Users/xx/Documents/node_projects/xxx/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron”,而不是electron module。
想请问下,electron-egg是否可以修改storageDir的位置呢?
const Socket = require('ee-core/socket');
const { getSocketServer } = Socket;
// 发消息到前端io-client on()监听的事件 或者 其它语言socket监听的事件
const EeSocketServer = getSocketServer();
EeSocketServer.io.emit("test", "数据");
Error occurred in handler for 'controller.agent.testSocketMsg': TypeError: Cannot read property 'Symbol(Ee#SocketServer)' of undefined
代码加密后webPreferences 的 preload 无法加载到脚本,未加密的方式是可以加载的,
实际上也对bridge.js 加密了,但就是加载不到。。。
有图有真相
http://mac.c-cee.com:8899/ELE/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20221024194418.png
http://mac.c-cee.com:8899/ELE/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20221024194443.png
config.default.js 配置 width: 980, height: 650, 是固定大小的,请问如何配置才能让窗口自动最大化
界面上如果需要引用一些图标,应将图标放在什么路径下?假如frontend\src\views\demo\config\index.vue页面有控件,这个logo1.png应在什么位置?
Error occurred in handler for 'controller.example.sqlitedbOperation': Error: The module '\Desktop\temp\electron-egg-master\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 89. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (C:\Users\ZhuQR\Desktop\temp\electron-egg-master\node_modules\bindings\bindings.js:112:48)
at new Database (C:\Users\ZhuQR\Desktop\temp\electron-egg-master\node_modules\better-sqlite3\lib\database.js:48:64)
Error occurred in handler for 'controller.example.sqlitedbOperation': Error: The module '\?\C:\Users\ZhuQR\Desktop\temp\electron-egg-master\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.