示例#1
0
        public IActionResult GetAccountID(string uniacid, string code, string iv, string encryptedData)
        {
            try
            {
                JsonResponse1 <AccountModel> responseModel = new JsonResponse1 <AccountModel>();

                //WXSmallAppCommon.Models.WXAccountInfo wXAccount = WXSmallAppCommon.WXInteractions.WXLoginAction.ProcessRequest(code, iv, encryptedData);
                ///微擎方式
                WXSmallAppCommon.Models.WXAccountInfo wXAccount = We7Tools.We7Tools.GetWeChatUserInfo(uniacid, code, iv, encryptedData);
                var            accountCard = thisData.SaveOrdUpdateAccount(uniacid, wXAccount);
                ResponseStatus stautsCode  = ResponseStatus.请求失败;
                if (accountCard != null)
                {
                    responseModel.JsonData = accountCard;
                    stautsCode             = ResponseStatus.请求成功;
                }
                responseModel.StatusCode = stautsCode;
                string[] param = new string[] { "JsonData", "AccountID", "HasCarNumber", "HasPhone" };
                return(this.JsonSuccessWithLimit(responseModel, param));
            }
            catch (Exception e)
            {
                e.Save();
                return(this.JsonErrorStatus());
            }
        }
示例#2
0
        public string GetAccountID(string uniacid, string code, string iv, string encryptedData)
        {
            try
            {
                BaseResponseModel2 <AccountModel, bool> responseModel = new BaseResponseModel2 <AccountModel, bool>();

                //WXSmallAppCommon.Models.WXAccountInfo wXAccount = WXSmallAppCommon.WXInteractions.WXLoginAction.ProcessRequest(code, iv, encryptedData);
                ///微擎方式
                WXSmallAppCommon.Models.WXAccountInfo wXAccount = We7Tools.We7Tools.GetWeChatUserInfo(uniacid, code, iv, encryptedData);
                var          accountCard = thisData.SaveOrdUpdateAccount(uniacid, wXAccount);
                ActionParams stautsCode  = ActionParams.code_error;
                if (accountCard != null)
                {
                    responseModel.JsonData = accountCard;
                    stautsCode             = ActionParams.code_ok;
                }
                responseModel.JsonData1  = thisData.CheckRelease(uniacid);
                responseModel.StatusCode = stautsCode;
                JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings();
                string[] param = new string[] { "StatusCode", "JsonData", "AccountID", "JsonData1" };
                jsonSerializerSettings.ContractResolver = new LimitPropsContractResolver(param);
                string jsonString = JsonConvert.SerializeObject(responseModel, jsonSerializerSettings);
                return(jsonString);
            }
            catch (Exception e)
            {
                e.Save();
                return(JsonResponseModel.ErrorJson);

                throw;
            }
        }