Пример #1
0
        public IActionResult Registe2([FromBody] Business business, [FromServices] AppData appData)
        {
            var result  = new JsonData();
            var isExist = service.ExistForCode(business.Code);

            if (isExist)
            {
                result.Msg = "登录帐号已存在,请修改后提交";
                return(Json(result));
            }
            business.ObjectId           = Guid.NewGuid().ToString().ToLower();
            business.Password           = UtilHelper.MD5Encrypt(business.Password);
            business.Category           = BusinessCategory.Chain;
            business.RegisterDate       = DateTime.Now;
            business.StoreId            = service.GetNextStoreNumber();
            business.WeChatAppId        = appData.WeChatAppId;
            business.WeChatSecret       = appData.WeChatSecret;
            business.RefundTemplateId   = appData.Msg_Refund;
            business.NewOrderTemplateId = appData.EventMessageTemplateId;
            business.PayServerAppId     = appData.ServerAppId;
            business.PayServerKey       = appData.ServerKey;
            business.PayServerMchId     = appData.ServerMchId;
            business.CertFile           = appData.CertFile;
            service.Add(business);
            result.Msg     = "连锁店总后台注册成功";
            result.Success = true;
            return(Json(result));
        }