zdg #171

Merged
zhengdegang merged 4 commits from zdg into main 2024-09-03 18:11:48 +08:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit b6504e114f - Show all commits

View File

@ -14,11 +14,11 @@ const API = isNode?window.api:{} // preload-api
// import { useToolState } from '@/store/modules/tool' // 获取store状态 // import { useToolState } from '@/store/modules/tool' // 获取store状态
// const Store = isNode?require('electron-store'):null // 持久化存储 // const Store = isNode?require('electron-store'):null // 持久化存储
import store from './store' import store from './store'
// 常用变量 // 常用变量
const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':'' const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':''
const isDev = isNode?process.env.NODE_ENV !== 'production':'' const isDev = isNode?process.env.NODE_ENV !== 'production':''
// const toolState = useToolState() // 获取store状态 // const toolState = useToolState() // 获取store状态
const appPath = isNode?Remote.app.getAppPath():'' // 应用目录
// 暴露Remote中的属性 // 暴露Remote中的属性
export const ipcMain = Remote?.ipcMain || {} export const ipcMain = Remote?.ipcMain || {}
@ -110,6 +110,7 @@ export const createWindow = async (type, data) => {
resizable: false, // 禁止窗口大小缩放 resizable: false, // 禁止窗口大小缩放
transparent: true, // 设置透明 transparent: true, // 设置透明
alwaysOnTop: true, // 窗口是否总是显示在其他窗口之前 alwaysOnTop: true, // 窗口是否总是显示在其他窗口之前
type: 'toolbar', // 创建的窗口类型为工具栏窗口
// parent: mainWin, // 父窗口 // parent: mainWin, // 父窗口
// autoClose: true, // 关闭窗口后自动关闭 // autoClose: true, // 关闭窗口后自动关闭
} }
@ -179,8 +180,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
return new Promise((resolve) => { return new Promise((resolve) => {
const config = { const config = {
width, height, width, height,
type: 'toolbar', // 创建的窗口类型为工具栏窗口 icon: path.join(appPath, '/resources/logo2.ico'),
// icon: path.join(__dirname, '../../resources/logo2.ico'),
webPreferences: { webPreferences: {
preload: path.join(API.preloadPath, '/index.js'), preload: path.join(API.preloadPath, '/index.js'),
sandbox: false, sandbox: false,