public JsonResult ChangePassword(string oldpassword, string password) { if (string.IsNullOrWhiteSpace(oldpassword) || string.IsNullOrWhiteSpace(password)) { Result result = new Result() { success = false, msg = "密码不能为空!" }; return(Json(result)); } ISellerManager currentSellerManager = base.CurrentSellerManager; if (SecureHelper.MD5(string.Concat(SecureHelper.MD5(oldpassword), currentSellerManager.PasswordSalt)) != currentSellerManager.Password) { Result result1 = new Result() { success = false, msg = "旧密码错误" }; return(Json(result1)); } ServiceHelper.Create <IManagerService>().ChangeSellerManagerPassword(base.CurrentSellerManager.Id, base.CurrentSellerManager.ShopId, password, base.CurrentSellerManager.RoleId); Result result2 = new Result() { success = true, msg = "修改成功" }; return(Json(result2)); }
public async Task <IViewComponentResult> InvokeAsync(ISellerManager CurrentSellerManager) { var CurrentSiteSetting = SiteSettingApplication.SiteSettings; if (CurrentSellerManager != null) { var shopInfo = Mall.Application.ShopApplication.GetShopInfo(CurrentSellerManager.ShopId); ViewBag.IsSellerAdmin = shopInfo.IsSelf; ViewBag.ShopId = CurrentSellerManager.ShopId; ViewBag.Name = CurrentSellerManager.UserName; ViewBag.SiteName = CurrentSiteSetting.SiteName; ViewBag.Logo = Mall.Core.MallIO.GetImagePath(CurrentSiteSetting.MemberLogo); ViewBag.EndDate = shopInfo.EndDate.ToString("yyyy-MM-dd"); var cache = CacheKeyCollection.isPromptKey(CurrentSellerManager.ShopId); var cacheCode = Core.Cache.Get <string>(cache); if (cacheCode == null) { Core.Cache.Insert(cache, "0", DateTime.Parse(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"))); //一天只提醒一次 ViewBag.isPrompt = shopInfo.EndDate < DateTime.Now.AddDays(15) ? 1 : 0; //到期前15天提示 } else { ViewBag.isPrompt = 0; } } return(View(CurrentSellerManager)); }
public AccountAppService( UserRegistrationManager userRegistrationManager, ISellerManager sellerManeger ) { _userRegistrationManager = userRegistrationManager; SellerManeger = sellerManeger; }
public JsonResult CheckOldPassword(string password) { ISellerManager currentSellerManager = base.CurrentSellerManager; string str = SecureHelper.MD5(string.Concat(SecureHelper.MD5(password), currentSellerManager.PasswordSalt)); if (currentSellerManager.Password == str) { return(Json(new Result() { success = true })); } return(Json(new Result() { success = false })); }
public SellerController(ISellerManager iSellerManager) { _iSellerManager = iSellerManager; }
public void TearDown() { iSellerManager = null; }
public void SetUp() { iSellerManager = new SellerManager(new SellerRepository(new SellerDBContext())); }
public Seller(ISellerManager sellerManager) { _sellerManager = sellerManager; }
protected WebShopAppServiceBase() { LocalizationSourceName = WebShopConsts.LocalizationSourceName; SellerManager = IocManager.Instance.Resolve <ISellerManager>(); }
public SellerController(ISellerManager iSellerManager, ILogger <SellerController> logger) { _iSellerManager = iSellerManager; _logger = logger; }
public async Task <IViewComponentResult> InvokeAsync(ISellerManager CurrentSellerManager) { ViewBag.Rights = string.Join(",", CurrentSellerManager.SellerPrivileges.Select(a => (int)a).OrderBy(a => a)); return(View()); }