From c81fa6be2c7c8fb99f93a070689680327835b738 Mon Sep 17 00:00:00 2001 From: liguanjie Date: Thu, 11 Sep 2025 18:09:29 +0800 Subject: [PATCH] =?UTF-8?q?test(passport):=20=E6=9B=B4=E6=96=B0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E5=92=8C?= =?UTF-8?q?=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 ChangePassword 请求的密码参数 - 优化了测试用例的断言和日志输出 --- services/passport/client_test.go | 6 +++--- services/passport/getpwd.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/passport/client_test.go b/services/passport/client_test.go index fc8beaf..41ff6a4 100644 --- a/services/passport/client_test.go +++ b/services/passport/client_test.go @@ -85,12 +85,12 @@ func TestChangePassword(t *testing.T) { if err != nil { t.Error(err) } - req := CreateChangePasswordRequest("rz35990497", "654321") - req.AcceptFormat = "text" + req := CreateChangePasswordRequest("rz35990497", "7654321") + resp, err := client.ChangePassword(req) if err != nil { t.Error(err) } // 记录文本结果 - t.Logf("resp data:%+v", resp.GetHttpContentString()) + t.Logf("resp code:%+v, msg:%s", resp.Code, resp.Msg) } diff --git a/services/passport/getpwd.go b/services/passport/getpwd.go index fc48c9e..00a44ae 100644 --- a/services/passport/getpwd.go +++ b/services/passport/getpwd.go @@ -24,6 +24,7 @@ func CreateChangePasswordRequest(userName string, newPwd string) (req *ChangePas "newpwd": newPwd, "time": fmt.Sprintf("%v", ts), "sign": sign, + "format": "json", } req.Method = requests.POST