Skip to content

Commit

Permalink
支持从配置文件读取应用标识和密钥
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jan 31, 2024
1 parent 0b7256b commit b1bebe0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Stardust/StarFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,17 @@ private void Init()
json.LoadAll();

Server = json["StarServer"];
AppId = json["StarAppId"];
Secret = json["StarSecret"];
}
if (Server.IsNullOrEmpty() && File.Exists("appsettings.json".GetFullPath()))
{
using var json = new JsonConfigProvider { FileName = "appsettings.json" };
json.LoadAll();

Server = json["StarServer"];
AppId = json["StarAppId"];
Secret = json["StarSecret"];
}

if (!Server.IsNullOrEmpty() && Local.Server.IsNullOrEmpty()) Local.Server = Server;
Expand Down

0 comments on commit b1bebe0

Please sign in to comment.