chore: 切换 bcdship 域名,Itfx BaseUrl 改由配置注入
Some checks failed
Build and Deploy / deploy (push) Failing after 51s

同步 NuGet/Consul/COS 测试域名,去掉代码内写死的生产 itfx 默认地址。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-12-01 18:35:02 +08:00
parent d0618509e5
commit d07a6c6d6c
6 changed files with 20 additions and 20 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="ideship" value="https://baget.ideship.com/v3/index.json" />
<add key="bcdship" value="https://baget.bcdship.com/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View File

@ -8,9 +8,9 @@ public class ItfxGatewayOptions
public const string SectionName = "Oms:Itfx";
/// <summary>
/// itfx 服务根地址。生产默认 api.ideship.com;测试用 appsettings.Development / Consul 覆盖为 api.nanafa.com。
/// itfx 服务根地址。必须由 appsettings / Consul(Oms:Itfx:BaseUrl)配置,勿在代码写死域名。
/// </summary>
public string BaseUrl { get; set; } = "https://api.ideship.com/itfx";
public string BaseUrl { get; set; } = string.Empty;
/// <summary>
/// 默认应用 AppKey(其他配置 api_center;GetInfo 无 Secret 时回退)。

View File

@ -11,7 +11,7 @@ public class FileStoragePathTests
public void ExpandReadKeys_ShouldStripQueryAndTryAdminPrefix()
{
var url =
"https://cos.test.ideship.com/admin/uploads/prints/orders/BCD2610061059117673-20261006105912.pdf?q-sign-algorithm=sha1";
"https://cos.test.bcdship.com/admin/uploads/prints/orders/BCD2610061059117673-20261006105912.pdf?q-sign-algorithm=sha1";
var keys = FileStoragePath.ExpandReadKeys(url);
@ -21,8 +21,8 @@ public class FileStoragePathTests
}
[Theory]
[InlineData("https://cos.ideship.com/uploads/a.pdf?q-sign-algorithm=sha1", true)]
[InlineData("http://cos.test.ideship.com/admin/uploads/a.pdf", true)]
[InlineData("https://cos.bcdship.com/uploads/a.pdf?q-sign-algorithm=sha1", true)]
[InlineData("http://cos.test.bcdship.com/admin/uploads/a.pdf", true)]
[InlineData("https://bucket-123.cos.ap-guangzhou.myqcloud.com/uploads/a.pdf", true)]
[InlineData("https://third-party.example.com/label.pdf", false)]
[InlineData("uploads/prints/orders/a.pdf", false)]
@ -35,7 +35,7 @@ public class FileStoragePathTests
public void ToStorageKey_ShouldStripExpiredCosSignedUrlToObjectKey()
{
var expired =
"https://cos.ideship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
"https://cos.bcdship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
OmsObjectStorageExtensions.ToStorageKey(expired)
.Should()
@ -46,7 +46,7 @@ public class FileStoragePathTests
public void ToStorageKey_ShouldStripPathBaseAdminFromCustomDomainUrl()
{
var url =
"https://cos.test.ideship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1";
"https://cos.test.bcdship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1";
OmsObjectStorageExtensions.ToStorageKey(url)
.Should()
@ -65,9 +65,9 @@ public class FileStoragePathTests
public async Task GetPublicUrl_ShouldResignCustomDomainUrlWithoutDoubleAdmin()
{
var expired =
"https://cos.test.ideship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
"https://cos.test.bcdship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
const string fresh =
"https://cos.test.ideship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1&fresh=1";
"https://cos.test.bcdship.com/admin/uploads/prints/orders/BCD2610231052073356-20261023105208.pdf?q-sign-algorithm=sha1&fresh=1";
var storage = new Mock<IObjectStorage>(MockBehavior.Strict);
storage
@ -94,9 +94,9 @@ public class FileStoragePathTests
public async Task GetPublicUrl_ShouldResignManagedCosAbsoluteUrl()
{
var expired =
"https://cos.ideship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
"https://cos.bcdship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&q-sign-time=1;2";
const string fresh =
"https://cos.ideship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&fresh=1";
"https://cos.bcdship.com/uploads/prints/orders/BCD2610081704036507-20261008170404.pdf?q-sign-algorithm=sha1&fresh=1";
var storage = new Mock<IObjectStorage>(MockBehavior.Strict);
storage

View File

@ -1,13 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
ARG NUGET_IDESHIP=https://baget.ideship.com/v3/index.json
ARG NUGET_BCDSHIP=https://baget.bcdship.com/v3/index.json
COPY ["NuGet.Config", "Directory.Build.props", "./"]
RUN sed -i \
-e "s|https://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|http://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|https://baget.xiaolipro.cn/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|https://baget.bcdship.com/v3/index.json|${NUGET_BCDSHIP}|g" \
-e "s|http://baget.bcdship.com/v3/index.json|${NUGET_BCDSHIP}|g" \
-e "s|https://baget.xiaolipro.cn/v3/index.json|${NUGET_BCDSHIP}|g" \
NuGet.Config \
&& cat NuGet.Config

View File

@ -19,7 +19,7 @@ public class WxOAuthConfigOutput
public string AppId { get; set; } = string.Empty;
/// <summary>
/// OAuth 回调根地址(来自 wechat_mp.BaseUrl),如 https://ideship.com。
/// OAuth 回调根地址(来自 wechat_mp.BaseUrl),如 https://bcdship.com。
/// 为空时前端回退到当前页面 origin。
/// </summary>
public string? OAuthRedirectBase { get; set; }

View File

@ -1,7 +1,7 @@
{
"UseLocalConfigs": false,
"Consul": {
"Address": "http://test.ideship.com:30850",
"Address": "http://test.bcdship.com:30850",
"Token": "c0aea902-dca0-ac29-299b-a0d47e5402aa"
}
}