コード例 #1
0
        public async Task <IActionResult> GetWallpaperAsync()
        {
            var userContext = await GetUserContextAsync();

            var result = await _userServices.GetConfigAsync(userContext.Id);

            if (result.WallpaperSource == WallpaperSource.Upload)
            {
                result.WallpaperUrl = Appsetting.FileUrl + result.WallpaperUrl;
            }

            if (result.IsBing)
            {
                result.WallpaperSource = WallpaperSource.Bing;
                result.WallpaperUrl    = await BingHelper.GetEverydayBackgroundImageAsync();
            }

            return(Json(new ResponseModel <dynamic>
            {
                IsSuccess = true,
                Message = "初始化壁纸成功",
                Model = result
            }));
        }