Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bab8549

Browse files
committed
生成id的时候添加随机数
1 parent aae2c34 commit bab8549

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎routes/article.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async function updateArticle(req, res, next) {
9898
linkify: true,
9999
typographer: true,
100100
highlight: function (str, lang) {
101-
const codeIndex = parseInt(Date.now())
101+
const codeIndex = parseInt(Date.now())+Math.floor(Math.random()*10000000)
102102
let html = `<button class="copy-btn" type="button" data-clipboard-action="copy" data-clipboard-target="#copy${codeIndex}">复制</button>`
103103
const linesLength = str.split(/\n/).length - 1
104104
let linesNum = '<span aria-hidden="true" class="line-numbers-rows">'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /