gpt4 book ai didi

sitecore - 如何设置 Sitecore 8 默认登录重定向/起始页?

转载 作者:行者123 更新时间:2023-12-02 19:18:35 27 4
gpt4 key购买 nike

也许我刚刚耗尽了我的 Google 魔力,但我无法弄清楚:

在 Sitecore 8 用户设置中,我可以为每个用户设置一个“起始 URL”,即用户登录成功后定向到的页面/URL。设置该值的界面如下所示:

enter image description here

如果我单击“桌面”并点击“保存”,StartUrl 字段的值将设置为 /sitecore/shell/default.aspx用户会被重定向到经典的“Lighthouse”桌面。

如果我单击内容编辑器并点击保存,StartUrl字段的值将设置为/sitecore/shell/applications/clientusesoswindows.aspx 并且用户被重定向到内容编辑器,实际上是 /sitecore/shell/Applications/Content editor.aspx (发生额外的重定向)。

如果我单击“默认”并点击“保存”,则“StartUrl”字段的值将设置为空字符串,并且用户将有效地重定向到 Launchpad 事物/sitecore/shell/sitecore/client/Applications/Launchpad.aspx

我的问题是:如何更改默认行为,即如果用户选择默认,我如何决定用户重定向到的位置?我希望他们默认进入内容编辑器,他们并不真正喜欢启动板。

最佳答案

当您在用户管理器中选择默认时,它会有效地将用户配置文件StartUrl值设置为空。这只会在用户登录后将用户定向到您网站上的 /sitecore

/sitecore 有一个到启动板的 302 重定向。我还没弄清楚它在哪里设置。

一个选项是自定义logging管道。默认设置是:

<loggingin argsType="Sitecore.Pipelines.LoggingIn.LoggingInArgs">
<processor mode="on" type="Sitecore.Pipelines.LoggingIn.ClearCache, Sitecore.Kernel" />
<processor mode="on" type="Sitecore.Pipelines.LoggingIn.CheckClientUser, Sitecore.Kernel" />
<processor mode="on" type="Sitecore.Pipelines.LoggingIn.CheckStartUrl, Sitecore.Kernel" />
</loggingin>

您可以在 CheckStartUrl 处理器中添加一个新处理器,如果 StartUrl 为空,请将其从设置等更新为默认值...

类似这样的*:

public class CustomCheckStartUrl : CheckStartUrl
{
protected override bool ValidateStartUrl(LoggingInArgs args)
{
var isValid = base.ValidateStartUrl(args);

// override the default start url
if (string.IsNullOrWhiteSpace(args.StartUrl))
{
args.StartUrl = Sitecore.Configuration.Settings.GetSetting("MyDefaultStartPage", string.Empty);
}

return isValid;
}
}

并将其修补到管道中。

*未经测试的代码

关于sitecore - 如何设置 Sitecore 8 默认登录重定向/起始页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32824047/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com