{"record":{"id":"a8a05e8b80273a28","repo":"fish2018/pansou","slug":"uin","errorCode":null,"errorMessage":"未找到uin","messagePattern":"未找到uin","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/qqpd/qqpd.go","lineNumber":1865,"sourceCode":"\tif len(matches) < 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"无法解析响应\")\n\t}\n\n\turl := matches[1]\n\n\t// 提取ptsigx\n\tptsigxRe := regexp.MustCompile(`ptsigx=([A-Za-z0-9]+)`)\n\tptsigxMatches := ptsigxRe.FindStringSubmatch(url)\n\tif len(ptsigxMatches) < 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"未找到ptsigx\")\n\t}\n\tptsigx := ptsigxMatches[1]\n\n\t// 提取uin\n\tuinRe := regexp.MustCompile(`uin=(\\d+)`)\n\tuinMatches := uinRe.FindStringSubmatch(url)\n\tif len(uinMatches) < 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"未找到uin\")\n\t}\n\tuin := uinMatches[1]\n\n\treturn ptsigx, uin, nil\n}\n\n// fetchFullCookie 获取完整Cookie\nfunc (p *QQPDPlugin) fetchFullCookie(uin, ptsigx, setCookieHeader string) (string, error) {\n\tcheckSigURL := fmt.Sprintf(\"https://ptlogin2.pd.qq.com/check_sig?pttype=1&uin=%s&service=ptqrlogin&nodirect=1&ptsigx=%s&s_url=https%%3A%%2F%%2Fpd.qq.com%%2Fexplore&f_url=&ptlang=2052&ptredirect=101&aid=1600001587&daid=823&j_later=0&low_login_hour=0&regmaster=0&pt_login_type=3&pt_aid=0&pt_aaid=16&pt_light=0&pt_3rd_aid=0\", uin, ptsigx)\n\n\tclient := &http.Client{\n\t\tTimeout: 10 * time.Second,\n\t\tTransport: &http.Transport{\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t\t},\n\t}\n\n\treq, err := http.NewRequest(\"GET\", checkSigURL, nil)","sourceCodeStart":1847,"sourceCodeEnd":1883,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/qqpd/qqpd.go#L1847-L1883","documentation":"extractLoginInfo (plugin/qqpd/qqpd.go:1865) found the callback URL and ptsigx but the regex `uin=(\\d+)` found no numeric uin query parameter in the URL, returning '未找到uin'. Without the uin (the logged-in QQ number) the plugin cannot associate the new cookie with a stored user.","triggerScenarios":"checkQRLoginStatus -> extractLoginInfo: the ptuiCB URL lacks `uin=<digits>` — e.g. the login target is not a standard QQ-number account or the URL shape changed.","commonSituations":"Logging in with an account type whose uin is non-numeric or omitted (some merged/wx-linked accounts), QQ changing the parameter, or a URL-encoded value breaking the `\\d+` pattern.","solutions":["Log the full extracted URL to see what parameter carries the account id","If the uin may be percent-encoded, URL-decode the URL before matching or widen the regex to `uin=([^&']+)`","Reject non-numeric/unsupported account types with a clear user-facing message","Verify the ptqrlogin appid/target matches plain QQ login (not another account system)"],"exampleFix":"// before\nuinRe := regexp.MustCompile(`uin=(\\d+)`)\n// after\ndecoded, _ := url.QueryUnescape(url)\nuinRe := regexp.MustCompile(`uin=(\\d+)`)\nuinMatches := uinRe.FindStringSubmatch(decoded)","handlingStrategy":"validation","validationCode":"// confirm the callback URL carries a numeric uin before extraction\nu, err := url.Parse(extractedURL)\nif err != nil || u.Query().Get(\"uin\") == \"\" {\n    return errors.New(\"login url missing uin\")\n}\nif _, err := strconv.ParseUint(u.Query().Get(\"uin\"), 10, 64); err != nil {\n    return fmt.Errorf(\"uin not numeric: %q\", u.Query().Get(\"uin\"))\n}","typeGuard":"func hasNumericUin(loginURL string) bool {\n    u, err := url.Parse(loginURL)\n    if err != nil { return false }\n    _, err = strconv.ParseUint(u.Query().Get(\"uin\"), 10, 64)\n    return err == nil\n}","tryCatchPattern":"ptsigx, uin, err := p.extractLoginInfo(bodyStr)\nif err != nil {\n    if err.Error() == \"未找到uin\" {\n        return nil, errors.New(\"login response had no QQ number; unsupported account type or format change\")\n    }\n    return nil, err\n}","preventionTips":["URL-decode the login URL before matching uin","Support non-numeric or redirected uin variants if your user base includes them","Log the raw URL on failure to spot QQ format changes quickly","Validate account type support (plain QQ accounts) before starting the QR flow"],"tags":["parsing","regex","qq-login"],"backgroundTag":"unexpected-response-shape","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"}