public async Task <IActionResult> GetUserSocialInfo(Guid?connectorUserId) { var userIdStr = User.Claims?.FirstOrDefault(x => x.Type == "OryxUser")?.Value; Guid?owerUserId; if (!string.IsNullOrEmpty(userIdStr)) { owerUserId = Guid.Parse(userIdStr); } else { owerUserId = null; } var apiMsg = await ApiMessage.Wrap(async() => { var userInfo = await userAccountBusiness.GetUserInfo(connectorUserId.Value); var isSubcrib = await userSocialRelationshipBusiness.CheckSubscib(owerUserId, connectorUserId.Value); return(new { userInfo, isSubcrib }); }); return(Json(apiMsg)); }
public async Task <IActionResult> ApiUserInfo() { var userId = User.Claims.FirstOrDefault(x => x.Type == "OryxUser")?.Value; var _userId = Guid.Parse(userId); var apiMsg = await ApiMessage.Wrap(async() => { return(await userAccountBusiness.GetUserInfo(_userId)); }); return(Json(apiMsg)); }
public async Task OnGet() { await HttpContext.Session.LoadAsync(); var userId = HttpContext.Session.GetString(UserAccountBusiness.UserAccountSessionkey); UserId = userId; SentryLog.Log("test lottery userId;" + userId); //userId = "d14e4c49-5502-43df-8ce9-0bf93baef067"; var _userId = Guid.Parse(userId); UserInfo = await userAccountBusiness.GetUserInfo(_userId); HasPlay = await activityBusiness.HasPlay(ActivityNamek, _userId); }
public async Task <IActionResult> AddOrUpdate(ContentEntry contentEntry) { var UserId = HttpContext.Session.GetString(UserAccountBusiness.UserAccountSessionkey); var _userId = Guid.Parse(UserId); if (contentEntry.ContentEntryInfo == null) { var userInfo = await userAccountBusiness.GetUserInfo(_userId); contentEntry.ContentEntryInfo = new Oryx.Content.Model.ContentEntryExtension.ContentEntryInfo { Author = userInfo.nickName, Id = Guid.NewGuid(), Type = "", UserAccountId = _userId }; } ViewData["DataType"] = typeof(ContentEntry); await contentBusiness.CreateContentWithCategoryAndTag(contentEntry, "论坛", "论坛"); return(RedirectToAction("Index")); }