ZR20090193-陈敬勇 1 year ago
commit fe34eca291

@ -1927,14 +1927,14 @@ let methods = {
//
let GetUSERCOLUMNUrl = "api/Sys_USERCOLUMNSET/GetPageData";
let userInfo = this.$store.getters.getUserInfo();
let userid = userInfo.userId;
let wheres = [{
Name: "USERID",
Value: userid,
displayType: '='
}];
// let userInfo = this.$store.getters.getUserInfo();
// let userid = userInfo.userId;
let wheres = [];
// let wheres = [{
// Name: "USERID",
// Value: userid,
// displayType: '='
// }];
// if (!this.isNullorEmpty(Menu_Id)) {
// wheres.push({ Name: "Menu_Id", Value: Menu_Id, displayType: '=' });
// } else {

@ -51,6 +51,8 @@ module.exports = {
RULEAMOUNT: '申报金额',
STOREHOUSE: '仓库',
STOREHOUSE_2: '备选仓库1',
STOREHOUSE_3: '备选仓库2',
AREACODE: '库位',
STOREHOUSENAME: '仓库',
AREANAME: '库位',

@ -14,6 +14,7 @@ using VOL.Core.Extensions.AutofacManager;
using VOL.Entity;
using VOL.Entity.DomainModels;
using ConvertHelper;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
namespace VOL.Core.ManageUser
{
@ -408,5 +409,20 @@ namespace VOL.Core.ManageUser
{
CacheService.Remove(userId.GetUserIdKey());
}
public bool HaveLogin(Guid userId)
{
var uid = userId.GetUserIdKey();
var _r = CacheService.Get<UserInfo>(uid);
if (_r != null)
{
return true;
}
else{
return false;
}
}
}
}

@ -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);
}

@ -93,17 +93,18 @@ namespace VOL.System.Services
//如果查询条件没有指定userid 则userid为当前用户
//一般用户只能使用该方法;将来给管理员提供选择人员的位置
if (!string.IsNullOrEmpty(options.Wheres))
{
try
{
if (!searchParametersList.Exists(x => x.Name == "USERID"))
{
queryable = queryable.Where(x => x.USERID == UserContext.Current.UserInfo.User_Id);
}
}
catch { }
}
//if (!string.IsNullOrEmpty(options.Wheres))
//{
// try
// {
// if (!searchParametersList.Exists(x => x.Name == "USERID"))
// {
// queryable = queryable.Where(x => x.USERID == UserContext.Current.UserInfo.User_Id);
// }
// }
// catch { }
//}
queryable = queryable.Where(x => x.USERID == UserContext.Current.UserInfo.User_Id);
return queryable;
};

@ -103,7 +103,7 @@
//"COMPANYNAME": "HUAGANG", //
"COMPANYNAME": "JGWL", //
//"COMPANYNAME": "QSSD",//
"SingleLogin": "false", //
"SingleLogin": "false", //
"CanOutMore": "true", //
"NegativeStockFee": "true", //
"FEEInDay": "true", //

Loading…
Cancel
Save