Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决 vercel 部署中,设置自定义域名后,即时通知发送失败 401 错误问题 #785

Closed
wants to merge 2 commits into from

Conversation

kuole-o
Copy link
Contributor

@kuole-o kuole-o commented Jan 7, 2025

原代码逻辑:

    await Promise.race([
      axios.post(`https://${process.env.VERCEL_URL}`, {
        event: 'POST_SUBMIT',
        comment
      }, { headers: { 'x-twikoo-recursion': config.ADMIN_PASS || 'true' } }),
      // 如果超过 5 秒还没收到异步返回,直接继续,减少用户等待的时间
      new Promise((resolve) => setTimeout(resolve, 5000))
    ])

process.env.VERCEL_URL 是自动分配的访问地址,配置自定义域名后就不一致了。

本改动需新增环境变量 CUSTOM_DOMAIN 配置自己的自定义域名,如:twikoo.guole.fun

@imaegoo
Copy link
Member

imaegoo commented Jan 7, 2025 via email

@kuole-o
Copy link
Contributor Author

kuole-o commented Jan 7, 2025

好 我试试看

@kuole-o kuole-o closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants