{"record":{"id":"38935c310ffc9190","repo":"binarywang/WxJava","slug":"uri-access-token-38935c","errorCode":null,"errorMessage":"uri参数中不允许有access_token: {}","messagePattern":"uri参数中不允许有access_token: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"weixin-java-cp/src/main/java/me/chanjar/weixin/cp/corpgroup/service/impl/BaseWxCpCgServiceImpl.java","lineNumber":212,"sourceCode":"  /**\n   * Execute internal t.\n   *\n   * @param <T>                    the type parameter\n   * @param <E>                    the type parameter\n   * @param executor               the executor\n   * @param uri                    the uri\n   * @param data                   the data\n   * @param withoutCorpAccessToken the without Corp access token\n   * @param req                    获取token请求参数\n   * @return the t\n   * @throws WxErrorException the wx error exception\n   */\n  protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data,\n                                     boolean withoutCorpAccessToken, WxCpCorpGroupCorpGetTokenReq req) throws WxErrorException {\n    E dataForLog = DataUtils.handleDataWithSecret(data);\n\n    if (uri.contains(\"access_token=\")) {\n      throw new IllegalArgumentException(\"uri参数中不允许有access_token: \" + uri);\n    }\n    String uriWithAccessToken;\n    if (!withoutCorpAccessToken) {\n      String corpAccessToken = getCorpAccessToken(req.getCorpId(), req.getAgentId(), req.getBusinessType());\n      uriWithAccessToken = uri + (uri.contains(\"?\") ? \"&\" : \"?\") + \"access_token=\" + corpAccessToken;\n    } else {\n      uriWithAccessToken = uri;\n    }\n\n\n    try {\n      T result = executor.execute(uriWithAccessToken, data, WxType.CP);\n      log.debug(\"\\n【请求地址】: {}\\n【请求参数】：{}\\n【响应数据】：{}\", uriWithAccessToken, dataForLog, result);\n      return result;\n    } catch (WxErrorException e) {\n      WxError error = e.getError();\n      /*\n       * 发生以下情况时尝试刷新Corp_access_token","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/binarywang/WxJava/blob/1c43293a3c2c9d7e91304b6d037fb017f680d0c6/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/corpgroup/service/impl/BaseWxCpCgServiceImpl.java#L194-L230","documentation":"Error \"uri参数中不允许有access_token: {}\" thrown in binarywang/WxJava.","triggerScenarios":"Thrown at weixin-java-cp/src/main/java/me/chanjar/weixin/cp/corpgroup/service/impl/BaseWxCpCgServiceImpl.java:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["不要在 uri 参数中手动拼接 access_token，SDK 会自动追加该参数。","检查自定义请求地址，移除其中的 access_token 查询参数。"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c43293a3c2c9d7e91304b6d037fb017f680d0c6","analyzedAt":"2026-08-14T02:29:11.060Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}