Skip to content

Commit

Permalink
修正手机端短信发送问题
Browse files Browse the repository at this point in the history
  • Loading branch information
weishakeji committed Nov 12, 2018
1 parent cb81ee1 commit 98a7401
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 23 deletions.
Binary file modified Lib/WeiSha.Common.dll
Binary file not shown.
Binary file modified Lib/WeiSha.Data.dll
Binary file not shown.
43 changes: 31 additions & 12 deletions Song.ServiceImpls/OutlineCom.cs
Expand Up @@ -201,13 +201,14 @@ public Outline OutlineSingle(string uid)
/// <returns></returns>
public List<int> TreeID(int id)
{
List<int> list = new List<int>();
Outline ol = Gateway.Default.From<Outline>().Where(Outline._.Ol_ID == id).ToFirst<Outline>();
if (ol == null) return list;
List<int> ints = new List<int>();
Outline ol = this.OutlineSingle(id);
if (ol == null) return ints;
//取同一个课程下的所有章节
Outline[] ols = Gateway.Default.From<Outline>().Where(Outline._.Cou_ID == ol.Cou_ID).ToArray<Outline>();
list = _treeid(id, ols);
return list;
Outline[] ols = this.OutlineCount(ol.Cou_ID, -1, true, -1);

ints = _treeid(id, ols);
return ints;
}
private List<int> _treeid( int id,Outline[] ols)
{
Expand Down Expand Up @@ -361,13 +362,13 @@ public List<Outline> OutlineBuildCache()
{
WeiSha.Common.Cache<Song.Entities.Outline>.Data.Clear();
Song.Entities.Outline[] outls = Gateway.Default.From<Song.Entities.Outline>().ToArray<Outline>();
//计算每个章节下的试题数
foreach (Outline o in outls)
{
o.Ol_QuesCount = this.QuesOfCount(o.Ol_ID, -1, true, true);
Gateway.Default.Save<Outline>(o);
}
WeiSha.Common.Cache<Song.Entities.Outline>.Data.Fill(outls);
////计算每个章节下的试题数
//foreach (Outline o in outls)
//{
// o.Ol_QuesCount = this.QuesOfCount(o.Ol_ID, -1, true, true);
// Gateway.Default.Save<Outline>(o);
//}
return WeiSha.Common.Cache<Outline>.Data.List;
}
}
Expand All @@ -387,6 +388,24 @@ public Outline[] OutlineCount(int couid, string search, bool? isUse, int count)
}
public Outline[] OutlineCount(int couid, int pid, bool? isUse, int count)
{
//从缓存中读取
List<Outline> list = WeiSha.Common.Cache<Outline>.Data.List;
if (list == null || list.Count < 1) list = this.OutlineBuildCache();
//linq查询
var from = from l in list select l;
if (couid > 0) from = from.Where<Outline>(p => p.Cou_ID == couid);
if (isUse != null) from = from.Where<Outline>(p => p.Ol_IsUse == (bool)isUse);
List<Outline> tm = null;
if (count > 0)
{
tm = from.OrderBy(c => c.Ol_Tax).Take<Outline>(count).ToList<Outline>();
}
else
{
tm = from.OrderBy(c => c.Ol_Tax).ToList<Outline>();
}
if (tm.Count > 0) return tm.ToArray<Outline>();
//从数据库读取
WhereClip wc = Outline._.Cou_ID == couid;
if (pid >= 0) wc.And(Outline._.Ol_PID == pid);
if (isUse != null) wc.And(Outline._.Ol_IsUse == (bool)isUse);
Expand Down
4 changes: 2 additions & 2 deletions Song.Site/Manage/Index.aspx
Expand Up @@ -30,8 +30,8 @@
<asp:ImageButton ID="imgBtn" CssClass="imgBtn" ImageUrl="~/Manage/Images/index/loginbtn.jpg"
runat="server" TabIndex="4" OnClick="btnEnter_Click" validationgroup="enter" />
</div>
<div id="copyright">技术支持:<br/><%= copyright["tel"]%><br/>
<a href="<%= copyright["url"]%>" target="_blank" title="<%= copyright["compay"]%>"><%= copyright["abbr"]%></a>
<div id="copyright"><a href="<%= copyright["url"]%>" target="_blank" title="<%= copyright["compay"]%>"><%= copyright["abbr"]%></a><br/><%= copyright["tel"]%><br/>

</div></td>
</tr>
<tr>
Expand Down
15 changes: 9 additions & 6 deletions Song.Site/Mobile/AddQues.ashx.cs
Expand Up @@ -18,12 +18,15 @@ public class AddQues : IHttpHandler
protected int couid = WeiSha.Common.Request.QueryString["couid"].Int32 ?? 0;
public void ProcessRequest(HttpContext context)
{
//如果不存在收藏,则添加
Song.Entities.Student_Ques stc = new Entities.Student_Ques();
stc.Ac_ID = Extend.LoginState.Accounts.CurrentUser.Ac_ID;
stc.Qus_ID = qid;
stc.Cou_ID = couid;
Business.Do<IStudent>().QuesAdd(stc);
if (Extend.LoginState.Accounts.IsLogin)
{
//如果不存在收藏,则添加
Song.Entities.Student_Ques stc = new Entities.Student_Ques();
stc.Ac_ID = Extend.LoginState.Accounts.CurrentUser.Ac_ID;
stc.Qus_ID = qid;
stc.Cou_ID = couid;
Business.Do<IStudent>().QuesAdd(stc);
}
}

public bool IsReusable
Expand Down
2 changes: 1 addition & 1 deletion Song.Site/Properties/AssemblyInfo.cs
Expand Up @@ -6,7 +6,7 @@
// 控制。更改这些属性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("微厦在线学习平台")]
[assembly: AssemblyDescription("ReleaseDate 2018-11-11")]
[assembly: AssemblyDescription("ReleaseDate 2018-11-12")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("微厦科技")]
[assembly: AssemblyProduct("微厦在线学习平台")]
Expand Down
7 changes: 6 additions & 1 deletion Song.Site/Student/Register.ashx.cs
Expand Up @@ -6,6 +6,8 @@
using Song.ServiceInterfaces;
using Song.Extend;
using System.Reflection;
using System.Collections;
using LitJson;

namespace Song.Site.Student
{
Expand Down Expand Up @@ -75,7 +77,10 @@ private void mobivcode_verify()
{
bool success = Business.Do<ISMS>().SendVcode(phone, "reg_mobi_" + vname);
//bool success = true;
if (success) Response.Write("{\"success\":\"1\",\"state\":\"0\"}"); //短信发送成功
Hashtable hash = new Hashtable();
hash["success"] = 1;
hash["state"] = 0;
if (success) Response.Write(JsonMapper.ToJson(hash)); //短信发送成功
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion Song.Site/Templates/Mobi/Default/Scripts/Register.js
Expand Up @@ -67,7 +67,7 @@ function _mobi_smsSend() {
vname = tmp = rs ? rs[2] : "";
var phone = $("form input[name=Ac_MobiTel1]").val(); //手机号
$("#getSms").attr("state", "waiting").text("验证中...").css("cursor", "default");
$.post(window.location.href, { action: "getSms", vcode: vcode, vname: vname, Ac_MobiTel1: phone }, function (requestdata) {
$.post(window.location.href, { action: "getSms", vcode: vcode, vname: vname, phone: phone }, function (requestdata) {
var data = eval("(" + requestdata + ")");
var state = Number(data.state); //状态值
if (Number(data.success) < 1) {
Expand Down
1 change: 1 addition & 0 deletions Song.Site/Templates/Mobi/_Public/OnlyWeixin.htm
Expand Up @@ -12,6 +12,7 @@
.txt {
text-align: center;
margin: 50px;
color: #999;
}
#footer {
position: fixed;
Expand Down

0 comments on commit 98a7401

Please sign in to comment.