From cbd13733585a310ecb1f19a0d17092bdad19e7c8 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 2 Sep 2026 10:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/auth.js | 4 ++-- tests/page-contract.test.mjs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/auth.js b/api/auth.js index 86e1969..3e34e93 100644 --- a/api/auth.js +++ b/api/auth.js @@ -29,8 +29,8 @@ function authRequest(path, data, options = {}) { }) } -export function login(username, password) { - return authRequest('/auth/login', { username, password }) +export function login(loginId, password) { + return authRequest('/auth/login', { loginId, password }) } export function refresh(refreshToken) { diff --git a/tests/page-contract.test.mjs b/tests/page-contract.test.mjs index 9472ef4..24d4714 100644 --- a/tests/page-contract.test.mjs +++ b/tests/page-contract.test.mjs @@ -29,6 +29,8 @@ test('login uses the real auth endpoint and relaunches to the modular workbench' for (const text of ['柏悦物流 · PDA作业端', '工号 / 用户名', '登录中']) assert.match(login, new RegExp(text)) assert.doesNotMatch(login, /DEMO_ACCOUNTS|快捷登录|作业仓库/) assert.match(auth, /\/auth\/login/) + assert.match(auth, /authRequest\('\/auth\/login', \{ loginId, password \}\)/) + assert.doesNotMatch(auth, /authRequest\('\/auth\/login', \{ username, password \}\)/) assert.match(login, /loginRequest\(userId, this\.form\.password\)/) assert.match(login, /signInWithTokens\(tokens\)/) assert.match(login, /form: \{ userId: '', password: '' \}/)