我正在使用Postman Chrome Extension对服务进行POST,我得到了预期的响应.
但是,当我使用相同的POST请求时$http,一切都会变成地狱.
我得到一个:
Request header field Engaged-Auth-Token is not allowed by Access-Control-Allow-Headers
Run Code Online (Sandbox Code Playgroud)
Engaged-Auth-Token 作为标题.
我不知道为什么Postman有效并且它不适用于Chrome ...
有任何想法吗?
我这样做:
<Controls:MetroWindow x:Class="BS.Expert.Client.App.Views.ShellView"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShowTitleBar="True"
Title="My Title">
Run Code Online (Sandbox Code Playgroud)
问题是,这是同时在主窗口上定义的主导体,我通过其他窗口控制导航,因此我无法从MetroWindow继承至少尝试更改ViewModel中的标题:
public class ShellViewModel : Conductor<IScreen>.Collection.OneActive, IShell
{
public ShellViewModel()
{
#region mahApps Theme Loading
var theme = ThemeManager.DetectAppStyle(Application.Current);
var appTheme = ThemeManager.GetAppTheme(App.Configuration.Theme);
ThemeManager.ChangeAppStyle(Application.Current, theme.Item2, appTheme);
#endregion
//TODO: Changing Title here is not possible ((MetroWindow)this).Title = "No way";
// Tudo bem na seguinte liña
LocalizeDictionary.Instance.Culture = new System.Globalization.CultureInfo("pt-BR");
ShowPageOne();
}
public void ShowPageOne()
{
ActivateItem(new PageOneViewModel());
}
}
Run Code Online (Sandbox Code Playgroud)
我该如何更改标题?