feat(t226): add Go ERP session login

This commit is contained in:
QiuSW
2026-07-29 09:51:41 +08:00
parent c2f340d067
commit a5a61c05d0
23 changed files with 1633 additions and 33 deletions
+7 -5
View File
@@ -137,10 +137,12 @@ func TestBuildRouterRegistersProtectedLogoutRoute(t *testing.T) {
t.Fatalf("migration.Up() error = %v", err)
}
router, err := buildRouter(ctx, config.Config{
AssetDirectory: filepath.Join(t.TempDir(), "assets"),
ClaimLease: 10 * time.Minute,
RunningLease: 30 * time.Minute,
ReadinessTTL: 2 * time.Minute,
AssetDirectory: filepath.Join(t.TempDir(), "assets"),
ClaimLease: 10 * time.Minute,
RunningLease: 30 * time.Minute,
ReadinessTTL: 2 * time.Minute,
ShunyunbaoURL: "https://www.shunyunbaoerp.com",
ShunyunbaoTimeout: 30 * time.Second,
}, db)
if err != nil {
t.Fatalf("buildRouter() error = %v", err)
@@ -159,7 +161,7 @@ func TestBuildRouterRegistersProtectedLogoutRoute(t *testing.T) {
response.Header().Get("Location"),
)
}
for _, target := range []string{"/freight", "/freight/import"} {
for _, target := range []string{"/freight", "/freight/import", "/erp"} {
request = httptest.NewRequest(http.MethodGet, target, nil)
response = httptest.NewRecorder()
router.ServeHTTP(response, request)