|
@@ -97,22 +97,31 @@ namespace TEAMModelOS.Controllers
|
|
|
//不存在则发送请求。
|
|
|
|
|
|
Dictionary<string, object> dict = null;
|
|
|
- if (_HasUser.ValueKind.Equals(JsonValueKind.True) || _HasUser.ValueKind.Equals(JsonValueKind.False))
|
|
|
+ if (_HasUser.ValueKind.Equals(JsonValueKind.True))
|
|
|
{
|
|
|
- dict = new Dictionary<string, object> { { "country", $"{_area}" }, { "to", $"{_to}" }, { "lang", $"{_lang}" }, { "HasUser", _HasUser } };
|
|
|
+ dict = new Dictionary<string, object> { { "country", $"{_area}" }, { "to", $"{_to}" }, { "lang", $"{_lang}" }, { "HasUser", true } };
|
|
|
+ }
|
|
|
+ else if (_HasUser.ValueKind.Equals(JsonValueKind.False)) {
|
|
|
+ dict = new Dictionary<string, object> { { "country", $"{_area}" }, { "to", $"{_to}" }, { "lang", $"{_lang}" }, { "HasUser", false } };
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
dict = new Dictionary<string, object> { { "country", $"{_area}" }, { "to", $"{_to}" }, { "lang", $"{_lang}" } };
|
|
|
}
|
|
|
- var httpStatusCode = await _coreAPIHttpService.SendSmsPin(dict, _option.Location, _configuration, _dingDing);
|
|
|
- if (httpStatusCode.Equals(HttpStatusCode.OK))
|
|
|
+ var httpresp = await _coreAPIHttpService.SendSmsPin(dict, _option.Location, _configuration, _dingDing);
|
|
|
+ if (httpresp.code.Equals(HttpStatusCode.OK))
|
|
|
{
|
|
|
var Expire = DateTime.UtcNow.AddSeconds(exp);
|
|
|
//send=1 表示已发送
|
|
|
await _azureRedis.GetRedisClient(8).StringSetAsync(key, new { code = code, send = 1, Expire = Expire.Ticks }.ToJsonString());
|
|
|
_azureRedis.GetRedisClient(8).KeyExpire(key, Expire);
|
|
|
- return Ok(new { send = 1 });
|
|
|
+ if (!string.IsNullOrWhiteSpace(httpresp.content))
|
|
|
+ {
|
|
|
+ return Ok(httpresp.content.ToObject<JsonElement>());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return Ok(new { send = 1 });
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|