Skip to content

Commit

Permalink
fix: notion publish error
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Apr 13, 2024
1 parent 86ecf47 commit cfc974e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/adaptors/api/notion/notionApiAdaptor.ts
Expand Up @@ -274,8 +274,8 @@ class NotionApiAdaptor extends BaseBlogApi {
this.logger.debug("向Notion请求数据,params =>", params)

// 使用兼容的fetch调用并返回统一的JSON数据
const body = ObjectUtil.isEmptyObject(params) ? {} : params
const resJson = await this.apiFetch(apiUrl, [headers], body, method, contentType)
const body = ObjectUtil.isEmptyObject(params) ? undefined : JSON.stringify(params)
const resJson = await this.apiFetch(apiUrl, [headers], body, method, contentType, true, "base64", "text")
this.logger.debug("向Notion请求数据,resJson =>", resJson)

if (resJson?.status === 400 || resJson?.status === 401 || resJson?.status === 404 || resJson?.status === 429) {
Expand Down

0 comments on commit cfc974e

Please sign in to comment.