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

关于出现 alert 警告的说明 #156

Closed
woyehaizaixiang opened this issue Apr 13, 2021 · 7 comments
Closed

关于出现 alert 警告的说明 #156

woyehaizaixiang opened this issue Apr 13, 2021 · 7 comments

Comments

@woyehaizaixiang
Copy link

检测测试环境是什么意思,

@haochuan9421
Copy link
Owner

haochuan9421 commented Apr 13, 2021

有些小伙伴可能会看到这样的告警:
image

UEditor 作为一款富文本编辑器,包含图片上传、视频上传、远程图片抓取等功能。这需要部署对应的后端服务,才能正常使用。

正确部署后的 UEditor 服务,一般会提供一个统一的 HTTP 请求接口,前端同学只需要把他配置到 UEDITOR_CONFIG.serverUrl 中即可。

文档里提供了一个测试的 serverUrl https://ueditor.zhenghaochuan.com/cos ,后台日志显示访问量很大,已经吃掉了我服务器很多费用😂,这个接口是我个人搭建的,初衷是为了方便各位小伙伴看文档或开发时能更好的体验百度编辑器的完整功能,完全是出于帮助他人的初衷且免费的。

image

由于我设置了允许跨域访问,发现有很多人在线上环境白嫖我的接口😡😡😡,这不仅对我造成了额外的经济负担,也占用其他同学的资源!所以对疑似线上环境的调用进行了告警,此前文档也三番五次强调这个 serverUrl 仅供测试使用,不可用于生产环境!
image
image

为了更好的防止此类事情发生,现同一 IP 最多只能调用一百次,超过后自动加入黑名单,这个次数对于体验 serverUrl 的功能已经足够了。

对于需要使用上传图片等功能的同学,UEditor 官方已经提供了 PHP、ASP、ASP.NET、JSP 的部署说明,我也提供一个 Node 的示例代码,事实上我提供了那个 serverUrl 就是 Node 写的。再次强调:拒绝白嫖!!!自己动手,丰衣足食!

@haochuan9421 haochuan9421 pinned this issue Apr 13, 2021
@haochuan9421 haochuan9421 changed the title alert警告 关于出现 alert 警告的说明 Apr 13, 2021
@woyehaizaixiang
Copy link
Author

已将serverUrl设置为空关闭alert警告,上传文件、图片等功能通过oss实现了

@dg-jj
Copy link

dg-jj commented Jul 7, 2021

大佬 请问你的跨域问题怎么处理的 我这边遇到跨域问题

Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute

@haochuan9421
Copy link
Owner

大佬 请问你的跨域问题怎么处理的 我这边遇到跨域问题

Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute

你这个跨域请求设置了第三方Cookie,之前我写过一篇相关的博客,你可以了解一下 https://juejin.cn/post/6963632513914765320

@Lny-nice
Copy link

工具栏很多工具失效咋回事啊

@cjh-store
Copy link

已将serverUrl设置为空关闭alert警告,上传文件、图片等功能通过oss实现了

是否有代码示例看看怎么实现的呢 遇到相同需求

@woyehaizaixiang
Copy link
Author

已将serverUrl设置为空关闭alert警告,上传文件、图片等功能通过oss实现了

是否有代码示例看看怎么实现的呢 遇到相同需求

可以参考这个,主要是24540行代码开始
https://github.com/woyehaizaixiang/vue-ueditor/blob/master/ueditor.all.min.js

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

No branches or pull requests

5 participants