Skip to content

Commit

Permalink
Add QRCode Login For Linux
Browse files Browse the repository at this point in the history
Improve #9
  • Loading branch information
kengwang committed Jun 13, 2020
1 parent c7edacd commit a2b03dc
Show file tree
Hide file tree
Showing 9 changed files with 481 additions and 20 deletions.
17 changes: 17 additions & 0 deletions BiliDuang/BiliDuang.csproj
Expand Up @@ -44,6 +44,11 @@
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="QRCoder, Version=1.3.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\QRCoder.1.3.9\lib\net40\QRCoder.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -55,6 +60,7 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="DownloadObject.cs" />
Expand All @@ -66,6 +72,8 @@
<Compile Include="JSONCallback\Danmaku.cs" />
<Compile Include="JSONCallback\Interaction.cs" />
<Compile Include="JSONCallback\LikeBoxItem.cs" />
<Compile Include="JSONCallback\QRLoginInfo.cs" />
<Compile Include="JSONCallback\QRUrl.cs" />
<Compile Include="JSONCallback\Season.cs" />
<Compile Include="JSONCallback\Player.cs" />
<Compile Include="JSONCallback\UpUpload.cs" />
Expand Down Expand Up @@ -144,6 +152,12 @@
<Compile Include="UI\LikeSelectItem.Designer.cs">
<DependentUpon>LikeSelectItem.cs</DependentUpon>
</Compile>
<Compile Include="UI\QRLogin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\QRLogin.Designer.cs">
<DependentUpon>QRLogin.cs</DependentUpon>
</Compile>
<Compile Include="UI\UpUpload.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -224,6 +238,9 @@
<EmbeddedResource Include="UI\LikeSelectItem.resx">
<DependentUpon>LikeSelectItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\QRLogin.resx">
<DependentUpon>QRLogin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\UpUpload.resx">
<DependentUpon>UpUpload.cs</DependentUpon>
</EmbeddedResource>
Expand Down
79 changes: 79 additions & 0 deletions BiliDuang/JSONCallback/QRLoginInfo.cs
@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliDuang.JSONCallback.QRLoginInfo
{
public class Data
{
/// <summary>
///
/// </summary>
public string url { get; set; }
}

public class QRLoginInfoNoData
{
/// <summary>
///
/// </summary>
public int code { get; set; }
/// <summary>
///
/// </summary>
public string status { get; set; }
//public int data { get; set; }
/// <summary>
///
/// </summary>
public int ts { get; set; }
/// <summary>
///
/// </summary>
public string message { get; set; }
}

public class QRLoginInfoDataInt
{
/// <summary>
///
/// </summary>
public int code { get; set; }
/// <summary>
///
/// </summary>
public string status { get; set; }
public int data { get; set; }
/// <summary>
///
/// </summary>
public int ts { get; set; }
/// <summary>
///
/// </summary>
public string message { get; set; }
}

public class QRLoginInfoData
{
/// <summary>
///
/// </summary>
public int code { get; set; }
/// <summary>
///
/// </summary>
public string status { get; set; }
public Data data { get; set; }
/// <summary>
///
/// </summary>
public int ts { get; set; }
/// <summary>
///
/// </summary>
public string message { get; set; }
}
}
41 changes: 41 additions & 0 deletions BiliDuang/JSONCallback/QRUrl.cs
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliDuang.JSONCallback.QRUrl
{
public class Data
{
/// <summary>
///
/// </summary>
public string url { get; set; }
/// <summary>
///
/// </summary>
public string oauthKey { get; set; }
}

public class QRUrl
{
/// <summary>
///
/// </summary>
public int code { get; set; }
/// <summary>
///
/// </summary>
public string status { get; set; }
/// <summary>
///
/// </summary>
public int ts { get; set; }
/// <summary>
///
/// </summary>
public Data data { get; set; }
}

}
36 changes: 18 additions & 18 deletions BiliDuang/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions BiliDuang/MainForm.cs
Expand Up @@ -374,8 +374,7 @@ private void LoginButton_MouseDown(object sender, MouseEventArgs e)
}
else
{
Dialog.Show("你的系统不支持账号密码和二维码登录,请手动输入Cookie");
EditSession form = new EditSession();
QRLogin form = new QRLogin();
form.ShowDialog();
RefreshUserData();
}
Expand Down
85 changes: 85 additions & 0 deletions BiliDuang/UI/QRLogin.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2b03dc

Please sign in to comment.