|
|
@ -12,6 +12,8 @@ using VOL.Core.Services;
|
|
|
|
using VOL.Core.Utilities;
|
|
|
|
using VOL.Core.Utilities;
|
|
|
|
using VOL.Entity.DomainModels;
|
|
|
|
using VOL.Entity.DomainModels;
|
|
|
|
using ConvertHelper;
|
|
|
|
using ConvertHelper;
|
|
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
|
|
|
|
|
|
using VOL.Core.CacheManager;
|
|
|
|
|
|
|
|
|
|
|
|
namespace VOL.System.Services
|
|
|
|
namespace VOL.System.Services
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -50,6 +52,27 @@ namespace VOL.System.Services
|
|
|
|
if (user == null || loginInfo.PassWord.Trim() != user.UserPwd)
|
|
|
|
if (user == null || loginInfo.PassWord.Trim() != user.UserPwd)
|
|
|
|
return responseContent.Error(ResponseType.LoginError);
|
|
|
|
return responseContent.Error(ResponseType.LoginError);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if(UserContext.GetUser)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UserContext.Current.HaveLogin(user.User_Id))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!AppSetting.CompanySetting.SingleLogin)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//UserContext.Current
|
|
|
|
|
|
|
|
responseContent.Data = UserContext.Current.GetUserInfo(user.User_Id);
|
|
|
|
|
|
|
|
return responseContent.OK(ResponseType.LoginSuccess );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserContext.Current.LogOut(user.User_Id);
|
|
|
|
|
|
|
|
loginInfo.PassWord = string.Empty;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
UserContext.Current.LogOut(user.User_Id);
|
|
|
|
|
|
|
|
loginInfo.PassWord = string.Empty;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string token = JwtHelper.IssueJwt(new UserInfo()
|
|
|
|
string token = JwtHelper.IssueJwt(new UserInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
User_Id = user.User_Id,
|
|
|
|
User_Id = user.User_Id,
|
|
|
@ -70,13 +93,8 @@ namespace VOL.System.Services
|
|
|
|
};
|
|
|
|
};
|
|
|
|
repository.Update(user, x => x.Token, true);
|
|
|
|
repository.Update(user, x => x.Token, true);
|
|
|
|
|
|
|
|
|
|
|
|
if (AppSetting.CompanySetting.SingleLogin) {
|
|
|
|
|
|
|
|
UserContext.Current.LogOut(user.User_Id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loginInfo.PassWord = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return responseContent.OK(ResponseType.LoginSuccess);
|
|
|
|
return responseContent.OK(ResponseType.LoginSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|