Closed wty20060888 closed 6 months ago
这个问题解决了吗?
@cybaol 已经解决了
修改router.js
文件,增加以下代码
// /:number
use((req, res, next) => {
const number = req.asPath.slice(1); // 获取路径中的数字部分
if (/^\d+$/.test(number)) {
const newUrl = `/page/${number}`;
res.writeHead(301, { Location: newUrl }); // 重定向到新的路径
res.end();
} else {
next();
}
});
@iamcco 请问这个改动可否合并到版本中呢
@zhaozg 有时间我会提个repo
Describe the bug 插件可正常预览,但在浏览器中无法进行刷新
To Reproduce Steps to reproduce the behavior:
:MarkdownPreview
浏览器自动跳转至 url为localhost:xxxx/1
,可以正常预览F5
刷新,网页404http://localhost:xxxx/page/1
可恢复预览,但网页URL,跳转至localhost:xxxx/1
,这时再次刷新,与Step2青铜相同Expected behavior A clear and concise description of what you expected to happen.
Screenshots
Desktop (please complete the following information):
Log: