Skip to content

分类和标签包含中文会导致路由匹配不到,跳转至404页面 #276

@ATQQ

Description

@ATQQ
  • I confirm that this is an issue rather than a question.

Bug report

What is actually happening?

在文章中,标签和分类如果包含中文,会在页面访问指定路由时404

---
title: api
date: 2020-05-29
categories: 
 - 中文分类
tags: 
 - 中文标签
---

复现步骤

  1. 脚手架创建项目,随意修改一个文章的分类/标签 包含中文

图片

  1. 运行后控制台会有警告

图片

提示路由的路径包含不可编码的字符

试验了一下 Vue-router是支持中文路由的

  1. 访问效果通过按钮目录点击导航没问题,但如果直接输入目标地址就是404

点它 ok
图片

直接访问它对应的路由,不ok

https://sugarat.top/categories/%E5%85%B6%E5%AE%83/

Other relevant information

  • Your OS: 应该也不是操作系统问题
    • Mac OS BigSur
    • Linux
  • Node.js version: 都切换了应该不是 Node的问题
    • 10
    • 12
    • 14
  • VuePress version: 都试了也不行
    • 1.5.1
    • 1.71
  • VuePress-theme-reco version: 怀疑是这个问题
    • 1.5.7
  • Which package manager did you use for the install(npm/cnpm/yarn)?
    • npm
    • yarn

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions