From bc1099183e568f6d6e8cca329fed05ca9bdf0169 Mon Sep 17 00:00:00 2001 From: luk Date: Sun, 9 Aug 2026 17:43:39 +0800 Subject: [PATCH] u --- dcloud-renew/README.md | 2 +- dcloud-renew/renew.mjs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dcloud-renew/README.md b/dcloud-renew/README.md index acc89cc..daf09eb 100644 --- a/dcloud-renew/README.md +++ b/dcloud-renew/README.md @@ -10,7 +10,7 @@ Run the script with: `node renew.mjs 'EMAIL' 'PASSWORD'` you can also set environment variables directly: -`HEADLESs=true UNICLOUD_EMAIL=... UNICLOUD_PASSWORD=... node renew.mjs` +`HEADLESS=true UNICLOUD_EMAIL=... UNICLOUD_PASSWORD=... node renew.mjs` or set via `.env` file. diff --git a/dcloud-renew/renew.mjs b/dcloud-renew/renew.mjs index b903f26..3b9a984 100644 --- a/dcloud-renew/renew.mjs +++ b/dcloud-renew/renew.mjs @@ -80,13 +80,15 @@ async function renewOne (context, dashboardPage, renewLocator, index) { ;(async () => { const isMac = process.platform === 'darwin' - + // Set HEADLESS=false (or omit) to watch the browser; cron jobs should run // headless (HEADLESS=true or just leave it — defaults to true when no TTY). const headless = process.env.HEADLESS != null ? process.env.HEADLESS !== 'false' && process.env.HEADLESS !== '0' - : isMac ? false : true + : isMac + ? false + : true // On macOS use the installed Microsoft Edge; on Linux (and elsewhere) fall // back to the Chromium bundled by Playwright (run `npx playwright install @@ -111,7 +113,7 @@ async function renewOne (context, dashboardPage, renewLocator, index) { timeout: 60000 }) - console.log('<<<<<<<<<', new Date().toJSON(), 'Renew account', email) + console.log('\n<<<<<<<<<\n', new Date().toJSON(), 'Renew account', email) console.log('Page loaded, waiting for login iframe...') // 1. Login via the account.dcloud.net.cn iframe. @@ -163,10 +165,10 @@ async function renewOne (context, dashboardPage, renewLocator, index) { } console.log( - '>>>>>>>>>', new Date().toJSON(), - `Done. ${done} subscription(s) renewed for accouint`, - email + `Done. ${done} subscription(s) renewed for account`, + email, + '\n>>>>>>>>>\n' ) await browser.close() process.exit(0)