Skip to content

Commit

Permalink
2018-11-22 Mojo::Weixin v1.4.3 发布
Browse files Browse the repository at this point in the history
  • Loading branch information
hexsum committed Nov 22, 2018
1 parent 6111133 commit 8b21d9a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2018-11-22 Mojo::Weixin v1.4.3
1)修复Mojo::Transaction::success is DEPRECATED的问题
2)Mojolicious最低依赖版本提升至v8.02

2018-10-09 Mojo::Weixin v1.4.2
1)IO::Socket::SSL依赖模块版本最低2.009
2)Mojolicious依赖模块版本最低7.83
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WriteMakefile(
"Digest::MD5" => 0,
"Encode::Locale" => 0,
"IO::Socket::SSL" => '2.009',
"Mojolicious" => '7.83',
"Mojolicious" => '8.02',
}, # e.g., Module::Name => 1.1
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Mojo-Weixin-* MANIFEST' },
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Mojo-Weixin v1.4.2 [![Build Status](https://travis-ci.org/sjdy521/Mojo-Weixin.svg?branch=master)](https://travis-ci.org/sjdy521/Mojo-Weixin) [![Join the chat at https://gitter.im/sjdy521/Mojo-Weixin](https://badges.gitter.im/sjdy521/Mojo-Weixin.svg)](https://gitter.im/sjdy521/Mojo-Weixin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![API列表](https://img.shields.io/badge/doc-API%E5%88%97%E8%A1%A8-brightgreen.svg)](API.md) [![QQ群-498880156](https://img.shields.io/badge/QQ%E7%BE%A4-498880156-blue.svg)](http://jq.qq.com/?_wv=1027&k=kjVJzo) [![IRC](https://img.shields.io/badge/IRC-%E5%AE%98%E6%96%B9%E9%A2%91%E9%81%93-yellow.svg)](http://irc.perfi.wang/?channel=#Mojo-Webqq)
Mojo-Weixin v1.4.3 [![Build Status](https://travis-ci.org/sjdy521/Mojo-Weixin.svg?branch=master)](https://travis-ci.org/sjdy521/Mojo-Weixin) [![Join the chat at https://gitter.im/sjdy521/Mojo-Weixin](https://badges.gitter.im/sjdy521/Mojo-Weixin.svg)](https://gitter.im/sjdy521/Mojo-Weixin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![API列表](https://img.shields.io/badge/doc-API%E5%88%97%E8%A1%A8-brightgreen.svg)](API.md) [![QQ群-498880156](https://img.shields.io/badge/QQ%E7%BE%A4-498880156-blue.svg)](http://jq.qq.com/?_wv=1027&k=kjVJzo) [![IRC](https://img.shields.io/badge/IRC-%E5%AE%98%E6%96%B9%E9%A2%91%E9%81%93-yellow.svg)](http://irc.perfi.wang/?channel=#Mojo-Webqq)
========================

使用Perl语言编写的微信客户端框架,基于Mojolicious,要求Perl版本5.10+,可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Expand Down
4 changes: 2 additions & 2 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ requires 'Digest::SHA';
requires 'Digest::MD5';
requires 'Encode::Locale';
requires 'IO::Socket::SSL', '>= 2.009';
requires 'Mojolicious','>= 7.83';
requires 'Mojolicious','>= 8.02';
recommends 'Term::ANSIColor';
conflicts 'Mojolicious','< 7.83';
conflicts 'Mojolicious','< 8.02';
2 changes: 1 addition & 1 deletion lib/Mojo/Weixin.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Mojo::Weixin;
our $VERSION = '1.4.2';
our $VERSION = '1.4.3';
use Mojo::Weixin::Base 'Mojo::EventEmitter';
use Mojo::IOLoop;
use Mojo::Weixin::Log;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Weixin/Log.pm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ sub new {
return $self;
}

sub _log { shift->emit('message', shift, @_) }
sub _log { shift->emit('message', shift, ref $_[0] eq 'CODE' ? $_[0]() : @_) }

sub _message {
my ($self, $level) = (shift, shift);
Expand Down
16 changes: 8 additions & 8 deletions lib/Mojo/Weixin/Plugin/Openwx.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
if(defined $data->{post_api}){
my($data,$ua,$tx) = $client->http_post($data->{post_api},{ua_connect_timeout=>5,ua_request_timeout=>5,ua_inactivity_timeout=>5,ua_retry_times=>1},json=>$post_json);
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event . "](@args)上报成功");
}
else{
Expand All @@ -61,7 +61,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
if(defined $data->{post_api}){
my($data,$ua,$tx) = $client->http_post($data->{post_api},json=>$post_json);
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event . "]上报成功");
}
else{
Expand All @@ -83,7 +83,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event."]上报成功");
}
else{
Expand All @@ -102,7 +102,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event."]上报成功");
}
else{
Expand All @@ -122,7 +122,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event."]上报成功");
}
else{
Expand All @@ -140,7 +140,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]事件[".$event."]上报成功");
}
else{
Expand All @@ -159,7 +159,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug( $tx->res->body );
if($tx->res->headers->content_type =~m#text/json|application/json#){
#文本类的返回结果必须是json字符串
Expand Down Expand Up @@ -196,7 +196,7 @@ sub call{
$client->stdout_line($client->to_json($post_json)) if $data->{post_stdout};
$client->http_post($data->{post_api},json=>$post_json,sub{
my($data,$ua,$tx) = @_;
if($tx->success){
if($tx->result->is_success){
$client->debug("插件[".__PACKAGE__ ."]发送消息[".$msg->id."]上报成功");
if($tx->res->headers->content_type =~m#text/json|application/json#){
#文本类的返回结果必须是json字符串
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Weixin/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sub _http_request{
my($ua,$tx) = @_;
_ua_debug($self,$ua,$tx,\%opt,0) if $opt{ua_debug};
$self->save_cookie();
if(defined $tx and $tx->success){
if(defined $tx and $tx->result->is_success){
my $r = $opt{json}?$self->from_json($tx->res->body):$tx->res->body;
$cb->($r,$ua,$tx);
}
Expand Down Expand Up @@ -146,7 +146,7 @@ sub _http_request{
}
_ua_debug($self,$ua,$tx,\%opt,1) if $opt{ua_debug};
$self->save_cookie();
if(defined $tx and $tx->success){
if(defined $tx and $tx->result->is_success){
my $r = $opt{json}?$self->from_json($tx->res->body):$tx->res->body;
$cb->($r,$ua,$tx) if defined $cb;
return wantarray?($r,$self->ua,$tx):$r;
Expand Down

0 comments on commit 8b21d9a

Please sign in to comment.