using DownKyi.Core.Settings.Models; namespace DownKyi.Core.Settings { public partial class SettingsManager { // 登录用户的mid private readonly UserInfoSettings userInfo = new UserInfoSettings { Mid = -1, Name = "", IsLogin = false, IsVip = false }; /// /// 获取登录用户信息 /// /// public UserInfoSettings GetUserInfo() { appSettings = GetSettings(); if (appSettings.UserInfo == null) { // 第一次获取,先设置默认值 SetUserInfo(userInfo); return userInfo; } return appSettings.UserInfo; } /// /// 设置中保存登录用户的信息,在index刷新用户状态时使用 /// /// /// public bool SetUserInfo(UserInfoSettings userInfo) { appSettings.UserInfo = userInfo; return SetSettings(); } } }