我要为新星找到一条路。这样当用户登录时,他就会指向那个特定的资源。
我已经在/config/nova.php中更新了这个路径
'path' => '/crm/resources/clients' 现在登录后,我可以看到更新的URL。但这一页仍然是欢迎新星页面。
对此有什么想法吗?
发布于 2020-08-20 14:57:08
您可以创建一个自定义的资源或工具来连接到Vue路由器。在我们的具体情况下,我们希望重定向到自定义工具,而不是资源或仪表板。创建一个工具会生成一个tool.js文件,它允许您连接到vue-路由器。
从仪表板重定向到指定的路由
router.beforeEach((to, from, next) => {
if (to.name == "dashboard.custom") {
next({
name: "reports" // Route added by our tool
});
} else {
next();
}
});从仪表板重定向到资源索引
router.beforeEach((to, from, next) => {
if (to.name == "dashboard.custom") {
next({
name: "index",
params: {
resourceName: 'model' // replace with resource name
}
});
} else {
next();
}
});注resourceName是在索引路由中定义的动态段的名称。

https://stackoverflow.com/questions/53337077
复制相似问题