public IActionResult MerchantsZhuChe(string ff = "") { MerchantsModel model = JsonConvert.DeserializeObject <MerchantsModel>(ff); int i = _ibll.MerchantsZhuChe(model); return(Ok(i)); }
public MerchantsModel MerchantsLogin(string name, string pass = "") { //解密密码 string str = _ibll.MerchantsPass(name); //登录 if (pass == str) { MerchantsModel model = _ibll.MerchantsLogin(name, str); return(model); } return(null); }
//店家 Merchants 登录注册 #region public string MerchantsPass(string account) { string sql = $"select * from Merchants where MerchantsAccount='{account}'"; using (SqlConnection connection = new SqlConnection(conStr)) { MerchantsModel model = connection.Query <MerchantsModel>(sql).ToList().FirstOrDefault(); //解密密码 对象引用未设置为对象的实例。 string code = helper.GetPayload(model.MerchantsPassword); JwtModel jwt = JsonConvert.DeserializeObject <JwtModel>(code); string str = jwt.userpass; return(str); } }
public int MerchantsZhuChe(MerchantsModel model) { //密码加密 //定义一个字典 Dictionary <string, object> pairs = new Dictionary <string, object>(); pairs.Add("userpass", model.MerchantsPassword); //调用加密方法 var str = helper.GetToken(pairs, 10000); string sql = $"insert into Merchants values('{model.MerchantsAccount}','{str}','{model.MerchantsID}')"; using (SqlConnection connection = new SqlConnection(conStr)) { return(connection.Execute(sql)); } }
public int MerchantsZhuChe(MerchantsModel model) { return(_idal.MerchantsZhuChe(model)); }