16 lines
640 B
TypeScript
16 lines
640 B
TypeScript
// Author: fruit.com.cn
|
|
|
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
|
|
|
/**
|
|
* 登录 / 访问根路径时的落地页:取"这个账号实际能进的第一个菜单"。
|
|
*
|
|
* 原来写死 `/dashboard/index`,创作者没有运营后台权限,登录后会直接掉进 404;
|
|
* 现在按账号自己的路由表决定 —— 创作者落创作者中心,超管第一条仍是工作台(行为不变)。
|
|
*/
|
|
export function landingPath(): string {
|
|
const permissionStore = usePermissionStoreWithOut()
|
|
const first = permissionStore.addRouters?.[0]?.path
|
|
return (first as string) || '/dashboard/index'
|
|
}
|