Open anthony-zg opened 1 year ago
补充:用官方最新demo(padlocal/wechaty-puppet-padlocal-demo.git)登录成功(提示正在使用ipad登录)。
但是使用
sudo docker run -ti \ --name wechaty_puppet_service_token_gateway \ --rm \ -e WECHATY_LOG \ -e WECHATY_PUPPET \ -e WECHATY_PUPPET_PADLOCAL_TOKEN \ -e WECHATY_PUPPET_SERVER_PORT \ -e WECHATY_TOKEN \ -p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT" \ --volume=~/wechaty:/bot \ wechaty/wechaty:0.65 mybot.js
扫码后登录失败(发现提示:正在使用桌面版微信登录)。
然后将成功的demo代码,映射给docker运行
改为
sudo docker run -ti \ --name wechaty_puppet_service_token_gateway \ --rm \ -e WECHATY_LOG \ -e WECHATY_PUPPET \ -e WECHATY_PUPPET_PADLOCAL_TOKEN \ -e WECHATY_PUPPET_SERVER_PORT \ -e WECHATY_TOKEN \ -p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT" \ --volume=~/wechaty:/bot \ wechaty/wechaty main.ts
运行成功,可以自动登录并接收消息。
背景: 1、新注册2天的小号,刚开始在console上扫码,console提示需要开通个人支付后方可登录成功。 2、开通银行卡后,再次扫码。提示登录失败。
有一个其他背景,手机和padlocal登录的开发机不在一个城市,属于异地,不确定会不会有影响。如果有影响,计划将两边切成一个城市再测试一下。
https://wechaty.js.org/qrcode/https%3A%2F%2Flogin.weixin.qq.com%2Fl%2F4ZIWNxQBng%3D%3D 16:33:09 WARN PuppetWeChatBridge onDialog() page.on(dialog) type:type() { return this._type; } message:登录失败。 (node:46) UnhandledPromiseRejectionWarning: Error: type() { return this._type; }(登录失败。) at PuppetWeChat. (/wechaty/src/wechaty.ts:443:32)
at PuppetWeChat.emit (events.js:400:28)
at PuppetWeChat.emit (domain.js:470:12)
at Bridge. (/wechaty/node_modules/wechaty-puppet-wechat/src/puppet-wechat.ts:314:52)
at Bridge.emit (events.js:400:28)
at Bridge.emit (domain.js:470:12)
at Bridge.onDialog (/wechaty/node_modules/wechaty-puppet-wechat/src/bridge.ts:186:10)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use
node --trace-warnings ...
to show where the warning was created) (node:46) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhand led-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:46) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.