Commit c98e90b9 authored by 吴春's avatar 吴春

页面修改

parent 02325bd6
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Edu.Common; using Edu.Common;
using Edu.Common.API; using Edu.Common.API;
...@@ -229,6 +230,10 @@ namespace Edu.WebApi.Controllers.APP ...@@ -229,6 +230,10 @@ namespace Edu.WebApi.Controllers.APP
string account = jobj.GetStringValue("Account"); string account = jobj.GetStringValue("Account");
string UnionId = jobj.GetStringValue("UnionId"); string UnionId = jobj.GetStringValue("UnionId");
string OpenId = jobj.GetStringValue("OpenId"); string OpenId = jobj.GetStringValue("OpenId");
if (string.IsNullOrEmpty(account))
{
return ApiResult.Failed(message: "请授权手机号码!", new { Error = -1 });
}
var model = accountModule.GetStudentExt(new RB_Account_ViewModel() var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{ {
Account = account.Trim(), Account = account.Trim(),
...@@ -341,22 +346,68 @@ namespace Edu.WebApi.Controllers.APP ...@@ -341,22 +346,68 @@ namespace Edu.WebApi.Controllers.APP
string code = parms.GetStringValue("code"); string code = parms.GetStringValue("code");
string encryptedData = parms.GetStringValue("encryptedData"); string encryptedData = parms.GetStringValue("encryptedData");
string iv = parms.GetStringValue("iv"); string iv = parms.GetStringValue("iv");
result res = new result(); result res = new result()
{
phoneNumber = "",
openid = ""
};
try try
{ {
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv); res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
} }
catch catch
{ {
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:1"+Common.Plugin.JsonHelper.Serialize(res));
try
{
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
}
catch
{
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:2" + Common.Plugin.JsonHelper.Serialize(res));
}
}
if (res.phoneNumber== null||string.IsNullOrEmpty(res.phoneNumber))
{
Thread.Sleep(10);
try try
{ {
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv); res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
} }
catch (Exception ex) catch
{ {
Common.Plugin.LogHelper.Write(ex, "GetGuestWeiXinMobile"); Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:3" + Common.Plugin.JsonHelper.Serialize(res));
try
{
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
}
catch
{
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:4" + Common.Plugin.JsonHelper.Serialize(res));
}
}
}
if (res.phoneNumber == null || string.IsNullOrEmpty(res.phoneNumber))
{
Thread.Sleep(10);
try
{
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
}
catch
{
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:5" + Common.Plugin.JsonHelper.Serialize(res));
try
{
res = Common.Plugin.WeChatHelper.GetWechatMobile(encryptedData, code, iv);
}
catch
{
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:6" + Common.Plugin.JsonHelper.Serialize(res));
}
} }
} }
Common.Plugin.LogHelper.Write("GetGuestWeiXinMobile:7" + Common.Plugin.JsonHelper.Serialize(res));
return ApiResult.Success("", res); return ApiResult.Success("", res);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment