{"record":{"id":"0c44dc7420a06a0d","repo":"fish2018/pansou","slug":"http-d-0c44dc","errorCode":null,"errorMessage":"登录请求失败: HTTP %d","messagePattern":"登录请求失败: HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/panlian/panlian.go","lineNumber":1122,"sourceCode":"\t\treturn \"\", nil, err\n\t}\n\tp.setPanlianHeaders(req, preCookie, DefaultBaseURL+\"/pages/login.php\")\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\")\n\n\tresp, err = client.Do(req)\n\tif err != nil {\n\t\tcancel()\n\t\treturn \"\", nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, err := io.ReadAll(resp.Body)\n\tcancel()\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", nil, fmt.Errorf(\"登录请求失败: HTTP %d\", resp.StatusCode)\n\t}\n\n\tvar loginResp LoginResponse\n\tif err := json.Unmarshal(respBody, &loginResp); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"解析登录响应失败: %w\", err)\n\t}\n\tif !loginResp.Success {\n\t\treturn \"\", nil, errors.New(strings.TrimSpace(loginResp.Message))\n\t}\n\n\tcookieString := cookiesToString(jar.Cookies(baseURL))\n\tif cookieString == \"\" {\n\t\treturn \"\", nil, fmt.Errorf(\"登录成功但未获取到有效 Cookie\")\n\t}\n\n\treturn cookieString, &loginResp, nil\n}\n","sourceCodeStart":1104,"sourceCodeEnd":1140,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/panlian/panlian.go#L1104-L1140","documentation":"Login status error in panlian (plugin/panlian/panlian.go:1122): the login POST completed but returned a status other than 200, so the login response body cannot be trusted as a LoginResponse. Means credential submission was rejected at HTTP level.","triggerScenarios":"POSTing the login form when credentials trigger a non-200 response, the WAF blocks the login POST, or the server returns 5xx during login.","commonSituations":"登录参数缺失被服务端拒绝；触发风控。","solutions":["Verify the panlian username/password are correct by logging in manually in a browser","Check if the site now requires captcha/2FA and adapt the login flow","Retry on 5xx with backoff; treat 403 as anti-bot and add browser-like headers","Confirm the login endpoint URL has not changed"],"exampleFix":"// before\nform := url.Values{}\nform.Set(\"username\", username)\nresp, err := client.PostForm(loginURL, form)\n// after\nreq, _ := http.NewRequest(http.MethodPost, loginURL, strings.NewReader(form.Encode()))\nreq.Header.Set(\"User-Agent\", userAgent)\nreq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\nreq.Header.Set(\"Referer\", DefaultBaseURL)\nresp, err := client.Do(req)","handlingStrategy":"try-catch","validationCode":"if loginURL, err := url.Parse(DefaultBaseURL + \"/login\"); err != nil || !loginURL.IsAbs() {\n    return errors.New(\"invalid login endpoint\")\n}","typeGuard":null,"tryCatchPattern":"if err := doLoginFlow(); err != nil {\n    var httpErr interface{ StatusCode() int }\n    if strings.Contains(err.Error(), \"登录请求失败: HTTP 403\") {\n        log.Print(\"login blocked (anti-bot/captcha) — verify credentials manually\")\n    }\n    return err\n}","preventionTips":["Verify credentials manually in a browser when this error appears","Match the browser's headers and Referer on the login POST","Detect captcha requirements and alert instead of hammering retries"],"tags":["http","login","authentication","go"],"backgroundTag":"http-error-response","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}