京东慧眼
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

44 lines
1.2 KiB

using CefSharp;
using CefSharp.Wpf;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace .UserControls
{
/// <summary>
/// ItemControl.xaml 的交互逻辑
/// </summary>
public partial class ItemControl : UserControl
{
ChromiumWebBrowser web;
public ItemControl()
{
InitializeComponent();
web = new ChromiumWebBrowser("nacollector://home/item")
{
BrowserSettings =
{
DefaultEncoding = "UTF-8",
Plugins= CefState.Enabled,
//关于跨域限制
WebSecurity = CefState.Disabled
},
};
grid.Children.Add(web);
web.ExecuteScriptAsyncWhenPageLoaded(@$"localStorage.setItem('user', '{{""token"":""{ApiHelper.JwtToken}""}}');window.getDatas(0);");
}
}
}