mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 23:16:52 +00:00
Use local time zone automatically
This commit is contained in:
@@ -40,7 +40,7 @@ export async function getPageWithRetry(id, from, retryAttempts = 3) {
|
|||||||
console.log('[请求API]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '')
|
console.log('[请求API]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '')
|
||||||
try {
|
try {
|
||||||
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
|
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
|
||||||
const api = new NotionAPI({ authToken, userTimeZone: 'Asia/ShangHai' })
|
const api = new NotionAPI({ authToken, userTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })
|
||||||
const pageData = await api.getPage(id)
|
const pageData = await api.getPage(id)
|
||||||
console.info('[响应成功]:', `from:${from}`)
|
console.info('[响应成功]:', `from:${from}`)
|
||||||
return pageData
|
return pageData
|
||||||
|
|||||||
Reference in New Issue
Block a user