ZR20090193-陈敬勇 1 year ago
commit fe34eca291

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

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

@ -14,6 +14,7 @@ using VOL.Core.Extensions.AutofacManager;
using VOL.Entity; using VOL.Entity;
using VOL.Entity.DomainModels; using VOL.Entity.DomainModels;
using ConvertHelper; using ConvertHelper;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
namespace VOL.Core.ManageUser namespace VOL.Core.ManageUser
{ {
@ -408,5 +409,20 @@ namespace VOL.Core.ManageUser
{ {
CacheService.Remove(userId.GetUserIdKey()); 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.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)

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

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

Loading…
Cancel
Save