diff --git a/CoreCms.Net.Auth/Policys/PermissionForAdminHandler.cs b/CoreCms.Net.Auth/Policys/PermissionForAdminHandler.cs index 3538be4..b3cd0da 100644 --- a/CoreCms.Net.Auth/Policys/PermissionForAdminHandler.cs +++ b/CoreCms.Net.Auth/Policys/PermissionForAdminHandler.cs @@ -185,6 +185,11 @@ namespace CoreCms.Net.Auth.Policys } return; } + else + { + context.Fail(); + return; + } } else { @@ -192,11 +197,11 @@ namespace CoreCms.Net.Auth.Policys return; } //判断没有登录时,是否访问登录的url,并且是Post请求,并且是form表单提交类型,否则为失败 - if (!questUrl.Equals(requirement.LoginPath.ToLower(), StringComparison.Ordinal) && (!httpContext.Request.Method.Equals("POST") || !httpContext.Request.HasJsonContentType())) - { - context.Fail(); - return; - } + //if (!questUrl.Equals(requirement.LoginPath.ToLower(), StringComparison.Ordinal) && (!httpContext.Request.Method.Equals("POST") || !httpContext.Request.HasJsonContentType())) + //{ + // context.Fail(); + // return; + //} } context.Succeed(requirement); diff --git a/CoreCms.Net.Auth/Policys/PermissionForClientHandler.cs b/CoreCms.Net.Auth/Policys/PermissionForClientHandler.cs index 6f9c383..1a878c2 100644 --- a/CoreCms.Net.Auth/Policys/PermissionForClientHandler.cs +++ b/CoreCms.Net.Auth/Policys/PermissionForClientHandler.cs @@ -157,6 +157,11 @@ namespace CoreCms.Net.Auth.Policys } return; } + else + { + context.Fail(); + return; + } } else { @@ -164,11 +169,11 @@ namespace CoreCms.Net.Auth.Policys return; } //判断没有登录时,是否访问登录的url,并且是Post请求,并且是form表单提交类型,否则为失败 - if (!questUrl.Equals(requirement.LoginPath.ToLower(), StringComparison.Ordinal) && (!httpContext.Request.Method.Equals("POST") || !httpContext.Request.HasJsonContentType())) - { - context.Fail(); - return; - } + //if (!questUrl.Equals(requirement.LoginPath.ToLower(), StringComparison.Ordinal) && (!httpContext.Request.Method.Equals("POST") || !httpContext.Request.HasJsonContentType())) + //{ + // context.Fail(); + // return; + //} } context.Succeed(requirement); diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index c2f2506..52f7fdd 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -2264,6 +2264,29 @@ namespace CoreCms.Net.Configuration COMMISSION_TYPE_FIXED = 2, } + /// + /// 成为分销商条件 + /// + public enum DistributionConditionType + { + + /// + /// 无条件(需审核) + /// + [Description("无条件(需审核)")] + Unconditional = 1, + /// + /// 申请(需审核) + /// + [Description("申请(需审核)")] + Apply = 2, + /// + /// 无需审核 + /// + [Description("无需审核")] + NoReview = 3, + } + #endregion #region 快递100api接口相关=================== diff --git a/CoreCms.Net.Configuration/SystemSettingConstVars.cs b/CoreCms.Net.Configuration/SystemSettingConstVars.cs index 15edd24..c0dc81a 100644 --- a/CoreCms.Net.Configuration/SystemSettingConstVars.cs +++ b/CoreCms.Net.Configuration/SystemSettingConstVars.cs @@ -539,6 +539,61 @@ namespace CoreCms.Net.Configuration public const string SmsSignature = "smsSignature"; + /// + /// 账户注册-短信内容模板 + /// + public const string SmsTplForReg = "smsTplForReg"; + + /// + /// 账户登录-短信内容模板 + /// + public const string SmsTplForLogin = "smsTplForLogin"; + + /// + /// 验证验证码-短信内容模板 + /// + public const string SmsTplForVeri = "smsTplForVeri"; + + /// + /// 下单成功时-短信内容模板 + /// + public const string SmsTplForCreateOrder = "smsTplForCreateOrder"; + + /// + /// 订单支付成功时-短信内容模板 + /// + public const string SmsTplForOrderPayed = "smsTplForOrderPayed"; + + /// + /// 订单催付提醒-短信内容模板 + /// + public const string SmsTplForRemindOrderPay = "smsTplForRemindOrderPay"; + + /// + /// 订单发货通知-短信内容模板 + /// + public const string SmsTplForDeliveryNotice = "smsTplForDeliveryNotice"; + + /// + /// 售后确认通过-短信内容模板 + /// + public const string SmsTplForAfterSalesPass = "smsTplForAfterSalesPass"; + + /// + /// 用户退款成功通知-短信内容模板 + /// + public const string SmsTplForRefundSuccess = "smsTplForRefundSuccess"; + + /// + /// 订单付款成功平台通知-短信内容模板 + /// + public const string SmsTplForSellerOrderNotice = "smsTplForSellerOrderNotice"; + + /// + /// 通用类型-短信内容模板 + /// + public const string SmsTplForCommon = "smsTplForCommon"; + //网络打印机============================================================================ /// /// 是否开启 diff --git a/CoreCms.Net.Configuration/SystemSettingDictionary.cs b/CoreCms.Net.Configuration/SystemSettingDictionary.cs index 688738a..6491dc2 100644 --- a/CoreCms.Net.Configuration/SystemSettingDictionary.cs +++ b/CoreCms.Net.Configuration/SystemSettingDictionary.cs @@ -194,6 +194,19 @@ namespace CoreCms.Net.Configuration di.Add(SystemSettingConstVars.FilesStorageQiNiuBucketName, new DictionaryKeyValues() { sKey = "七牛云桶名称", sValue = "CoreShop" }); + //短信发送内容模板 + di.Add(SystemSettingConstVars.SmsTplForReg, new DictionaryKeyValues() { sKey = "账户注册", sValue = "您正在注册账号,验证码是{code},请勿告诉他人。" }); + di.Add(SystemSettingConstVars.SmsTplForLogin, new DictionaryKeyValues() { sKey = "账户登录", sValue = "您正在登陆账号,验证码是{code},请勿告诉他人。" }); + di.Add(SystemSettingConstVars.SmsTplForVeri, new DictionaryKeyValues() { sKey = "验证验证码", sValue = "您的验证码是{code},请勿告诉他人。" }); + di.Add(SystemSettingConstVars.SmsTplForCreateOrder, new DictionaryKeyValues() { sKey = "下单成功时", sValue = "恭喜您,订单创建成功,祝您购物愉快。" }); + di.Add(SystemSettingConstVars.SmsTplForOrderPayed, new DictionaryKeyValues() { sKey = "订单支付成功时", sValue = "恭喜您,订单支付成功,祝您购物愉快。" }); + di.Add(SystemSettingConstVars.SmsTplForRemindOrderPay, new DictionaryKeyValues() { sKey = "订单催付提醒", sValue = "您的订单还有1个小时就要取消了,请及时进行支付。" }); + di.Add(SystemSettingConstVars.SmsTplForDeliveryNotice, new DictionaryKeyValues() { sKey = "订单发货通知", sValue = "您好,您的订单已经发货。" }); + di.Add(SystemSettingConstVars.SmsTplForAfterSalesPass, new DictionaryKeyValues() { sKey = "售后确认通过", sValue = "您好,您的售后已经通过。" }); + di.Add(SystemSettingConstVars.SmsTplForRefundSuccess, new DictionaryKeyValues() { sKey = "用户退款成功通知", sValue = "用户您好,您的退款已经处理,请确认。" }); + di.Add(SystemSettingConstVars.SmsTplForSellerOrderNotice, new DictionaryKeyValues() { sKey = "订单付款成功平台通知", sValue = "您有新的订单了,请及时处理。" }); + di.Add(SystemSettingConstVars.SmsTplForCommon, new DictionaryKeyValues() { sKey = "通用类型", sValue = "欢迎您访问我们的微信小程序,有问题请联系客服。" }); + return di; } diff --git a/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs index 1403ca6..55a2068 100644 --- a/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs +++ b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs @@ -144,7 +144,7 @@ namespace CoreCms.Net.Services //查询获取几级返利 var user = await _userServices.QueryByClauseAsync(p => p.id == order.userId); - if (user != null && user.parentId > 0) + if (user is { parentId: > 0 }) { //获取购物明细 var orderItems = await _orderItemServices.QueryListByClauseAsync(p => p.orderId == order.orderId); diff --git a/CoreCms.Net.Services/Distribution/CoreCmsDistributionServices.cs b/CoreCms.Net.Services/Distribution/CoreCmsDistributionServices.cs index 117dc41..13fe02e 100644 --- a/CoreCms.Net.Services/Distribution/CoreCmsDistributionServices.cs +++ b/CoreCms.Net.Services/Distribution/CoreCmsDistributionServices.cs @@ -234,10 +234,18 @@ namespace CoreCms.Net.Services iData.gradeId = disGradeModel.id; } } - if (iData.verifyStatus == 0) + + var allConfigs = await _settingServices.GetConfigDictionaries(); + var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0); + if (distributionType == (int)GlobalEnumVars.DistributionConditionType.NoReview) + { + iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes; + } + else { iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyWait; } + iData.isDelete = false; iData.createTime = DateTime.Now; diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs index eed719b..31f0e4e 100644 --- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs +++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs @@ -24,6 +24,7 @@ using CoreCms.Net.Model.Entities.Expression; using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.UI; +using CoreCms.Net.Utility.Extensions; using CoreCms.Net.Utility.Helper; using Newtonsoft.Json; using SqlSugar; @@ -454,7 +455,7 @@ namespace CoreCms.Net.Services goodId = "", num = 0, }); - if (obj.goodId == goodId.ToString()) return false; + if (obj.goodId.ObjectToInt(0) != goodId) return false; promotionsModel = promotions; return true; } diff --git a/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs b/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs index f24fa93..8a91ce3 100644 --- a/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs +++ b/CoreCms.Net.Services/Message/CoreCmsSmsServices.cs @@ -225,7 +225,111 @@ namespace CoreCms.Net.Services { isUsed = true; } - var str = SmsHelper.GetTemp(code, parameters); + + + var str = string.Empty; + var allConfigs = await _settingServices.GetConfigDictionaries(); + + if (code == GlobalEnumVars.SmsMessageTypes.Reg.ToString()) + { + // 账户注册 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForReg); + if (!string.IsNullOrEmpty(msg)) + { + var sendCode = string.Empty; + if (parameters.ContainsKey("code")) + { + sendCode = parameters["code"]?.ToString(); + } + str = msg.Replace("{code}", sendCode); + } + } + else if (code == GlobalEnumVars.SmsMessageTypes.Login.ToString()) + { + // 账户登录 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForLogin); + if (!string.IsNullOrEmpty(msg)) + { + var sendCode = string.Empty; + if (parameters.ContainsKey("code")) + { + sendCode = parameters["code"]?.ToString(); + } + str = msg.Replace("{code}", sendCode); + } + } + else if (code == GlobalEnumVars.SmsMessageTypes.Veri.ToString()) + { + // 验证验证码 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForVeri); + if (!string.IsNullOrEmpty(msg)) + { + var sendCode = string.Empty; + if (parameters.ContainsKey("code")) + { + sendCode = parameters["code"]?.ToString(); + } + str = msg.Replace("{code}", sendCode); + } + } + else if (code == GlobalEnumVars.PlatformMessageTypes.CreateOrder.ToString()) + { + // 订单创建 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForCreateOrder); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.OrderPayed.ToString()) + { + // 订单支付通知买家 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForOrderPayed); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.RemindOrderPay.ToString()) + { + // 未支付催单 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForRemindOrderPay); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.DeliveryNotice.ToString()) + { + // 订单发货 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForDeliveryNotice); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.AfterSalesPass.ToString()) + { + // 售后审核通过 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForAfterSalesPass); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.RefundSuccess.ToString()) + { + // 退款已处理 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForRefundSuccess); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.SellerOrderNotice.ToString()) + { + // 订单支付通知卖家 + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForSellerOrderNotice); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + else if (code == GlobalEnumVars.PlatformMessageTypes.Common.ToString()) + { + //通用类型 + var tpl = string.Empty; + if (parameters.ContainsKey("tpl")) + { + tpl = parameters["tpl"]?.ToString(); + } + str = tpl; + if (!string.IsNullOrEmpty(str)) + { + var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForCommon); + str = !string.IsNullOrEmpty(msg) ? msg : string.Empty; + } + } + if (string.IsNullOrEmpty(str)) { jm.msg = GlobalErrorCodeVars.Code10009; diff --git a/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs b/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs index 56df364..384accf 100644 --- a/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs +++ b/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs @@ -31,7 +31,7 @@ namespace CoreCms.Net.Services { private readonly ICoreCmsPromotionResultRepository _dal; - private ICoreCmsPromotionConditionServices _promotionConditionServices; + private readonly ICoreCmsPromotionConditionServices _promotionConditionServices; private readonly IUnitOfWork _unitOfWork; @@ -156,7 +156,7 @@ namespace CoreCms.Net.Services { case (int)GlobalEnumVars.PromotionType.Promotion: //总促销修改 - cart.orderPromotionMoney = cart.orderPromotionMoney + (decimal)parameters["money"]; + cart.orderPromotionMoney += (decimal)parameters["money"]; //设置促销列表 if (cart.promotionList.ContainsKey(promotionInfo.id)) { @@ -171,7 +171,7 @@ namespace CoreCms.Net.Services case (int)GlobalEnumVars.PromotionType.Coupon: //优惠券促销金额 - cart.couponPromotionMoney = cart.couponPromotionMoney + (decimal)parameters["money"]; + cart.couponPromotionMoney += (decimal)parameters["money"]; break; } return true; @@ -190,7 +190,7 @@ namespace CoreCms.Net.Services //var objDiscount = Convert.ToInt32(parameters["discount"]); if (!parameters.ContainsKey("discount")) return true; - var objDiscount = parameters["discount"].ObjectToInt(0); + var objDiscount = parameters["discount"].ObjectToDecimal(0); //判断参数是否设置的正确 if (objDiscount >= 10 || objDiscount <= 0) @@ -264,7 +264,7 @@ namespace CoreCms.Net.Services public decimal result_GOODS_DISCOUNT(JObject parameters, CartProducts cartProducts, CoreCmsPromotion promotionInfo) { if (!parameters.ContainsKey("discount")) return 0; - var objDiscount = parameters["discount"].ObjectToInt(0); + var objDiscount = parameters["discount"].ObjectToDecimal(0); decimal promotionMoney = 0; decimal goodsPrice = cartProducts.products.price; diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop.vue index 3cc78d7..a396316 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop.vue @@ -1,47 +1,47 @@