コード例 #1
0
        public async Task <IActionResult> UpdateInfo(UpdateInfoAddressModel model)
        {
            var currentUser = await GetKahlaUser();

            currentUser.IconFilePath = model.HeadIconPath;
            currentUser.NickName     = model.NickName;
            currentUser.Bio          = model.Bio;
            await _userService.ChangeProfileAsync(currentUser.Id, await _appsContainer.AccessToken(), currentUser.NickName, model.HeadIconPath, currentUser.Bio);

            await _userManager.UpdateAsync(currentUser);

            return(this.Protocol(ErrorType.Success, "Successfully set your personal info."));
        }
コード例 #2
0
        public async Task <IActionResult> UpdateInfo(UpdateInfoAddressModel model)
        {
            var cuser = await _userManager.GetUserAsync(User);

            cuser.HeadImgFileKey  = model.HeadImgKey;
            cuser.NickName        = model.NickName;
            cuser.Bio             = model.Bio;
            cuser.MakeEmailPublic = !model.HideMyEmail;
            await _userService.ChangeProfileAsync(cuser.Id, await _appsContainer.AccessToken(), cuser.NickName, cuser.HeadImgFileKey, cuser.Bio);

            await _userManager.UpdateAsync(cuser);

            return(this.Protocol(ErrorType.Success, "成功的更新了您的个人信息."));
        }
コード例 #3
0
        public async Task <IActionResult> UpdateInfo(UpdateInfoAddressModel model)
        {
            var cuser = await GetKahlaUser();

            if (!string.IsNullOrEmpty(model.NickName))
            {
                cuser.NickName = model.NickName;
            }
            if (!string.IsNullOrEmpty(model.HeadImgUrl))
            {
                cuser.HeadImgUrl = model.HeadImgUrl;
            }
            cuser.Bio = model.Bio;
            await _userService.ChangeProfileAsync(cuser.Id, await _appsContainer.AccessToken(), cuser.NickName, cuser.HeadImgUrl, cuser.Bio);

            await _userManager.UpdateAsync(cuser);

            return(this.Protocal(ErrorType.Success, "Successfully set your personal info."));
        }