yaphone / itchat4j

itchat4j -- 用Java扩展个人微信号的能力
2.04k stars 633 forks source link

保存二维码的地方有问题, 会报文件不存在 #8

Open tianzhidao28 opened 7 years ago

tianzhidao28 commented 7 years ago

qrPath = qrPath + File.separator + "QR.jpg"; String qrUrl = baseUrl + "/qrcode/" + core.getUuid(); try { URL qrUrlPicture = new URL(qrUrl); File qrFile = new File(qrPath); FileUtils.copyURLToFile(qrUrlPicture, qrFile); CommonTool.printQr(qrPath); // 打开登陆二维码图片 } catch (MalformedURLException e) { e.printStackTrace(); return false; } catch (IOException e) { e.printStackTrace(); return false; }

    return true;
yaphone commented 7 years ago

请问二维码图片有生成吗?

tianzhidao28 commented 7 years ago

应该是 第一次时 报文件路径不存在。。。 我上面的代码fix了这个

为什么不用okhttp 方便多了

tianzhidao28 commented 7 years ago

package com.rocyuan.wechat.bean.msg;

import com.alibaba.fastjson.annotation.JSONField; import com.rocyuan.wechat.bean.msg.base.Sex; import com.rocyuan.wechat.bean.msg.base.WeChatMsg;

/**

用这种方式 代码会不会好看一些。。

tianzhidao28 commented 7 years ago

/**

我看了一些 消息记录 发现 用int msgType,int subMsgType,int appMsgType 用这3个属性基本可以定位一个 类型了。

yaphone commented 7 years ago

哇,收到,朋友,多谢,后面我会按照这种格式调整一下,再次感谢!!

tianzhidao28 commented 7 years ago

https://github.com/tianzhidao28/wechat-service

可以参考下 我里面的。 包装了下你的

yaphone commented 7 years ago

收到,非常感谢!