docs: annotate all shared frontend modules in Chinese

This commit is contained in:
cieanyau committed 2026-11-06 00:30:15 +08:00
1 parent 2be21c1c62
commit 408f8e5c98
55 files changed
+349

No files matched your search

+3
View File
@@ -1,3 +1,4 @@
/** 前端公开路由清单,供路由守卫和跨标签退出共用;后端接口仍须独立鉴权。 */
const authPages = new Set([
"/login",
"/register",
@@ -16,6 +17,7 @@ const shopPages = new Set([
"/products/dedicated-server/customize",
]);
// 商品可匿名浏览,但 edit_position 表示编辑用户购物车,不能按公开商品页放行。
export function isPublicShop(route) {
if (Object.hasOwn(route.query || {}, "edit_position")) return false;
const path = route.path.replace(/\/+$/, "") || "/";
@@ -24,6 +26,7 @@ export function isPublicShop(route) {
export function isAuthPage(path) {
return authPages.has(path.replace(/\/+$/, "") || "/");
}
// /home.htm 是待核验的过渡入口,公开仅表示能打开核验页,不表示已获登录权限。
export function isPublicRoute(route) {
return (
route.path === "/home.htm" || isAuthPage(route.path) || isPublicShop(route)