From 6b15be41f693d5b82ef0e87c4b77ca93c5365cd7 Mon Sep 17 00:00:00 2001 From: chfei Date: Thu, 15 Oct 2026 14:02:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E4=BB=93=20?= =?UTF-8?q?=E6=94=B6=E8=97=8F=20=E5=8F=AA=E7=BB=91=E5=AE=9A=E4=B8=BB?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Work/Services/CloudGoodsService.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Work/Services/CloudGoodsService.cs b/Work/Services/CloudGoodsService.cs index 44968df..6064db0 100644 --- a/Work/Services/CloudGoodsService.cs +++ b/Work/Services/CloudGoodsService.cs @@ -20,7 +20,7 @@ namespace Work.Services { if (EnvironmentHelper.IsDevelopment) { - ServerUrl = "http://localhost:9001"; + ServerUrl = "http://localhost:14312"; } } public static async Task> GetGoods(GoodsSearchRequest request) @@ -55,7 +55,7 @@ namespace Work.Services /// public static async Task> SearchFavorites(UserFavoritesGoodsSearchRequest request) { - request.UserName = BaseClass.UserName; + request.UserName = GetUserName(); var html = await GetHtml.PostJsonAsync(ServerUrl + "/api/CloudGoods/SearchFavorites", request); var ret = JsonConvert.DeserializeObject>>(html); @@ -77,7 +77,7 @@ namespace Work.Services { var html = await GetHtml.PostJsonAsync(ServerUrl + $"/api/CloudGoods/AddFavorite", new { - UserName = BaseClass.UserName, + UserName = GetUserName(), GoodsIds = goodsIds, }); @@ -99,7 +99,7 @@ namespace Work.Services { var html = await GetHtml.PostJsonAsync(ServerUrl + $"/api/CloudGoods/RemoveFavorites", new { - UserName = BaseClass.UserName, + UserName = GetUserName(), GoodsIds = goodsIds, }); @@ -111,6 +111,11 @@ namespace Work.Services return ret.Data; } #endregion + + public static string GetUserName() + { + return string.IsNullOrEmpty(BaseClass.ParentUserName) ? BaseClass.UserName : BaseClass.ParentUserName; + } } /// /// 商品搜索请求