Browse Source

冲突解决

Lishi
pry 2 years ago
parent
commit
0f5251416a
2 changed files with 13 additions and 12 deletions
  1. +7
    -5
      HKLib/DB/DbContext.cs
  2. +6
    -7
      HKLib/Interfaces/HKLibHelper.cs

+ 7
- 5
HKLib/DB/DbContext.cs View File

@@ -15,7 +15,7 @@ namespace HKLib.DB
{
public static SqlSugarScope Context = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = Route(),
ConnectionString = Route,
DbType = DbType.Sqlite,//数据库类型
IsAutoCloseConnection = true //不设成true要手动close
}, db =>
@@ -26,11 +26,13 @@ namespace HKLib.DB
};
});

static string Route()
public static string Route
{
var dir = SyncStatic.CreateDir(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Database"));
var r = SyncStatic.CreateFile(Path.Combine(dir, "data.db3"));
return r;
get
{
var dir = SyncStatic.CreateDir(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Database"));
return $"DataSource={SyncStatic.CreateFile(Path.Combine(dir, "Data.db3"))}";
}
}
public static void InitTable()
{


+ 6
- 7
HKLib/Interfaces/HKLibHelper.cs View File

@@ -15,13 +15,12 @@ namespace HKLib.Interfaces
/// </summary>
public static bool SetTime(TimeSpilte input)
{
IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}";
t.JsonParam = input.ToJson();
t.ReqType = MultiType.POST;
}).Build().RunStringFirst();
return true;
return IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}";
t.JsonParam = input.ToJson();
t.ReqType = MultiType.POST;
}).Build().RunStringFirst().ToModel<JObject>()["isSuccess"].ToString().AsBool();
}

/// <summary>


Loading…
Cancel
Save