Skip to content

Commit

Permalink
fix: alist签名兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanqb committed Mar 12, 2024
1 parent e720545 commit 5fb03b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
</div>
</div>
</div>
<script src="./style/core.js?v=21"></script>
<script src="./style/core.js?v=22"></script>
</div>
</body>

Expand Down
10 changes: 6 additions & 4 deletions style/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ new Vue({
// SUMMARY 排序使用
summarySortRule: null
}
if (menus.some(content => content.name === SUMMARY)) {
const summaryFile = menus.filter(content => content.name === SUMMARY)
if (summaryFile && summaryFile.length > 0) {
sortConfig.type = SUMMARY
sortConfig.summarySortRule = await this.sortMenusBySummary(column)
sortConfig.summarySortRule = await this.sortMenusBySummary(column, summaryFile[0])
}
return sortConfig
},
Expand Down Expand Up @@ -603,11 +604,12 @@ new Vue({
fetchAndProcessData();
},
// 根据summary.md 排序
async sortMenusBySummary(column) {
async sortMenusBySummary(column, summaryFile) {
const fileSign = summaryFile.sign ? `?sign=${summaryFile.sign}` : ''
let summarySortRule = {}
let sortIncr = 0
// 获取大纲内容
const summaryContent = await this.getColumnContent(`/${column}/${SUMMARY}`)
const summaryContent = await this.getColumnContent(`/${column}/${SUMMARY}${fileSign}`)
// 一级菜单正则提取
const title_1_reg = /#.* (\S.*)/g;
const matches_1 = summaryContent.matchAll(title_1_reg)
Expand Down

0 comments on commit 5fb03b0

Please sign in to comment.