Commit 0bbf13bb authored by 黄奎's avatar 黄奎

页面修改

parent c0522cc3
...@@ -166,45 +166,49 @@ namespace Mall.CacheManager.User ...@@ -166,45 +166,49 @@ namespace Mall.CacheManager.User
/// <returns></returns> /// <returns></returns>
public static AppletUserInfo GetAppletUserLoginInfo(object UserId) public static AppletUserInfo GetAppletUserLoginInfo(object UserId)
{ {
string cacheKey = UserModuleCacheKeyConfig.Applet_Login_Info + UserId.ToString(); if (UserId != null)
AppletUserInfo userInfo = null;
try
{ {
userInfo = redis.StringGet<AppletUserInfo>(cacheKey); string cacheKey = UserModuleCacheKeyConfig.Applet_Login_Info + UserId.ToString();
} AppletUserInfo userInfo = null;
catch (Exception ex) try
{ {
LogHelper.Write(ex, "GetAppletUserLoginInfo"); userInfo = redis.StringGet<AppletUserInfo>(cacheKey);
} }
if (userInfo == null) catch (Exception ex)
{
Int32.TryParse(UserId.ToString(), out int NewUserId);
if (NewUserId > 0)
{ {
string token = ""; LogHelper.Write(ex, "GetAppletUserLoginInfo");
var umodel = member_UserRepository.GetEntity<RB_Member_User_Extend>(NewUserId); }
if (umodel != null) if (userInfo == null)
{
Int32.TryParse(UserId.ToString(), out int NewUserId);
if (NewUserId > 0)
{ {
userInfo = new AppletUserInfo string token = "";
var umodel = member_UserRepository.GetEntity<RB_Member_User_Extend>(NewUserId);
if (umodel != null)
{ {
MallBaseId = umodel.MallBaseId, userInfo = new AppletUserInfo
MallName = "", {
Mobile = umodel.Moblie, MallBaseId = umodel.MallBaseId,
UserId = NewUserId, MallName = "",
TenantId = umodel.TenantId, Mobile = umodel.Moblie,
Name = umodel.Name, UserId = NewUserId,
OpenId = umodel.OpenId, TenantId = umodel.TenantId,
Photo = umodel.Photo, Name = umodel.Name,
Source = umodel.Source, OpenId = umodel.OpenId,
SecretKey = umodel.SecretKey, Photo = umodel.Photo,
SuperiorId = umodel.SuperiorId ?? 0, Source = umodel.Source,
Token = token SecretKey = umodel.SecretKey,
}; SuperiorId = umodel.SuperiorId ?? 0,
AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, userInfo, Config.JwtExpirTime); Token = token
};
AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, userInfo, Config.JwtExpirTime);
}
} }
} }
return userInfo;
} }
return userInfo; return null;
} }
} }
} }
...@@ -151,17 +151,13 @@ namespace Mall.WebApi.Controllers.User ...@@ -151,17 +151,13 @@ namespace Mall.WebApi.Controllers.User
public ApiResult SetUserShippingAddress() public ApiResult SetUserShippingAddress()
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo;
JObject prams = JObject.Parse(req.msg.ToString()); JObject prams = JObject.Parse(req.msg.ToString());
int NewUserId = prams.GetInt("NewUserId"); int NewUserId = prams.GetInt("NewUserId");
AppletUserInfo userInfo =null;
if (NewUserId > 0) if (NewUserId > 0)
{ {
userInfo = UserReidsCache.GetAppletUserLoginInfo(NewUserId); userInfo = UserReidsCache.GetAppletUserLoginInfo(NewUserId);
} }
else
{
userInfo = AppletUserInfo;
}
RB_Member_ShippingAddress_Extend demodel = JsonConvert.DeserializeObject<RB_Member_ShippingAddress_Extend>(req.msg.ToString()); RB_Member_ShippingAddress_Extend demodel = JsonConvert.DeserializeObject<RB_Member_ShippingAddress_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name)) if (string.IsNullOrEmpty(demodel.Name))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment