feat: 自动化执行逻辑开发

This commit is contained in:
DEV_DSW
2026-03-11 17:01:48 +08:00
parent d07c65c581
commit b32fb2e9e8
10 changed files with 525 additions and 95 deletions

View File

@@ -1,2 +1,33 @@
import log from 'electron-log';
const log = require('electron-log');
const checkLoginStatus = async (page) => {
try {
const currentUrl = await page.url();
log.info('current url==========>:', currentUrl);
const loginPagePatterns = ['/login', '/signin', '/auth'];
const isLoginPage = loginPagePatterns.some((pattern) => currentUrl.includes(pattern));
if (!isLoginPage) {
return true;
}
const pageContent = await page.content();
const loginKeywords = ['退出', '房价房量管理'];
const hasLoginKeyword = loginKeywords.some((keyword) => pageContent.includes(keyword));
if (hasLoginKeyword) {
return true;
}
return false;
} catch (error) {
return false;
}
};
module.exports = {
checkLoginStatus,
};