NutzCN Logo
问答 Nutzwx调用上传永久素材的接口报41005错误
发布于 426天前 作者 qq_df433f5d 429 次浏览 复制 上一个帖子 下一个帖子
标签:

调用nutzwx的add_material方法,代码如下:

            if (err != null && err.getAdaptorErr() != null) {
                return NutMap.NEW().addv("code", 1).addv("msg", "文件不合法");
            } else if (tf == null) {
                return Result.error("空文件");
            } else {

                WxApi2 wxApi2 = wxConfigService.getWxApi2(wxid);
                log.debug("file::::"+tf.getFile().getAbsolutePath());
                WxResp resp = wxApi2.add_material("video", tf.getFile());
                log.debug(resp);
                if (resp.errcode() != 0) {
                    return Result.error(resp.errmsg());
                }
                return Result.success("上传成功", resp.get("media_id"));
            }

错误日志:


``` 2020-08-21 00:16:03,237 cn.wizzer.app.web.modules.controllers.platform.wx.WxReplyNewsController.uploadMedia(WxReplyNewsController.java:144) DEBUG - file::::C:\Users\Administrator\nutzwk\upload\tmp\00\00\00\00\00\00\00\00.mp4 2020-08-21 00:16:03,253 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) DEBUG - select access_token,access_token_expires,access_token_lastat from wx_config where id=? | 1 | |----------------------------------| | ee3907ae917b4bfc9f9164de37a24074 | For example:> "select access_token,access_token_expires,access_token_lastat from wx_config where id='ee3907ae917b4bfc9f9164de37a24074'" 2020-08-21 00:16:03,253 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) DEBUG - select access_token,access_token_expires,access_token_lastat from wx_config where id=? | 1 | |----------------------------------| | ee3907ae917b4bfc9f9164de37a24074 | For example:> "select access_token,access_token_expires,access_token_lastat from wx_config where id='ee3907ae917b4bfc9f9164de37a24074'" 2020-08-21 00:16:15,331 cn.wizzer.app.web.modules.controllers.platform.wx.WxReplyNewsController.uploadMedia(WxReplyNewsController.java:146) DEBUG - {errcode=41005, errmsg=media data missing hint: [gPHxuA0175d234] rid: 5f3ea1cf-693662cf-0ffbbc1a}

```

4 回复

新版应该改了

您说的是哪个新版?是要下新版的nutzwx还是说微信的接口改了?

我的nutzwx是1.r.68-SNAPSHOT,是要用最新的吗?1.r.68.v20200427?

报个issue,或者来个pull request?

添加回复
请先登陆
回到顶部