49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System.Windows;
|
|
using VideoConcat.Common.Api.Base;
|
|
using VideoConcat.Common.Tools;
|
|
|
|
namespace VideoConcat.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void BtnExit_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private async void BtnLogin_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
string _userName = Username.Text;
|
|
string _password = Password.Password;
|
|
|
|
if (string.IsNullOrEmpty(_userName) || string.IsNullOrEmpty(_password))
|
|
{
|
|
Username.Clear();
|
|
Password.Clear();
|
|
WPFDevelopers.Controls.MessageBox.Show("请输入用户名或者密码!");
|
|
return;
|
|
}
|
|
ApiResponse<UserLoginResponse> res = await SystemApi.LoginAsync<UserLoginResponse>(_userName, _password);
|
|
if (res.Code !=0)
|
|
{
|
|
WPFDevelopers.Controls.MessageBox.Show(res.Msg);
|
|
}
|
|
else
|
|
{
|
|
new Video().Show();
|
|
Close();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|