File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -238,17 +238,25 @@ def sync_posts():
238238 }
239239 }
240240 """
241+
242+ # 修正点:将 originalPublishDate 改为 publishedAt
243+ input_data = {
244+ "publicationId" : pub_id ,
245+ "title" : title ,
246+ "subtitle" : description ,
247+ "contentMarkdown" : body ,
248+ "slug" : slug ,
249+ "tags" : tags_input
250+ }
251+
252+ # 只有当时间存在时才加入 publishedAt 字段
253+ if original_publish_date :
254+ input_data ["publishedAt" ] = original_publish_date
255+
241256 variables = {
242- "input" : {
243- "publicationId" : pub_id ,
244- "title" : title ,
245- "subtitle" : description ,
246- "contentMarkdown" : body ,
247- "slug" : slug ,
248- "originalPublishDate" : original_publish_date ,
249- "tags" : tags_input
250- }
257+ "input" : input_data
251258 }
259+
252260 try :
253261 run_query (publish_mutation , variables )
254262 print (f"✅ 成功发布: { slug } " )
You can’t perform that action at this time.
0 commit comments