/// <summary> /// 更新安装包 /// </summary> /// <returns></returns> public ActionResult UpdateApp() { try { NameValueCollection parmas = WorkContext.postparms; AppUpdateConfigInfo update = BSPConfig.AppUpdateConfig; if (update.Version != parmas["version"]) { string filepath = System.Web.HttpContext.Current.Request.MapPath("/") + "update\\" + update.AppFileName; bool file = new FileInfo(filepath).Exists; if (file) { string appfilename = update.AppFileName; update.AppFileName = BSPConfig.ShopConfig.SiteUrl + "/update/" + update.AppFileName; string data = JsonConvert.SerializeObject(update).ToLower(); update.AppFileName = appfilename; return(APIResult("success", data, true)); } else { return(APIResult("error", "抱歉,应用程序已经走丢!")); } } else { return(APIResult("error", "已是最新版本")); } } catch (Exception ex) { return(APIResult("error", "获取失败")); } }
public ActionResult Expand(string account, string code) { if (account == "") { return(AjaxResult("error", "请输入手机号")); } if (code == "") { return(AjaxResult("error", "请输入验证码")); } bool result = ValidateHelper.IsGZYDModbile(account); //if (!result) //{ // return AjaxResult("error", "主人!请使用您的广州移动号码申请《黑米壳通行证》有更多惊喜等着你哟!!"); //} //else { bool coderes = Users.ValidateCode(account, code); if (coderes) { AppUpdateConfigInfo update = BSPConfig.AppUpdateConfig; string data = JsonConvert.SerializeObject(update).ToLower(); bool file = new FileInfo(Server.MapPath("~/") + update.DownLoadUrl).Exists; if (file) { string appfilename = BSPConfig.ShopConfig.SiteUrl + "/" + update.DownLoadUrl; return(AjaxResult("success", appfilename)); } else { return(AjaxResult("error", "抱歉,应用程序已经走丢!")); } } else { return(AjaxResult("error", "手机号或验证码错误")); } } }