-
Notifications
You must be signed in to change notification settings - Fork 6
/
Plugin.cs
47 lines (42 loc) · 1.39 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using SiteServer.Plugin;
using SS.Login.Core;
namespace SS.Login
{
public class Plugin : PluginBase
{
public const string PluginId = "SS.Login";
public static bool IsOAuthReady(OAuthType oAuthType)
{
var configInfo = Utils.GetConfigInfo();
if (oAuthType == OAuthType.Weibo)
{
return configInfo.IsWeibo;
}
if (oAuthType == OAuthType.Weixin)
{
return configInfo.IsWeixin;
}
if (oAuthType == OAuthType.Qq)
{
return configInfo.IsQq;
}
return false;
}
public static OAuthRepository OAuthRepository { get; set; }
public override void Startup(IService service)
{
OAuthRepository = new OAuthRepository();
service
.AddDatabaseTable(OAuthRepository.TableName, OAuthRepository.TableColumns)
.AddStlElementParser(StlLogin.ElementName, StlLogin.Parse)
.AddStlElementParser(StlLogout.ElementName, StlLogout.Parse)
.AddStlElementParser(StlRegister.ElementName, StlRegister.Parse)
.AddSystemMenu(() => new Menu
{
Text = "第三方登录设置",
Href = "pages/settings.html"
})
;
}
}
}