BLL/Views/Users/Login.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UAP;

namespace BLL.Views.Users
{
    public class Login : UAP.Razor.Page
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="pass"></param>
        /// <returns></returns>
        public string login(string mobile, string pass)
        {
            return User.Login(mobile, pass);
        }


        public string register(string mobile, string pass, string code)
        {
            string primary_code = UAP.Session.Get("$code");
            if (!primary_code.Equals(code)) return ("验证码不正确");
            string msg = User.register(mobile, pass);
            if (msg != "ok") return msg;
            return login(mobile, pass);
        }




        /// <summary>
        /// 短信验证码
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public string Send(string mobile)
        {
            try
            {
                string code = "1234";
                #region 正式
                //code = new Random().Next(1111, 9999).ToString();
                //JSON ret = UAP.JSON.Decode(BLL.Msg.Send(mobile, "{no:\"" + code + "\"}", "戴跃雄", "SMS_88185005"));
                //if (!ret.tryT<bool>("success", false)) throw new Exception(ret.String("message"));
                #endregion
                UAP.Session.Set("$code", code);
                return "ok";
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。