Song.Site/Mobile/Register.ashx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WeiSha.Common;
using Song.ServiceInterfaces;
using Song.Extend;

namespace Song.Site.Mobile
{
    /// <summary>
    /// 学员注册
    /// </summary>
    public class Register : BasePage
    {
        //账号,密码,验证码
        string acc = WeiSha.Common.Request.Form["tbAcc"].String;
        string pw = WeiSha.Common.Request.Form["tbPw"].String;
        string code = WeiSha.Common.Request.Form["tbCode"].String;
        //状态代码
        int state = WeiSha.Common.Request.QueryString["state"].Int16 ?? 0;
        protected override void InitPageTemplate(HttpContext context)
        {
            //是否允许注册
            WeiSha.Common.CustomConfig config = CustomConfig.Load(this.Organ.Org_Config);
            this.Document.SetValue("IsRegStudent", config["IsRegStudent"].Value.Boolean ?? true);
            //状态
            this.Document.SetValue("state", state);
            if (state == 1)
            {
                //将账号信息写入
                Song.Entities.Student emp = Extend.LoginState.Student.CurrentUser;
                this.Document.SetValue("accid", emp.St_ID);
                this.Document.SetValue("accpw", emp.St_Pw);
                return;
            }
            //
            if (!string.IsNullOrWhiteSpace(acc))
            {
                _register(context);
            }
            
        }

        private void _register(HttpContext context)
        {
            //来源
            string from = WeiSha.Common.Request.Form["from"].String;
            from = string.IsNullOrWhiteSpace(from) ? context.Request.UrlReferrer.ToString() : from;
            this.Document.SetValue("from", from);
            //账号为空
            if (string.IsNullOrWhiteSpace(acc))
                this.Response.Redirect(addPara(context.Request.FilePath, "state=-1"));
            //验证码不正确
            if (!isCodeImg())
                this.Response.Redirect(addPara(context.Request.FilePath, "state=-2", "acc=" + acc));
            //当前机构,通过二级域名判断,如果不存在或无法判断,则返回默认机构
            Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();

            Song.Entities.Student tmp = new Entities.Student();
后面还有 49 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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