{"record":{"id":"7115b4e8fdf0e857","repo":"AlistGo/alist","slug":"need-img-validate-code-img-src-data-image-png-b","errorCode":null,"errorMessage":"need img validate code: <img src=\"data:image/png;base64,%s\"/>","messagePattern":"need img validate code: <img src=\"data:image/png;base64,(.+?)\"/>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/189pc/utils.go","lineNumber":453,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to obtain verification code\")\n\t}\n\tif imgRes.Size() > 20 {\n\t\tif setting.GetStr(conf.OcrApi) != \"\" && !y.NoUseOcr {\n\t\t\tvRes, err := base.RestyClient.R().\n\t\t\t\tSetMultipartField(\"image\", \"validateCode.png\", \"image/png\", bytes.NewReader(imgRes.Body())).\n\t\t\t\tPost(setting.GetStr(conf.OcrApi))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif jsoniter.Get(vRes.Body(), \"status\").ToInt() == 200 {\n\t\t\t\ty.VCode = jsoniter.Get(vRes.Body(), \"result\").ToString()\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\t// 返回验证码图片给前端\n\t\treturn fmt.Errorf(`need img validate code: <img src=\"data:image/png;base64,%s\"/>`, base64.StdEncoding.EncodeToString(imgRes.Body()))\n\t}\n\treturn nil\n}\n\n// 刷新会话\nfunc (y *Cloud189PC) refreshSession() (err error) {\n\tif y.ref != nil {\n\t\treturn y.ref.refreshSession()\n\t}\n\tvar erron RespErr\n\tvar userSessionResp UserSessionResp\n\t_, err = y.client.R().\n\t\tSetResult(&userSessionResp).SetError(&erron).\n\t\tSetQueryParams(clientSuffix()).\n\t\tSetQueryParams(map[string]string{\n\t\t\t\"appId\":       APP_ID,\n\t\t\t\"accessToken\": y.tokenInfo.AccessToken,\n\t\t}).","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/189pc/utils.go#L435-L471","documentation":"Error \"need img validate code: <img src=\"data:image/png;base64,%s\"/>\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/189pc/utils.go:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Complete the required verification (captcha/SMS/image code) as prompted, then retry the login or operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}