|
|
|
@ -12,6 +12,8 @@ using VOL.Core.Services;
|
|
|
|
|
using VOL.Core.Utilities;
|
|
|
|
|
using VOL.Entity.DomainModels;
|
|
|
|
|
using ConvertHelper;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
|
|
|
using VOL.Core.CacheManager;
|
|
|
|
|
|
|
|
|
|
namespace VOL.System.Services
|
|
|
|
|
{
|
|
|
|
@ -50,6 +52,27 @@ namespace VOL.System.Services
|
|
|
|
|
if (user == null || loginInfo.PassWord.Trim() != user.UserPwd)
|
|
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
User_Id = user.User_Id,
|
|
|
|
@ -70,12 +93,7 @@ namespace VOL.System.Services
|
|
|
|
|
};
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|