Beispiel #1
0
        /// <summary>
        /// 发送短信 POST: sys/sendsms
        /// </summary>
        /// <param name="mobile">The mobile.</param>
        /// <param name="type">1普通短信  2语音短信</param>
        /// <returns><![CDATA[{status:200,statusText:"OK",data:{}}]]></returns>
        public ActionResult SendSms(string mobile, int type)
        {
            ApiStatusCode apiCode;

            SmsLogic.SendSms(type, mobile, out apiCode);
            return(Json(new ResultModel(apiCode)));
        }
Beispiel #2
0
        public ActionResult SendSms(string mobile, int type)
        {
            try
            {
                ApiStatusCode apiCode;

                if (UserLogic.IsExist(mobile))
                {
                    SmsLogic.SendSms(type, mobile, out apiCode);
                }
                else
                {
                    apiCode = ApiStatusCode.账户不存在;
                }

                if (apiCode == ApiStatusCode.OK)
                {
                    return(Json(new ResultModel(apiCode, "短信已发送成功,请注意查收!")));
                }
                else
                {
                    return(Json(new ResultModel(apiCode)));
                }
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("SendSms:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }