|
@@ -1560,6 +1560,7 @@ namespace TEAMModelOS.Controllers.Research
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
if (!HttpContext.Items.TryGetValue("Standard", out object standard)) return Ok(new { error = 400 });
|
|
|
///没有订阅的
|
|
|
List<Ability> notSub = new List<Ability>();
|
|
@@ -1617,18 +1618,27 @@ namespace TEAMModelOS.Controllers.Research
|
|
|
return Ok(new { error = 400 });
|
|
|
};
|
|
|
|
|
|
- AreaSetting areaSetting = null;
|
|
|
+ Area area = null;
|
|
|
try
|
|
|
{
|
|
|
- areaSetting = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>("", new PartitionKey("AreaSetting"));
|
|
|
- if (!string.IsNullOrEmpty(areaSetting.accessConfig)) {
|
|
|
-
|
|
|
- }
|
|
|
+ client.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>($"", requestOptions:new QueryRequestOptions { PartitionKey=new PartitionKey("Base-Area") });
|
|
|
}
|
|
|
- catch (Exception ex) {
|
|
|
- areaSetting = null;
|
|
|
+ catch (CosmosException ex)
|
|
|
+ {
|
|
|
+ return Ok(new { error = 404, msg = "区域不存在!" });
|
|
|
+ }
|
|
|
+ AreaSetting setting = null;
|
|
|
+ if (area != null)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ setting = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>(area.id, new PartitionKey("AreaSetting"));
|
|
|
+ }
|
|
|
+ catch (CosmosException)
|
|
|
+ {
|
|
|
+ return Ok(new { error = 404, msg = "设置不存在!" });
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
foreach (var item in currencyAb2) {
|
|
|
var had = hadSubs.Where(x => x.id.Equals(item.id)).FirstOrDefault();
|
|
|
if (had == null) {
|