|
@@ -129,12 +129,12 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
if (string.IsNullOrEmpty(company.RowKey))
|
|
|
{
|
|
|
company.RowKey = Guid.NewGuid().ToString();
|
|
|
- company.PartitionKey = "Company";
|
|
|
+ company.PartitionKey = "BusinessConfig";
|
|
|
company.salt = salt;
|
|
|
- company.password = string.IsNullOrWhiteSpace(company.password) ? Utils.HashedPassword("123456", salt) : Utils.HashedPassword(company.password, salt);//Password,若梦没有则是默认密码:123456
|
|
|
+ company.pwd = string.IsNullOrWhiteSpace(company.pwd) ? Utils.HashedPassword("123456", salt) : Utils.HashedPassword(company.pwd, salt);//Password,若梦没有则是默认密码:123456
|
|
|
company.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
company.jti = Guid.NewGuid().ToString();
|
|
|
- company.secretKey = JwtAuth.CreateBusinessJwtKeyBI(_option.Location, _option.JwtSecretKey, company.RowKey, company.jti);
|
|
|
+ company.token = JwtAuth.CreateBusinessJwtKeyBI(_option.Location, _option.JwtSecretKey, company.RowKey, company.jti);
|
|
|
|
|
|
company = await table.SaveOrUpdate<CompanyTable>(company);
|
|
|
companys.Add(company);
|
|
@@ -143,7 +143,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- List<CompanyTable> companyTables = table.FindListByDictSync<CompanyTable>(new Dictionary<string, object> { { "PartitionKey", "Company" }, { "RowKey", $"{company.RowKey}" } });
|
|
|
+ List<CompanyTable> companyTables = table.FindListByDictSync<CompanyTable>(new Dictionary<string, object> { { "PartitionKey", "BusinessConfig" }, { "RowKey", $"{company.RowKey}" } });
|
|
|
if (companyTables.Count > 0)
|
|
|
{
|
|
|
foreach (var item in companyTables)
|
|
@@ -157,7 +157,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
item.mobile = company.mobile;
|
|
|
//item.salt = company.salt;
|
|
|
//item.password = company.password;
|
|
|
- item.webhookDomain = company.webhookDomain;
|
|
|
+ item.domain = company.domain;
|
|
|
strMsg.Append($"{item.name}【{item.RowKey}】修改企业基础信息:{item}。");
|
|
|
companys.Add(item);
|
|
|
}
|
|
@@ -168,12 +168,12 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
else
|
|
|
{
|
|
|
company.RowKey = Guid.NewGuid().ToString();
|
|
|
- company.PartitionKey = "Company";
|
|
|
+ company.PartitionKey = "BusinessConfig";
|
|
|
company.salt = salt;
|
|
|
- company.password = string.IsNullOrWhiteSpace(company.password) ? Utils.HashedPassword("123456", salt) : Utils.HashedPassword(company.password, salt);//Password,若梦没有则是默认密码:123456
|
|
|
+ company.pwd = string.IsNullOrWhiteSpace(company.pwd) ? Utils.HashedPassword("123456", salt) : Utils.HashedPassword(company.pwd, salt);//Password,若梦没有则是默认密码:123456
|
|
|
company.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
company.jti = Guid.NewGuid().ToString();
|
|
|
- company.secretKey = JwtAuth.CreateBusinessJwtKeyBI(_option.Location, _option.JwtSecretKey, company.RowKey, company.jti);
|
|
|
+ company.token = JwtAuth.CreateBusinessJwtKeyBI(_option.Location, _option.JwtSecretKey, company.RowKey, company.jti);
|
|
|
|
|
|
company = await table.SaveOrUpdate<CompanyTable>(company);
|
|
|
companys.Add(company);
|
|
@@ -259,7 +259,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
List<BusinessSchool> busSchools = new();
|
|
|
foreach (var item in recScs)
|
|
|
{
|
|
|
- BusinessSchool businessSchool = new() { PartitionKey = $"BusinessSchool-{id}", RowKey = $"{item.id}", name = $"{item.name}", picture = $"{item.picture}" };
|
|
|
+ BusinessSchool businessSchool = new() { PartitionKey = $"BusinessSchool", RowKey = Guid.NewGuid().ToString(), school = $"{item.id}", bizid = $"{id}", name = $"{item.name}", picture = $"{item.picture}" };
|
|
|
busSchools.Add(businessSchool);
|
|
|
strMsg.Append($"{item.name}[{item.id}],");
|
|
|
}
|
|
@@ -289,7 +289,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (!jsonElement.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
|
+ jsonElement.TryGetProperty("id", out JsonElement id);
|
|
|
jsonElement.TryGetProperty("site", out JsonElement site);
|
|
|
|
|
|
var tableClient = _azureStorage.GetCloudTableClient();
|
|
@@ -301,7 +301,14 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
}
|
|
|
|
|
|
var table = tableClient.GetTableReference("IESOpenApi");
|
|
|
- List<BusinessSchool> busSchools = await table.FindListByDict<BusinessSchool>(new Dictionary<string, object> { { "PartitionKey", $"BusinessSchool-{id}" } });
|
|
|
+ Dictionary<string, object> keyValue = new() { { "PartitionKey", $"BusinessSchool" } };
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty($"{id}"))
|
|
|
+ {
|
|
|
+ keyValue.Add("bizid", $"{id}");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<BusinessSchool> busSchools = await table.FindListByDict<BusinessSchool>(keyValue);
|
|
|
|
|
|
return Ok(new { state = 200, busSchools });
|
|
|
}
|