chore: 支持 master key

oneRain 2020-05-07 15:25:12 +08:00
parent a4eb9dfa0c
commit 1171f4b0de
1 changed files with 13 additions and 1 deletions

View File

@ -22,6 +22,10 @@ namespace LeanCloud {
get; private set;
}
public static string MasterKey {
get; private set;
}
public static bool UseProduction {
get; set;
}
@ -34,7 +38,14 @@ namespace LeanCloud {
get; private set;
}
public static void Initialize(string appId, string appKey, string server = null) {
public static bool UseMasterKey {
get; set;
}
public static void Initialize(string appId,
string appKey,
string masterKey = null,
string server = null) {
if (string.IsNullOrEmpty(appId)) {
throw new ArgumentException(nameof(appId));
}
@ -44,6 +55,7 @@ namespace LeanCloud {
AppId = appId;
AppKey = appKey;
MasterKey = masterKey;
// 注册 LeanCloud 内部子类化类型
LCObject.RegisterSubclass(LCUser.CLASS_NAME, () => new LCUser());