Browse Source

注册时添加默认头像

develop
胡超1 2 years ago
parent
commit
126feca0a7
  1. 8
      24Hour/Controllers/LoginController.cs

8
24Hour/Controllers/LoginController.cs

@ -479,6 +479,10 @@ namespace _24Hour.Controllers
UserModel.Id = Guid.NewGuid().ToString();
UserModel.usertype = 1;
UserModel.audit = 2;
if (string.IsNullOrEmpty(UserModel.photo))
{
UserModel.photo = "/CaseFile/resource/headicon.png";
}
//ĬÈÏÃÜÂë
UserModel.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{UserModel.Password}").ToLower();
var num = await _db.Insertable(UserModel).ExecuteCommandAsync();
@ -504,6 +508,10 @@ namespace _24Hour.Controllers
//ĬÈÏÃÜÂë
UserModel.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{UserModel.Password}").ToLower();
if (string.IsNullOrEmpty(UserModel.photo))
{
UserModel.photo = "/CaseFile/resource/headicon.png";
}
var num = await _db.Insertable(UserModel).ExecuteCommandAsync();
_db.CommitTran();
if (num > 0)

Loading…
Cancel
Save