refactor: improve date handling and timezone consistency

- Add timezone support to database module (+08:00)
- Extract date formatting utilities to shared modules
- Standardize timezone handling across frontend and backend
- Improve date formatting consistency in UI components
- Refactor crawler page.goto options for better readability
This commit is contained in:
dmy
2026-01-15 16:17:41 +08:00
parent eba5c7e5c5
commit 5edebd9d55
20 changed files with 219 additions and 57 deletions

View File

@@ -139,7 +139,10 @@ export const CdtCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -142,7 +142,10 @@ export const CeicCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const CgnpcCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -134,7 +134,10 @@ export const ChdtpCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const CnncecpCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const CnoocCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const EpsCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const PowerbeijingCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -148,7 +148,10 @@ export const SdiccCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,

View File

@@ -142,7 +142,10 @@ export const SzecpCrawler = {
logger.log(`Navigating to ${this.url}...`);
await delayRetry(
async () => {
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
await page.goto(this.url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
},
3,
5000,