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

自动生成的文章链接重复问题优化 #147

Closed
xflcx1991 opened this issue Jun 16, 2020 · 1 comment
Closed

自动生成的文章链接重复问题优化 #147

xflcx1991 opened this issue Jun 16, 2020 · 1 comment
Assignees
Milestone

Comments

@xflcx1991
Copy link

xflcx1991 commented Jun 16, 2020

你在什么场景下需要该功能?

在发布新文章或导入新文章时。

目前我看到文章生成规则是日期+时间毫秒(是oid,但是oid的值就是毫秒数),这似乎不太合理。我在导入大量文档时就遇到了重复链接的报错,直到翻源码才发现原来是这个规则。
NFMacT.png

可以理解作者的意思是不可能同时写多篇文章。
但是

  • 多人写文章恰好时间相同
  • 导入过去的markdown文档,有些文档的hexo头写的时间还就一样,还不是一个两个,手动改太费劲
    遇到上述情况将发生导入失败,日志能看到org.b3log.latke.service.ServiceException: 链接重复!的错误。

描述可能的解决方案

可以参考 WordPress 的文章链接生成方案
WordPress永久链接设置

描述你认为的候选方案

暂无

其他信息

暂无

@88250
Copy link
Owner

88250 commented Jun 16, 2020

这一块之前有过考虑,但是因为规则模式的使用其实并不常用,更推荐的做法是写文章是自定义链接。

导入的问题稍后加入延时进行解决,谢谢反馈!

@88250 88250 changed the title 修改或增加文章链接的生成规则 自动生成的文章链接重复问题优化 Jun 16, 2020
@88250 88250 self-assigned this Jun 16, 2020
@88250 88250 added this to the 4.2.0 milestone Jun 16, 2020
@88250 88250 closed this as completed in 481f615 Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants