feat(t230): use OCR for ERP session login

This commit is contained in:
QiuSW
2026-07-29 10:48:06 +08:00
parent 8c84b81d48
commit f887bc4882
30 changed files with 512 additions and 205 deletions
+5 -2
View File
@@ -13,6 +13,7 @@ func TestWithERPEnvironmentFileUsesApprovedFallbackValues(t *testing.T) {
"CMROUBAO_SHUNYUNBAO_URL=https://erp.example.test",
"CMROUBAO_SHUNYUNBAO_USERNAME=dotenv-user",
"CMROUBAO_SHUNYUNBAO_PASSWORD='dotenv password #1'",
"CMROUBAO_OCR_API_URL=http://127.0.0.1:8000/ocr",
}, "\n"))
lookup, err := WithERPEnvironmentFile(path, func(string) (string, bool) {
@@ -27,14 +28,16 @@ func TestWithERPEnvironmentFileUsesApprovedFallbackValues(t *testing.T) {
}
if cfg.ShunyunbaoURL != "https://erp.example.test" ||
cfg.ShunyunbaoUsername != "dotenv-user" ||
cfg.ShunyunbaoPassword != "dotenv password #1" {
cfg.ShunyunbaoPassword != "dotenv password #1" ||
cfg.OCRAPIURL != "http://127.0.0.1:8000/ocr" {
t.Fatalf(
"ERP config = %#v",
struct {
URL string
Username string
Password string
}{cfg.ShunyunbaoURL, cfg.ShunyunbaoUsername, cfg.ShunyunbaoPassword},
OCRURL string
}{cfg.ShunyunbaoURL, cfg.ShunyunbaoUsername, cfg.ShunyunbaoPassword, cfg.OCRAPIURL},
)
}
if _, exists := lookup("OTHER_TOOL_TOKEN"); exists {