|
@@ -1,4 +1,8 @@
|
|
|
|
+using DingTalk.Api;
|
|
|
|
+using DingTalk.Api.Request;
|
|
|
|
+using DingTalk.Api.Response;
|
|
using Hei.Captcha;
|
|
using Hei.Captcha;
|
|
|
|
+using HiTeachCE.Dtos;
|
|
using HiTeachCE.Extension;
|
|
using HiTeachCE.Extension;
|
|
using HiTeachCE.Helpers;
|
|
using HiTeachCE.Helpers;
|
|
using HiTeachCE.Models;
|
|
using HiTeachCE.Models;
|
|
@@ -78,7 +82,7 @@ namespace HiTeachCE.Controllers
|
|
if (request.@params.TryGetValue("deviceId", out string deviceId) && request.@params.TryGetValue("orgCode", out string orgCode) && string.IsNullOrEmpty(unionid))
|
|
if (request.@params.TryGetValue("deviceId", out string deviceId) && request.@params.TryGetValue("orgCode", out string orgCode) && string.IsNullOrEmpty(unionid))
|
|
{
|
|
{
|
|
Dictionary<string, object> dict = ActivationValid(orgCode, unionid);
|
|
Dictionary<string, object> dict = ActivationValid(orgCode, unionid);
|
|
- if (dict!=null && dict.TryGetValue("flag", out object flag) && bool.Parse(flag.ToString()))
|
|
|
|
|
|
+ if (dict != null && dict.TryGetValue("flag", out object flag) && bool.Parse(flag.ToString()))
|
|
{
|
|
{
|
|
if (RedisHelper.HExists("device:" + deviceId, orgCode))
|
|
if (RedisHelper.HExists("device:" + deviceId, orgCode))
|
|
{
|
|
{
|
|
@@ -120,15 +124,16 @@ namespace HiTeachCE.Controllers
|
|
*/
|
|
*/
|
|
|
|
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
- string ClientId =// new List<string>() { "fb564dde14df423cafac2085936e3b96" };
|
|
|
|
- GetLoginUser(JwtClaimTypes.ClientId);
|
|
|
|
|
|
+ string ClientId =// new List<string>() { "fb564dde14df423cafac2085936e3b96" };
|
|
|
|
+ GetLoginUser(JwtClaimTypes.ClientId);
|
|
string groupNum;
|
|
string groupNum;
|
|
if (request.@params.TryGetValue("deviceId", out string deviceId) && string.IsNullOrEmpty(ClientId))
|
|
if (request.@params.TryGetValue("deviceId", out string deviceId) && string.IsNullOrEmpty(ClientId))
|
|
{
|
|
{
|
|
if (RedisHelper.HExists("device:" + ClientId, deviceId))
|
|
if (RedisHelper.HExists("device:" + ClientId, deviceId))
|
|
{
|
|
{
|
|
groupNum = RedisHelper.HGet<string>("device:" + ClientId, deviceId);
|
|
groupNum = RedisHelper.HGet<string>("device:" + ClientId, deviceId);
|
|
- if (string.IsNullOrEmpty(groupNum)) {
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(groupNum))
|
|
|
|
+ {
|
|
do
|
|
do
|
|
{
|
|
{
|
|
groupNum = RandGroupNum();
|
|
groupNum = RandGroupNum();
|
|
@@ -140,12 +145,14 @@ namespace HiTeachCE.Controllers
|
|
}
|
|
}
|
|
else { throw new BizException("装置未注册", 2); }
|
|
else { throw new BizException("装置未注册", 2); }
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
throw new BizException("参数错误", 2);
|
|
throw new BizException("参数错误", 2);
|
|
}
|
|
}
|
|
return builder.Data(groupNum).build();
|
|
return builder.Data(groupNum).build();
|
|
}
|
|
}
|
|
- public string RandGroupNum() {
|
|
|
|
|
|
+ public string RandGroupNum()
|
|
|
|
+ {
|
|
Random random = new Random();
|
|
Random random = new Random();
|
|
String result = "";
|
|
String result = "";
|
|
for (int i = 0; i < 6; i++)
|
|
for (int i = 0; i < 6; i++)
|
|
@@ -163,9 +170,9 @@ namespace HiTeachCE.Controllers
|
|
[Authorize(Policy = Constant.Role_LecturerLearner)]
|
|
[Authorize(Policy = Constant.Role_LecturerLearner)]
|
|
public BaseJosnRPCResponse JoinGroup(JosnRPCRequest<Dictionary<string, string>> request)
|
|
public BaseJosnRPCResponse JoinGroup(JosnRPCRequest<Dictionary<string, string>> request)
|
|
{
|
|
{
|
|
- string ClientId = GetLoginUser(JwtClaimTypes.ClientId);
|
|
|
|
- string Unionid = GetLoginUser(JwtClaimTypes.Id);
|
|
|
|
- string Role = GetLoginUser(JwtClaimTypes.Role);
|
|
|
|
|
|
+ string ClientId = GetLoginUser(JwtClaimTypes.ClientId);
|
|
|
|
+ string Unionid = GetLoginUser(JwtClaimTypes.Id);
|
|
|
|
+ string Role = GetLoginUser(JwtClaimTypes.Role);
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
Dictionary<string, object> dict;
|
|
Dictionary<string, object> dict;
|
|
/**
|
|
/**
|
|
@@ -183,7 +190,8 @@ namespace HiTeachCE.Controllers
|
|
{
|
|
{
|
|
dict = MqttInfo(ClientId, deviceId, groupNum, Unionid, Role);
|
|
dict = MqttInfo(ClientId, deviceId, groupNum, Unionid, Role);
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
throw new BizException("教室不存在", 2);
|
|
throw new BizException("教室不存在", 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -195,7 +203,7 @@ namespace HiTeachCE.Controllers
|
|
return builder.Data(dict).build();
|
|
return builder.Data(dict).build();
|
|
}
|
|
}
|
|
|
|
|
|
- private static Dictionary<string, object> MqttInfo( string ClientId, string deviceId, string groupNum, string Unionid, string Role)
|
|
|
|
|
|
+ private static Dictionary<string, object> MqttInfo(string ClientId, string deviceId, string groupNum, string Unionid, string Role)
|
|
{
|
|
{
|
|
string brokerHostName = BaseConfigModel.Configuration["brokerHostName"];
|
|
string brokerHostName = BaseConfigModel.Configuration["brokerHostName"];
|
|
|
|
|
|
@@ -238,7 +246,7 @@ namespace HiTeachCE.Controllers
|
|
{
|
|
{
|
|
clientId = ClientId,
|
|
clientId = ClientId,
|
|
deviceId = deviceId,
|
|
deviceId = deviceId,
|
|
- unionid = Unionid ,
|
|
|
|
|
|
+ unionid = Unionid,
|
|
role = "lecturer",
|
|
role = "lecturer",
|
|
groupNum = groupNum
|
|
groupNum = groupNum
|
|
};
|
|
};
|
|
@@ -250,7 +258,7 @@ namespace HiTeachCE.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 教学认证
|
|
/// 教学认证
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -272,7 +280,8 @@ namespace HiTeachCE.Controllers
|
|
foreach (var code in members)
|
|
foreach (var code in members)
|
|
{
|
|
{
|
|
var dt = ActivationValid(code.orgCode, unionid);
|
|
var dt = ActivationValid(code.orgCode, unionid);
|
|
- if (dt!=null) {
|
|
|
|
|
|
+ if (dt != null)
|
|
|
|
+ {
|
|
dict.Add(dt);
|
|
dict.Add(dt);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -282,7 +291,7 @@ namespace HiTeachCE.Controllers
|
|
long time = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
|
|
long time = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
|
|
///处理该机构是否激活人数达到上线
|
|
///处理该机构是否激活人数达到上线
|
|
Expression<Func<Member, bool>> limitlinq = null;
|
|
Expression<Func<Member, bool>> limitlinq = null;
|
|
- limitlinq = m => m.orgCode == freeOrg && m.status == 1;
|
|
|
|
|
|
+ limitlinq = m => m.orgCode == freeOrg && m.status == 1;
|
|
List<Member> countMembers = memberService.GetList(limitlinq);
|
|
List<Member> countMembers = memberService.GetList(limitlinq);
|
|
Expression<Func<ActivationCode, bool>> alinq = null;
|
|
Expression<Func<ActivationCode, bool>> alinq = null;
|
|
alinq = m => m.orgCode == freeOrg && m.status == 1;
|
|
alinq = m => m.orgCode == freeOrg && m.status == 1;
|
|
@@ -298,7 +307,8 @@ namespace HiTeachCE.Controllers
|
|
{
|
|
{
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
string role = "admin,lecturer";
|
|
string role = "admin,lecturer";
|
|
- if (RootUsers.Contains(phoneNumber)) {
|
|
|
|
|
|
+ if (RootUsers.Contains(phoneNumber))
|
|
|
|
+ {
|
|
role = "root," + role;
|
|
role = "root," + role;
|
|
}
|
|
}
|
|
Member member = new Member
|
|
Member member = new Member
|
|
@@ -307,14 +317,16 @@ namespace HiTeachCE.Controllers
|
|
orgCode = freeOrg,
|
|
orgCode = freeOrg,
|
|
admin = 0,
|
|
admin = 0,
|
|
status = 1,
|
|
status = 1,
|
|
- // expires = time + freeTTL,
|
|
|
|
|
|
+ // expires = time + freeTTL,
|
|
unionid = unionid,
|
|
unionid = unionid,
|
|
createTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()
|
|
createTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()
|
|
};
|
|
};
|
|
bool flag = memberService.Insert(member);
|
|
bool flag = memberService.Insert(member);
|
|
if (flag)
|
|
if (flag)
|
|
- { var dt = ActivationValid(freeOrg, unionid);
|
|
|
|
- if (dt != null) {
|
|
|
|
|
|
+ {
|
|
|
|
+ var dt = ActivationValid(freeOrg, unionid);
|
|
|
|
+ if (dt != null)
|
|
|
|
+ {
|
|
dict.Add(dt);
|
|
dict.Add(dt);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -339,14 +351,16 @@ namespace HiTeachCE.Controllers
|
|
Expression<Func<Organization, bool>> olinq = null;
|
|
Expression<Func<Organization, bool>> olinq = null;
|
|
olinq = m => m.code == orgCode;
|
|
olinq = m => m.code == orgCode;
|
|
Organization org = organizationService.GetList(olinq).FirstOrDefault();
|
|
Organization org = organizationService.GetList(olinq).FirstOrDefault();
|
|
- if (org != null) {
|
|
|
|
|
|
+ if (org != null)
|
|
|
|
+ {
|
|
Dictionary<string, object> dict = new Dictionary<string, object>() { { "org", new { orgCode = "", name = org.name } }, { "flag", false } };
|
|
Dictionary<string, object> dict = new Dictionary<string, object>() { { "org", new { orgCode = "", name = org.name } }, { "flag", false } };
|
|
if (org.status != 1)
|
|
if (org.status != 1)
|
|
{
|
|
{
|
|
|
|
|
|
dict.Add("msg", "组织机构被禁用!");
|
|
dict.Add("msg", "组织机构被禁用!");
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
//验证组织机构的激活码状态,时间,最大人数
|
|
//验证组织机构的激活码状态,时间,最大人数
|
|
Expression<Func<ActivationCode, bool>> linq = null;
|
|
Expression<Func<ActivationCode, bool>> linq = null;
|
|
linq = m => m.orgCode == org.code;
|
|
linq = m => m.orgCode == org.code;
|
|
@@ -385,43 +399,79 @@ namespace HiTeachCE.Controllers
|
|
dict.Add("msg", "产品授权已经过期!");
|
|
dict.Add("msg", "产品授权已经过期!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
dict.Add("msg", "组织机构授权状态被禁用!");
|
|
dict.Add("msg", "组织机构授权状态被禁用!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
dict.Add("msg", "组织机构没有授权信息!");
|
|
dict.Add("msg", "组织机构没有授权信息!");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return dict;
|
|
return dict;
|
|
}
|
|
}
|
|
- return null ;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 登录
|
|
/// 登录
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpPost("dingLogin")]
|
|
[HttpPost("dingLogin")]
|
|
- public BaseJosnRPCResponse DingLogin(JosnRPCRequest<Dictionary<string, string>> request)
|
|
|
|
|
|
+ public BaseJosnRPCResponse DingLogin(JosnRPCRequest<string> request)
|
|
{
|
|
{
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
- // 根据timestamp, appSecret计算签名值
|
|
|
|
- string stringToSign = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000+"";
|
|
|
|
-
|
|
|
|
- string appSecret = "";
|
|
|
|
- byte[] key = System.Text.Encoding.UTF8.GetBytes(appSecret);
|
|
|
|
- byte[] content = System.Text.Encoding.UTF8.GetBytes(stringToSign);
|
|
|
|
- var hmacsha256 = new HMACSHA256(key);
|
|
|
|
- byte[] signatureBytes = hmacsha256.ComputeHash(content);
|
|
|
|
- string signature = Convert.ToBase64String(signatureBytes);
|
|
|
|
- string urlEncodeSignature = HttpUtility.UrlEncode(signature);
|
|
|
|
- string dingAuth = "https://oapi.dingtalk.com/sns/getuserinfo_bycode?accessKey=xxx×tamp=xxx&signature=xxx";
|
|
|
|
-
|
|
|
|
- return builder.build();
|
|
|
|
|
|
+
|
|
|
|
+ string accessKey = "dingoabikplouc0kaoq7io";
|
|
|
|
+ string appSecret = "05FZlu_DY3PnrpHTxrWQHA-zRIkV1fE-zECbMCULr5SlCUmhmY7x44U4H1-oyhpc";
|
|
|
|
+ IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/sns/getuserinfo_bycode");
|
|
|
|
+ OapiSnsGetuserinfoBycodeRequest req = new OapiSnsGetuserinfoBycodeRequest();
|
|
|
|
+ req.TmpAuthCode = request.@params;
|
|
|
|
+ OapiSnsGetuserinfoBycodeResponse rsp = client.Execute(req, accessKey, appSecret);
|
|
|
|
+
|
|
|
|
+ if (rsp.UserInfo != null && !string.IsNullOrEmpty(rsp.UserInfo.Unionid))
|
|
|
|
+ {
|
|
|
|
+ ///验证通过 验证信息存放在reids
|
|
|
|
+ RedisHelper.HSet("TmpAuthCode:" + request.@params, request.@params, new DingUserInfo
|
|
|
|
+ {
|
|
|
|
+ Unionid = rsp.UserInfo.Unionid,
|
|
|
|
+ Nick = rsp.UserInfo.Nick,
|
|
|
|
+ Openid = rsp.UserInfo.Openid
|
|
|
|
+ });
|
|
|
|
+ RedisHelper.Expire("TmpAuthCode:" + request.@params, ticketTTL);
|
|
|
|
+
|
|
|
|
+ Expression<Func<Lecturer, bool>> linq = null;
|
|
|
|
+ linq = l => l.dingUnionid == rsp.UserInfo.Unionid;
|
|
|
|
+ List<Lecturer> list = lecturerService.GetList(linq);
|
|
|
|
+ if (list.IsNotEmpty() && !string.IsNullOrEmpty(list[0].cellphone))
|
|
|
|
+ {
|
|
|
|
+ RedisHelper.HSet("ticket:" + request.@params, list[0].cellphone, list[0].cellphone);
|
|
|
|
+ RedisHelper.Expire("ticket:" + request.@params, ticketTTL);
|
|
|
|
+ Dictionary<string, object> dict = UserValid(list[0].cellphone);
|
|
|
|
+ dict.Add("ticket", request.@params );
|
|
|
|
+ return builder.Data(dict).build();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ Dictionary<string, object> dict = new Dictionary<string, object> {
|
|
|
|
+ { "status",1},
|
|
|
|
+ };
|
|
|
|
+ dict.Add("TmpAuthCode", request.@params);
|
|
|
|
+ return builder.Data(dict).build();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ throw new BizException("钉钉后端验证失败", 2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// HmacSHA256算法,返回的结果始终是32位
|
|
/// HmacSHA256算法,返回的结果始终是32位
|
|
@@ -469,7 +519,8 @@ namespace HiTeachCE.Controllers
|
|
dict.Add("ticket", ticket);
|
|
dict.Add("ticket", ticket);
|
|
return builder.Data(dict).build();
|
|
return builder.Data(dict).build();
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
string[] vals = RedisHelper.HVals<string>(cellphone);
|
|
string[] vals = RedisHelper.HVals<string>(cellphone);
|
|
if (vals != null && vals.Length > 0)
|
|
if (vals != null && vals.Length > 0)
|
|
{
|
|
{
|
|
@@ -524,7 +575,7 @@ namespace HiTeachCE.Controllers
|
|
public List<Organization> GetOrgByUid(string uid)
|
|
public List<Organization> GetOrgByUid(string uid)
|
|
{
|
|
{
|
|
Expression<Func<Member, bool>> mlinq = null;
|
|
Expression<Func<Member, bool>> mlinq = null;
|
|
- mlinq = m => m.unionid == uid && m.status == 1;
|
|
|
|
|
|
+ mlinq = m => m.unionid == uid && m.status == 1;
|
|
List<Member> members = memberService.GetList(mlinq);
|
|
List<Member> members = memberService.GetList(mlinq);
|
|
if (members.IsNotEmpty())
|
|
if (members.IsNotEmpty())
|
|
{
|
|
{
|
|
@@ -565,7 +616,7 @@ namespace HiTeachCE.Controllers
|
|
// claimModel.Claims.Add(new Claim("org", orgCode));
|
|
// claimModel.Claims.Add(new Claim("org", orgCode));
|
|
JwtResponse jwtResponse = JwtHelper.IssueJWT(claimModel);
|
|
JwtResponse jwtResponse = JwtHelper.IssueJWT(claimModel);
|
|
lecturer.password = "";
|
|
lecturer.password = "";
|
|
- return new Dictionary<string, object> { { "status", 2 }, { "jwt", jwtResponse },{ "user", lecturer } };
|
|
|
|
|
|
+ return new Dictionary<string, object> { { "status", 2 }, { "jwt", jwtResponse }, { "user", lecturer } };
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -579,7 +630,7 @@ namespace HiTeachCE.Controllers
|
|
seed.Replace(c, "");
|
|
seed.Replace(c, "");
|
|
pfx = pfx + c;
|
|
pfx = pfx + c;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return new Dictionary<string, object> {
|
|
return new Dictionary<string, object> {
|
|
{ "status",1},
|
|
{ "status",1},
|
|
{ "user",new Lecturer
|
|
{ "user",new Lecturer
|
|
@@ -621,13 +672,14 @@ namespace HiTeachCE.Controllers
|
|
RedisHelper.Expire("captcha:" + request.@params, smsTTL);
|
|
RedisHelper.Expire("captcha:" + request.@params, smsTTL);
|
|
return builder.Data(base64).Extend(new Dictionary<string, object> { { "code", code } }).build();
|
|
return builder.Data(base64).Extend(new Dictionary<string, object> { { "code", code } }).build();
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
throw new BizException("随机码为空!", 2);
|
|
throw new BizException("随机码为空!", 2);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 发送短信
|
|
/// 发送短信
|
|
@@ -641,8 +693,8 @@ namespace HiTeachCE.Controllers
|
|
string captcha = RedisHelper.HGet<string>("captcha:" + request.@params.randCode, request.@params.randCode);
|
|
string captcha = RedisHelper.HGet<string>("captcha:" + request.@params.randCode, request.@params.randCode);
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
bool f = !string.IsNullOrEmpty(captcha) && captcha.Equals(request.@params.captcha.ToLower());
|
|
bool f = !string.IsNullOrEmpty(captcha) && captcha.Equals(request.@params.captcha.ToLower());
|
|
- bool s= RootUsers.Contains(request.@params.cellphone) && request.@params.captcha.ToLower().Equals("0000");
|
|
|
|
- if (f||s)
|
|
|
|
|
|
+ bool s = RootUsers.Contains(request.@params.cellphone) && request.@params.captcha.ToLower().Equals("0000");
|
|
|
|
+ if (f || s)
|
|
{
|
|
{
|
|
string key = request.@params.cellphone;
|
|
string key = request.@params.cellphone;
|
|
|
|
|
|
@@ -664,7 +716,8 @@ namespace HiTeachCE.Controllers
|
|
return builder.Data(await SendMsg(key)).build();
|
|
return builder.Data(await SendMsg(key)).build();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
throw new BizException("验证码错误!", 2);
|
|
throw new BizException("验证码错误!", 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -673,7 +726,7 @@ namespace HiTeachCE.Controllers
|
|
{
|
|
{
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
List<string> RootUsers = BaseConfigModel.Configuration.GetSection("RootUser").Get<List<string>>();
|
|
Dictionary<string, object> data = new Dictionary<string, object>() { { "mobile", key }, { "temp_id", 1 }, { "sign_id", "" } };
|
|
Dictionary<string, object> data = new Dictionary<string, object>() { { "mobile", key }, { "temp_id", 1 }, { "sign_id", "" } };
|
|
-
|
|
|
|
|
|
+
|
|
if (RootUsers.Contains(key))
|
|
if (RootUsers.Contains(key))
|
|
{
|
|
{
|
|
string msgidstr = key;
|
|
string msgidstr = key;
|
|
@@ -682,7 +735,8 @@ namespace HiTeachCE.Controllers
|
|
RedisHelper.Expire(key, smsTTL);
|
|
RedisHelper.Expire(key, smsTTL);
|
|
return new Dictionary<string, object>() { { "msgid", msgidstr }, { "repeat", false } };
|
|
return new Dictionary<string, object>() { { "msgid", msgidstr }, { "repeat", false } };
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
string resdata = await HttpClientHelper.Post(
|
|
string resdata = await HttpClientHelper.Post(
|
|
BaseConfigModel.Configuration["JPush:Push"],
|
|
BaseConfigModel.Configuration["JPush:Push"],
|
|
BaseConfigModel.Configuration["JPush:AppKey"],
|
|
BaseConfigModel.Configuration["JPush:AppKey"],
|