Exemple #1
0
        public IActionResult func_get2980PwdByMail(string account)
        {
            if (string.IsNullOrEmpty(account))
            {
                return(this.FuncResult(new APIReturn(10000, "参数错误")));
            }

            SignMaker signMaker = new SignMaker();
            Dictionary <string, Object> dicParams = new Dictionary <string, object>();

            dicParams.Add("act", "dy_2980gamesendqqmail");
            dicParams.Add("mail", account);
            dicParams.Add("portkey", DC2Conf.Passport2980);
            string sign = signMaker.MakeSign(dicParams);

            Dictionary <string, object> argus = new Dictionary <string, object>();

            argus.Add("act", "dy_2980gamesendqqmail");
            argus.Add("portkey", DC2Conf.Passport2980);
            argus.Add("mail", account);
            argus.Add("sig", sign);

            ReturnMsg2980 ret = P2980Invoker.InvokeHttp("funswregister", argus);

            #region 返回码处理

            int    code;
            string msg;
            if (ret.Code == 250)
            {
                code = 0;
                msg  = string.Empty;
            }
            else if (ret.Code == 201)
            {
                //用户名格式不正确
                code = 10302;
                msg  = "帐号格式错误";
            }
            else if (ret.Code == 202)
            {
                //用户不存在
                code = 10300;
                msg  = "帐号不存在";
            }
            else if (ret.Code == 203)
            {
                //该邮箱未绑定QQ
                code = 10520;
                msg  = "邮箱未绑定qq";
            }
            else if (ret.Code == 204)
            {
                //QQ找回密码发送失败
                code = 10502;
                msg  = "找回密码邮件发送失败";
            }
            else if (ret.Code == 500)
            {
                //服务器内部错误
                code = -98;
                msg  = "未知系统错误";
            }
            else
            {
                code = 19801;
                msg  = $"找回密码失败({ret.Code},{ret.Message})";
            }

            #endregion

            return(this.FuncResult(new APIReturn(code, msg)));
        }
Exemple #2
0
        public IActionResult func_getacctinfo(string ip, string gate, string account)
        {
            if (account.Length < 5)
            {
                return(this.FuncResult(new APIReturn(10000, "account error")));
            }

            bool ismobile = IsMobile(account);

            if (account.Contains("@") == false && ismobile)
            {
                account += "@2980.com";
            }

            bool is2980 = account.ToLower().EndsWith("@2980.com");

            if (is2980)
            {
                string act  = "dy_2980gamegetphoneqq";
                string mail = account.ToLower().Replace("@2980.com", "");


                SignMaker signMaker = new SignMaker();
                Dictionary <string, Object> dicParams = new Dictionary <string, object>();
                dicParams.Add("act", "dy_2980gamegetphoneqq");
                dicParams.Add("mail", mail);
                dicParams.Add("portkey", DC2Conf.Passport2980);
                string sign = signMaker.MakeSign(dicParams);

                Dictionary <string, object> argus = new Dictionary <string, object>();
                argus.Add("act", "dy_2980gamegetphoneqq");
                argus.Add("mail", mail);
                argus.Add("portkey", DC2Conf.Passport2980);
                argus.Add("sig", sign);

                ReturnMsg2980 ret = P2980Invoker.InvokeHttp("funswregister", argus);
                if (ret.Code == 250)
                {
                    string m         = ret.Data["phone"].Value <string>();
                    string mobilestr = "";
                    if (IsMobile(m))
                    {
                        mobilestr = string.Format("{0}*****{1}", m.Substring(0, 3), m.Substring(m.Length - 3, 3));
                    }
                    Hashtable ht = new Hashtable();
                    ht["qq"]    = ret.Data["qq"].Value <string>();
                    ht["phone"] = mobilestr;


                    return(this.FuncResult(new APIReturn(0, "", ht)));
                }
                else if (ret.Code == 201)
                {
                    return(this.FuncResult(new APIReturn(10302, "帐号格式错误")));
                }
                else if (ret.Code == 202)
                {
                    return(this.FuncResult(new APIReturn(10300, "帐号不存在")));
                }
                else if (ret.Code == 203)
                {
                    return(this.FuncResult(new APIReturn(10307, "非手机注册帐号")));
                }
                else if (ret.Code == 301)
                {
                    return(this.FuncResult(new APIReturn(10740, "无效的签名")));
                }
                else
                {
                    return(this.FuncResult(new APIReturn(-98, $"未知系统错误2980{ret.Code}")));
                }
            }

            object[]   objs = new object[] { "action", 1411, "ip", ip ?? string.Empty, "account", account, "gatesrc", gate };
            DCResult   dcr  = DCInvoker.HttpInvoke(DCProdTypes.URS, DCMethodTypes.R, "shell_websys_r", objs.ToArray());
            DicDCValue rmdc = dcr.GetDicDCValue();

            string eamil  = string.Empty;
            string mobile = string.Empty;
            string qq     = string.Empty;

            if (rmdc.Code == 0)
            {
                string m         = rmdc["mobile"];
                string mobilestr = "";
                if (IsMobile(m))
                {
                    mobilestr = string.Format("{0}*****{1}", m.Substring(0, 3), m.Substring(m.Length - 3, 3));
                }
                Hashtable ht = new Hashtable();
                ht["email"]  = rmdc["email"];
                ht["mobile"] = mobilestr;
                ht["qq"]     = rmdc["qq"];
                return(this.FuncResult(new APIReturn(0, "", ht)));
            }
            else if (rmdc.Code == 23)
            {
                return(this.FuncResult(new APIReturn(10300, "账号不存在")));
            }
            else
            {
                return(this.FuncResult(new APIReturn(10324, $"获取帐号信息失败({rmdc.Code})")));
            }
        }