|
@@ -107,23 +107,47 @@ namespace TEAMModelOS.Controllers.Third
|
|
|
{
|
|
|
teachers.Add(item);
|
|
|
}
|
|
|
+ var url = _configuration.GetValue<string>("HaBookAuth:CoreAPI");
|
|
|
+ var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
|
|
|
+ var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
|
|
|
+ var location = _option.Location;
|
|
|
List<string> unbind = new List<string>();
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ (int code, string content) = await _accountHttpService.Implicit(clientID, clientSecret, location, $"{url}/oauth2/implicit",
|
|
|
+ new Dictionary<string, string>()
|
|
|
+ {
|
|
|
+ { "grant_type", "implicit" },
|
|
|
+ { "client_id",clientID },
|
|
|
+ { "account","1639025968" },
|
|
|
+ { "nonce",Guid.NewGuid().ToString()}
|
|
|
+ });
|
|
|
+
|
|
|
foreach (var teacher in teachers)
|
|
|
{
|
|
|
var a = teacher.binds.SelectMany(y => y.data).ToList().Find(x => !string.IsNullOrEmpty(x));
|
|
|
if (a != null)
|
|
|
{
|
|
|
- await _azureStorage.UploadFileByContainer("teammodelos", a, $"yxpt/scpjx/scbind", $"{teacher.id}.json");
|
|
|
+ // await _azureStorage.UploadFileByContainer("teammodelos", a, $"yxpt/scpjx/scbind", $"{teacher.id}.json");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // unbind.
|
|
|
+ unbind.Add(teacher.id);
|
|
|
}
|
|
|
-
|
|
|
+ //(int code, string content) = await _accountHttpService.Implicit(clientID, clientSecret, location, $"{url}/oauth2/implicit",
|
|
|
+ // new Dictionary<string, string>()
|
|
|
+ // {
|
|
|
+ // { "grant_type", "implicit" },
|
|
|
+ // { "client_id",clientID },
|
|
|
+ // { "account",teacher.id },
|
|
|
+ // { "nonce",Guid.NewGuid().ToString()}
|
|
|
+ // });
|
|
|
+ //if (content.Contains("error")) {
|
|
|
+ // unbind.Add(teacher.id);
|
|
|
+ //}
|
|
|
+ //list.Add(content);
|
|
|
}
|
|
|
await _dingDing.SendBotMsg($"OS,{_option.Location}\n绑定失败,出现的原因可能是 参数异常:\n{unbind.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
-
|
|
|
- return Ok();
|
|
|
+ return Ok(new { unbind ,list});
|
|
|
}
|
|
|
|
|
|
/// <summary>
|