更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -10,7 +10,6 @@ function computeFullPath(menuPath, parentPath) {
|
||||
return `${base}/${menuPath}`.replace(/\/+/g, '/');
|
||||
}
|
||||
|
||||
/** 将子路由的绝对路径转为相对父布局的路径,供 Vue Router 嵌套使用 */
|
||||
function toRelativeChildPath(parentAbs, childAbs) {
|
||||
const base = (parentAbs || '').replace(/\/$/, '');
|
||||
const target = (childAbs || '').replace(/\/$/, '');
|
||||
@@ -20,7 +19,6 @@ function toRelativeChildPath(parentAbs, childAbs) {
|
||||
if (target.startsWith(prefix)) {
|
||||
return target.slice(prefix.length);
|
||||
}
|
||||
// 兜底:取最后一段(菜单 path 配置异常时)
|
||||
const parts = target.split('/').filter(Boolean);
|
||||
return parts.length ? parts[parts.length - 1] : '';
|
||||
}
|
||||
@@ -39,12 +37,8 @@ function resolvePageComponent(menu) {
|
||||
return () => import('@/views/404/404.vue');
|
||||
}
|
||||
|
||||
/** 套餐未开通模块的锁定占位页组件 */
|
||||
const lockedPageComponent = () => import('@/views/locked/index.vue');
|
||||
|
||||
/**
|
||||
* 菜单子节点 -> 嵌套路由(path 相对 layoutAbsPath)
|
||||
*/
|
||||
function convertNestedMenuChildren(children, layoutAbsPath) {
|
||||
if (!children || children.length === 0) return [];
|
||||
return children.map((child) => nestedMenuToRoute(child, layoutAbsPath));
|
||||
@@ -64,7 +58,6 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
componentPath: menu.component_path,
|
||||
};
|
||||
|
||||
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
|
||||
if (menu.locked) {
|
||||
const route = {
|
||||
path: relPath,
|
||||
@@ -78,7 +71,6 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
return route;
|
||||
}
|
||||
|
||||
// 既有自己的页面又有子菜单:套一层 EmptyLayout,避免父页面组件里没有 <router-view> 导致子路由无法渲染
|
||||
if (hasChildren && ownPage) {
|
||||
return {
|
||||
path: relPath,
|
||||
@@ -97,7 +89,6 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
};
|
||||
}
|
||||
|
||||
// 纯目录 + 子节点
|
||||
if (hasChildren && !ownPage) {
|
||||
const route = {
|
||||
path: relPath,
|
||||
@@ -117,7 +108,6 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
return route;
|
||||
}
|
||||
|
||||
// 叶子页面
|
||||
return {
|
||||
path: relPath,
|
||||
name: `menu_${menu.id}`,
|
||||
@@ -126,7 +116,6 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
};
|
||||
}
|
||||
|
||||
// 递归转换嵌套菜单为嵌套路由
|
||||
export function convertMenusToRoutes(menus, parentPath = '') {
|
||||
if (!menus || menus.length === 0) return [];
|
||||
|
||||
@@ -148,7 +137,6 @@ export function convertMenusToRoutes(menus, parentPath = '') {
|
||||
componentPath: menu.component_path,
|
||||
};
|
||||
|
||||
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
|
||||
if (menu.locked) {
|
||||
const route = {
|
||||
path: fullPath || menu.path || '',
|
||||
@@ -162,7 +150,6 @@ export function convertMenusToRoutes(menus, parentPath = '') {
|
||||
return route;
|
||||
}
|
||||
|
||||
// 顶层:有页面 + 有子菜单 -> EmptyLayout + 默认子路由 + 相对 path 子路由
|
||||
if (hasChildren && ownPage) {
|
||||
return {
|
||||
path: fullPath || menu.path || '',
|
||||
@@ -194,7 +181,6 @@ export function convertMenusToRoutes(menus, parentPath = '') {
|
||||
} else if (hasChildren) {
|
||||
route.component = () => import('@/views/layouts/EmptyLayout.vue');
|
||||
route.children = convertMenusToRoutes(menu.children, fullPath);
|
||||
// CMS 内容统计是内置默认页,保持原行为;其余模块统一优先「工作台」
|
||||
const defaultChild =
|
||||
menu.children.find(
|
||||
(child) => child.path === '/apps/cms/analytics/content' || child.path === 'analytics/content'
|
||||
|
||||
Reference in new issue
Block a user