gitbook 主题fix最近阅读

This commit is contained in:
tangly1024.com
2024-05-16 15:29:02 +08:00
parent 71701fa314
commit 59025e8018
6 changed files with 33 additions and 32 deletions

View File

@@ -30,4 +30,18 @@ function extractLangId(str) {
}
}
module.exports = { extractLangPrefix, extractLangId }
/**
* 列表中用过来区分page只需要端的id足够
*/
function getShortId(uuid) {
if (!uuid || uuid.indexOf('-') < 0) {
return uuid
}
// 找到第一个 '-' 的位置
const index = uuid.indexOf('-')
// 截取从开始到第一个 '-' 之前的部分
return uuid.substring(0, index)
}
module.exports = { extractLangPrefix, extractLangId, getShortId }