fix: 修复脚本依次执行问题

This commit is contained in:
duanshuwen
2026-03-25 22:03:51 +08:00
parent 15139bd606
commit 280abcecbe
12 changed files with 15 additions and 314 deletions

View File

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