chore: 生产/测试配置分离,并收紧微信 mp AppId 路由
Some checks failed
Build and Deploy / deploy (push) Failing after 35s
Some checks failed
Build and Deploy / deploy (push) Failing after 35s
Development 指向 oms.nanafa.com;Production 指向 ideship.com。微信 /wechat/mp/{appId} 仅匹配 wx 前缀。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
7c1be3a723
commit
41db6fa0af
@ -8,9 +8,9 @@ public class ItfxGatewayOptions
|
|||||||
public const string SectionName = "Oms:Itfx";
|
public const string SectionName = "Oms:Itfx";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// itfx 服务根地址,如 http://api.nanafa.com/itfx。
|
/// itfx 服务根地址。生产默认 api.ideship.com;测试用 appsettings.Development / Consul 覆盖为 api.nanafa.com。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BaseUrl { get; set; } = "http://api.nanafa.com/itfx";
|
public string BaseUrl { get; set; } = "https://api.ideship.com/itfx";
|
||||||
|
|
||||||
public int TimeoutSeconds { get; set; } = 30;
|
public int TimeoutSeconds { get; set; } = 30;
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class WeChatRouteIntegrationTests
|
|||||||
await using var host = await SimpleAdminApiTestHost.CreateAsync(configureServices: ConfigureWeChatFallback);
|
await using var host = await SimpleAdminApiTestHost.CreateAsync(configureServices: ConfigureWeChatFallback);
|
||||||
|
|
||||||
host.RoutePatterns.Should().Contain("apiwechat/verification");
|
host.RoutePatterns.Should().Contain("apiwechat/verification");
|
||||||
host.RoutePatterns.Should().Contain("wechat/mp/{appId}");
|
host.RoutePatterns.Should().Contain("wechat/mp/{appId:regex(^wx[A-Za-z0-9]+$)}");
|
||||||
host.RoutePatterns.Should().Contain("wechat/mp/login-qrcode");
|
host.RoutePatterns.Should().Contain("wechat/mp/login-qrcode");
|
||||||
host.RoutePatterns.Should().Contain("wechat/oauth/config");
|
host.RoutePatterns.Should().Contain("wechat/oauth/config");
|
||||||
host.RoutePatterns.Should().Contain("wechat/mp/follow-qrcode");
|
host.RoutePatterns.Should().Contain("wechat/mp/follow-qrcode");
|
||||||
|
|||||||
@ -70,9 +70,10 @@ public partial class AuthService
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 微信服务器接入验签,验签通过后原样返回 echostr。
|
/// 微信服务器接入验签,验签通过后原样返回 echostr。
|
||||||
|
/// appId 仅匹配 wx 开头,避免 login-qrcode / oauth-config 等静态段落入本路由。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpGet("/wechat/mp/{appId}")]
|
[HttpGet("/wechat/mp/{appId:regex(^wx[A-Za-z0-9]+$)}")]
|
||||||
[Produces("text/plain")]
|
[Produces("text/plain")]
|
||||||
[ApiExplorerSettings(GroupName = "WeChat")]
|
[ApiExplorerSettings(GroupName = "WeChat")]
|
||||||
public async Task<IActionResult> WeChatValidateAsync(
|
public async Task<IActionResult> WeChatValidateAsync(
|
||||||
@ -120,7 +121,7 @@ public partial class AuthService
|
|||||||
/// 微信消息/事件推送(明文,XML/JSON)。
|
/// 微信消息/事件推送(明文,XML/JSON)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost("/wechat/mp/{appId}")]
|
[HttpPost("/wechat/mp/{appId:regex(^wx[A-Za-z0-9]+$)}")]
|
||||||
[Consumes("text/xml", "application/xml", "application/json", "text/plain")]
|
[Consumes("text/xml", "application/xml", "application/json", "text/plain")]
|
||||||
[Produces("text/plain", "application/xml")]
|
[Produces("text/plain", "application/xml")]
|
||||||
[ApiExplorerSettings(GroupName = "WeChat")]
|
[ApiExplorerSettings(GroupName = "WeChat")]
|
||||||
|
|||||||
@ -12,7 +12,12 @@
|
|||||||
},
|
},
|
||||||
"App": {
|
"App": {
|
||||||
"Urls": ["http://localhost:5281"],
|
"Urls": ["http://localhost:5281"],
|
||||||
"CorsOrigins": ["http://localhost:5173", "http://localhost:5281"],
|
"CorsOrigins": [
|
||||||
|
"http://localhost:5173",
|
||||||
|
"http://localhost:5281",
|
||||||
|
"https://oms.nanafa.com",
|
||||||
|
"http://oms.nanafa.com"
|
||||||
|
],
|
||||||
"SendStartupNotification": false
|
"SendStartupNotification": false
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
@ -46,7 +51,7 @@
|
|||||||
},
|
},
|
||||||
"WeChat": {
|
"WeChat": {
|
||||||
"Mp": {
|
"Mp": {
|
||||||
"AppId": "wxd5141ba46c856e1f",
|
"AppId": "wxfffea62e089ee15f",
|
||||||
"Secret": "379f51a89419dc36fbb9167feef6f89a",
|
"Secret": "379f51a89419dc36fbb9167feef6f89a",
|
||||||
"Token": "c6ca74013df823c0e1da0feaaaf8bf66",
|
"Token": "c6ca74013df823c0e1da0feaaaf8bf66",
|
||||||
"EncodingAesKey": "",
|
"EncodingAesKey": "",
|
||||||
|
|||||||
34
src/SimpleAdmin.Api/appsettings.Production.json
Normal file
34
src/SimpleAdmin.Api/appsettings.Production.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"UseLocalConfigs": false,
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"App": {
|
||||||
|
"CorsOrigins": [
|
||||||
|
"https://ideship.com",
|
||||||
|
"https://www.ideship.com"
|
||||||
|
],
|
||||||
|
"SendStartupNotification": false
|
||||||
|
},
|
||||||
|
"WeChat": {
|
||||||
|
"Mp": {
|
||||||
|
"OAuthRedirectBase": "https://ideship.com",
|
||||||
|
"FollowUrl": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Oms": {
|
||||||
|
"TrackService": {
|
||||||
|
"Enabled": true,
|
||||||
|
"BaseUrl": "https://api.ideship.com/track"
|
||||||
|
},
|
||||||
|
"Itfx": {
|
||||||
|
"BaseUrl": "https://api.ideship.com/itfx"
|
||||||
|
},
|
||||||
|
"PlatformShop": {
|
||||||
|
"FrontendBaseUrl": "https://ideship.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user