Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

非管理员用户侧边栏提示错误:Referer 不被允许 #36

Closed
Bakumon opened this issue Jun 6, 2022 · 5 comments
Closed

非管理员用户侧边栏提示错误:Referer 不被允许 #36

Bakumon opened this issue Jun 6, 2022 · 5 comments
Labels
good first issue Good for newcomers

Comments

@Bakumon
Copy link

Bakumon commented Jun 6, 2022

感谢作者提供如此优秀的开源项目🙏🙏🙏

在使用中遇到了这个问题,不太懂相关代码,希望好心人能帮忙解答下🙏

具体错误如下:
image

​ hello artalk-sidebar
index.f7f00175.js:1 hello artalk-sidebar
index.f7f00175.js:1 非法请求:Referer 不被允许
onError @ index.f7f00175.js:1
(anonymous) @ index.f7f00175.js:1
a @ index.f7f00175.js:1
index.f7f00175.js:1 Uncaught (in promise) Object
a @ index.f7f00175.js:1
@qwqcode
Copy link
Member

qwqcode commented Jun 6, 2022

解决方法是:将 后端域名 例如:https://artalk.qwqaq.com 也填入配置文件的 trusted_domains 项目中

@Bakumon
Copy link
Author

Bakumon commented Jun 6, 2022

感谢感谢,可以了

@Bakumon Bakumon closed this as completed Jun 6, 2022
@qwqcode
Copy link
Member

qwqcode commented Jun 6, 2022

后端设计了通过 Referer 来限制跨站点的非法请求,为了实现多站点共用同一套后端程序,而隔离彼此的操作。

例如限制:站点 A 无法在客户端将评论数据插入到 站点 B 中。

之后会修改一下,将服务器的 hostname 默认加进 trusted_domains 配置项中。

@qwqcode
Copy link
Member

qwqcode commented Jun 6, 2022

感谢反馈

@qwqcode qwqcode added the good first issue Good for newcomers label Jun 6, 2022
@qwqcode qwqcode changed the title 管理员打开侧栏正常,一般用户打开提示错误:非法请求:Referer 不被允许,无法获取评论列表数据 点击重新获取 非管理员用户侧边栏提示错误:Referer 不被允许 Jun 6, 2022
@qwqcode
Copy link
Member

qwqcode commented Jun 7, 2022

新版构建已发布 v2.1.9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants