8 Commits

Author SHA1 Message Date
duanshuwen
2a5114a370 Merge branch 'feature/dsw' of https://git.nianxx.cn/duanshuwen/zn-ai into feature/dsw 2026-04-01 23:10:40 +08:00
duanshuwen
e152ac4625 feat: 新增打包配置 2026-04-01 23:10:33 +08:00
DEV_DSW
242a77856e Merge branch 'feature/dsw' of https://git.nianxx.cn/duanshuwen/zn-ai into feature/dsw 2026-04-01 10:41:55 +08:00
DEV_DSW
134d299857 feat: 新增DB文件 2026-04-01 10:41:48 +08:00
duanshuwen
20bf7ad7da feat: 修改运行时窗口图标配置 2026-03-28 16:19:45 +08:00
duanshuwen
7c3f0f393d feat: 新增DMG打包配置 2026-03-25 22:17:39 +08:00
duanshuwen
280abcecbe fix: 修复脚本依次执行问题 2026-03-25 22:03:51 +08:00
duanshuwen
15139bd606 feat: 新增打包属性配置 2026-03-25 21:06:17 +08:00
21 changed files with 629 additions and 394 deletions

View File

@@ -3,9 +3,11 @@ import { MakerSquirrel } from '@electron-forge/maker-squirrel';
import { MakerZIP } from '@electron-forge/maker-zip'; import { MakerZIP } from '@electron-forge/maker-zip';
import { MakerDeb } from '@electron-forge/maker-deb'; import { MakerDeb } from '@electron-forge/maker-deb';
import { MakerRpm } from '@electron-forge/maker-rpm'; import { MakerRpm } from '@electron-forge/maker-rpm';
import { MakerDMG } from '@electron-forge/maker-dmg';
import { VitePlugin } from '@electron-forge/plugin-vite'; import { VitePlugin } from '@electron-forge/plugin-vite';
import { FusesPlugin } from '@electron-forge/plugin-fuses'; import { FusesPlugin } from '@electron-forge/plugin-fuses';
import { FuseV1Options, FuseVersion } from '@electron/fuses'; import { FuseV1Options, FuseVersion } from '@electron/fuses';
import MakerWix from '@electron-forge/maker-wix';
import * as fs from 'fs-extra'; import * as fs from 'fs-extra';
import * as path from 'path'; import * as path from 'path';
import * as esbuild from 'esbuild'; import * as esbuild from 'esbuild';
@@ -14,13 +16,28 @@ const config: ForgeConfig = {
packagerConfig: { packagerConfig: {
asar: true, asar: true,
tmpdir: path.resolve(process.cwd(), '..', 'electron-packager-tmp'), tmpdir: path.resolve(process.cwd(), '..', 'electron-packager-tmp'),
name: 'NianXX',
icon: path.join(__dirname, 'public/logo'),
appCopyright: 'Copyright © 2026 智念科技',
}, },
rebuildConfig: {}, rebuildConfig: {},
makers: [ makers: [
new MakerSquirrel({}), new MakerSquirrel({
iconUrl: path.join(__dirname, 'public/logo.ico'), // 快捷方式的图标,需要在线的地址
setupIcon: path.join(__dirname, 'public/logo.ico'),
setupExe: 'NianXX.exe',
// loadingGif: path.join(__dirname, 'public/loading.gif'), // 修改默认安装图片
}),
new MakerZIP({}, ['darwin']), new MakerZIP({}, ['darwin']),
new MakerRpm({}), new MakerRpm({}),
new MakerDeb({}), new MakerDeb({}),
new MakerDMG({}),
new MakerWix({
language: 2052,
ui: {
chooseDirectory: true,
}
}),
], ],
plugins: [ plugins: [
new VitePlugin({ new VitePlugin({

651
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,8 +24,10 @@
"devDependencies": { "devDependencies": {
"@electron-forge/cli": "^7.8.3", "@electron-forge/cli": "^7.8.3",
"@electron-forge/maker-deb": "^7.10.2", "@electron-forge/maker-deb": "^7.10.2",
"@electron-forge/maker-dmg": "^7.11.1",
"@electron-forge/maker-rpm": "^7.10.2", "@electron-forge/maker-rpm": "^7.10.2",
"@electron-forge/maker-squirrel": "^7.10.2", "@electron-forge/maker-squirrel": "^7.10.2",
"@electron-forge/maker-wix": "^7.11.1",
"@electron-forge/maker-zip": "^7.10.2", "@electron-forge/maker-zip": "^7.10.2",
"@electron-forge/plugin-auto-unpack-natives": "^7.10.2", "@electron-forge/plugin-auto-unpack-natives": "^7.10.2",
"@electron-forge/plugin-fuses": "^7.10.2", "@electron-forge/plugin-fuses": "^7.10.2",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -51,8 +51,7 @@ export function runTaskOperationService() {
['fzName', 'fg_trace.js'], ['fzName', 'fg_trace.js'],
['mtName', 'mt_trace.js'], ['mtName', 'mt_trace.js'],
['dyHotelName', 'dy_hotel_trace.js'], ['dyHotelName', 'dy_hotel_trace.js'],
['dyHotSpringName', 'dy_hot_spring_trace.js'], ['dyHotSpringName', 'dy_hot_spring_trace.js']
['xcName', 'xc_trace.js'],
] ]
const scriptEntries = pairs.filter(([prop]) => roomType?.[prop]) const scriptEntries = pairs.filter(([prop]) => roomType?.[prop])
@@ -75,9 +74,14 @@ export function runTaskOperationService() {
dyHotelName: 'douyin', dyHotelName: 'douyin',
dyHotSpringName: 'douyin', dyHotSpringName: 'douyin',
} }
const defaultTabIndexMap: Record<string, number> = {
fliggy: 0,
meituan: 1,
douyin: 2
}
const mappedName = channelNameMap[item.channel] const mappedName = channelNameMap[item.channel]
const tabIndex = mappedName ? (openedTabIndexByChannelName.get(mappedName) ?? i) : i const tabIndex = mappedName ? (openedTabIndexByChannelName.get(mappedName) ?? defaultTabIndexMap[mappedName] ?? i) : i
log.info(`Launching script for channel ${item.channel}: ${item.scriptPath}`) log.info(`Launching script for channel ${item.channel}: ${item.scriptPath} (tabIndex: ${tabIndex})`)
const result = await executeScriptServiceInstance.executeScript(item.scriptPath, { const result = await executeScriptServiceInstance.executeScript(item.scriptPath, {
roomType: roomType[item.channel], roomType: roomType[item.channel],
startTime: options.startTime, startTime: options.startTime,

View File

@@ -24,6 +24,7 @@ const isSameOrigin = (currentUrl, targetUrl) => {
const current = normalizeUrl(currentUrl); const current = normalizeUrl(currentUrl);
const target = normalizeUrl(targetUrl); const target = normalizeUrl(targetUrl);
if (!current || !target) return false; if (!current || !target) return false;
return current.origin === target.origin; return current.origin === target.origin;
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

View File

@@ -220,5 +220,6 @@ const navigateToRoomStatusManagement = async (page) => {
process.exitCode = 1; process.exitCode = 1;
} finally { } finally {
await safeDisconnectBrowser(browser); await safeDisconnectBrowser(browser);
process.exit(process.exitCode || 0);
} }
})(); })();

View File

@@ -220,5 +220,6 @@ const navigateToRoomStatusManagement = async (page) => {
process.exitCode = 1; process.exitCode = 1;
} finally { } finally {
await safeDisconnectBrowser(browser); await safeDisconnectBrowser(browser);
process.exit(process.exitCode || 0);
} }
})(); })();

View File

@@ -169,5 +169,6 @@ const toggleRoomByDateIndex = async (container, { roomType, dateIndex, operation
process.exitCode = 1; process.exitCode = 1;
} finally { } finally {
await safeDisconnectBrowser(browser); await safeDisconnectBrowser(browser);
process.exit(process.exitCode || 0);
} }
})(); })();

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -232,5 +232,6 @@ const toggleRoom = async (page, { roomType, mmdd, operation }) => {
process.exitCode = 1; process.exitCode = 1;
} finally { } finally {
await safeDisconnectBrowser(browser); await safeDisconnectBrowser(browser);
process.exit(process.exitCode || 0);
} }
})(); })();

View File

@@ -128,5 +128,6 @@ const isBlankLikePage = (url) => {
} }
} catch {} } catch {}
} }
process.exit(process.exitCode || 0);
} }
})(); })();

View File

@@ -1,4 +0,0 @@
import log from 'electron-log';
log.info('xc_trace.mjs placeholder: not implemented');
process.exit(0);

View File

@@ -46,6 +46,6 @@ export async function launchLocalChrome() {
// 延迟几秒等浏览器起来 // 延迟几秒等浏览器起来
setTimeout(() => { setTimeout(() => {
resolve(0); resolve(0);
}, 3000); // 延迟3 }, 1000); // 延迟1
}); });
} }

5
src/main/utils/db.ts Normal file
View File

@@ -0,0 +1,5 @@
import Dexie from 'dexie'
export const db = new Dexie('NianXX') as Dexie & {}
db.version(1).stores({})

View File

@@ -31,6 +31,6 @@ export function createLogo() {
if (logo != null) { if (logo != null) {
return logo; return logo;
} }
logo = path.join(__dirname, 'logo.ico'); logo = path.join(__dirname, '/public/logo.ico');
return logo; return logo;
} }

View File

@@ -8,23 +8,23 @@
<native-tooltip :content="t('window.minimize')"> <native-tooltip :content="t('window.minimize')">
<button v-show="isMinimizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]" <button v-show="isMinimizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="minimizeWindow"> @click="minimizeWindow">
<iconify-icon icon="material-symbols:check-indeterminate-small" color="#525866" :width="btnSize" <iconify-icon icon="material-symbols:check-indeterminate-small" :color="color" :width="btnSize"
:height="btnSize" /> :height="btnSize" />
</button> </button>
</native-tooltip> </native-tooltip>
<native-tooltip :content="isMaximized ? t('window.restore') : t('window.maximize')"> <native-tooltip :content="isMaximized ? t('window.restore') : t('window.maximize')">
<button v-show="isMaximizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]" <button v-show="isMaximizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="maximizeWindow"> @click="maximizeWindow">
<iconify-icon icon="material-symbols:chrome-maximize-outline-sharp" color="#525866" :width="btnSize" <iconify-icon icon="material-symbols:chrome-maximize-outline-sharp" :color="color" :width="btnSize"
:height="btnSize" v-show="!isMaximized" /> :height="btnSize" v-show="!isMaximized" />
<iconify-icon icon="material-symbols:chrome-restore-outline-sharp" color="#525866" :width="btnSize" <iconify-icon icon="material-symbols:chrome-restore-outline-sharp" :color="color" :width="btnSize"
:height="btnSize" v-show="isMaximized" /> :height="btnSize" v-show="isMaximized" />
</button> </button>
</native-tooltip> </native-tooltip>
<native-tooltip :content="t('window.close')"> <native-tooltip :content="t('window.close')">
<button v-show="isClosable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]" <button v-show="isClosable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="handleClose"> @click="handleClose">
<iconify-icon icon="material-symbols:close" color="#525866" :width="btnSize" :height="btnSize" /> <iconify-icon icon="material-symbols:close" :color="color" :width="btnSize" :height="btnSize" />
</button> </button>
</native-tooltip> </native-tooltip>
</div> </div>
@@ -42,9 +42,10 @@ interface HeaderBarProps {
isMaximizable?: boolean; isMaximizable?: boolean;
isMinimizable?: boolean; isMinimizable?: boolean;
isClosable?: boolean; isClosable?: boolean;
color?: string;
} }
defineOptions({ name: 'HeaderBar' }) defineOptions({ name: 'HeaderBar', color: '#525866' })
withDefaults(defineProps<HeaderBarProps>(), { withDefaults(defineProps<HeaderBarProps>(), {
isMaximizable: true, isMaximizable: true,

View File

@@ -20,6 +20,6 @@ export const channels: Item[] = [
{ {
id: uuidv4(), id: uuidv4(),
channelName: 'douyin', channelName: 'douyin',
channelUrl: 'https://life.douyin.com/p/goods_winetour/physical_room_list?groupid=1816249020842116', channelUrl: 'https://life.douyin.com/p/travel-ari/hotel/price_amount_state?groupid=1816249020842116',
} }
] ]

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="h-screen login-bg flex flex-col"> <div class="h-screen login-bg flex flex-col">
<header-bar> <header-bar color="#fff">
<drag-region class="w-full" /> <drag-region class="w-full" />
</header-bar> </header-bar>