コード例 #1
0
        public Dictionary <string, Object> Regist(Account account)
        {
            try
            {
                Dictionary <string, Object> dic = new Dictionary <string, object>();
                string httpStatusCode           = CommonRequest.ApiAccountRegist(account);

                if (httpStatusCode == "202")
                {
                    //绑定逻辑
                    if (!string.IsNullOrEmpty(account.WxOpenID))
                    {
                        dynamic resultModel = CommonRequest.ApiBindAccount(account);
                        if (resultModel == null || !resultModel.IsOk)
                        {
                            logger.Debug("注册时[api/account/Regist/]微信和账号绑定失败");
                        }
                    }

                    SetAuthCookie(account);
                    dic.Add("RESULT", "202");
                }
                else
                {
                    dic.Add("RESULT", "404");
                }

                return(dic);
            }
            catch (Exception e)
            {
                logger.Error("注册接口异常:" + e.Message);
                return(null);
            }
        }