Giter Site home page Giter Site logo

Comments (10)

lanrion avatar lanrion commented on May 28, 2024

把具体错误贴出来。

from weixin_rails_middleware.

hatch-win avatar hatch-win commented on May 28, 2024

/Users/xxx/.rvm/gems/ruby-2.1.4/gems/weixin_rails_middleware-1.3.2/lib/weixin_rails_middleware/adapter/weixin_adapter.rb:59: Weixin signature NotMatch
Completed 500 Internal Server Error in 22ms

ActionView::MissingTemplate (Missing template weixin_rails_middleware/weixin/index with {:locale=>[:"zh-CN"], :formats=>[:html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder, :haml]}. Searched in:

  • "/Users/xxx/Codes/rails/douwan/wechat_mall/app/views"
  • "/Users/xxx/.rvm/gems/ruby-2.1.4/bundler/gems/rails_admin_jcrop-ea48cb5e4324/app/views"
  • "/Users/xxx/.rvm/gems/ruby-2.1.4/gems/ckeditor-4.1.5/app/views"
  • "/Users/xxx/.rvm/gems/ruby-2.1.4/bundler/gems/rails_admin-3e77c06e3e44/app/views"
  • "/Users/xxx/.rvm/gems/ruby-2.1.4/gems/kaminari-0.17.0/app/views"
  • "/Users/xxx/.rvm/gems/ruby-2.1.4/gems/devise-3.5.2/app/views"
    ):

from weixin_rails_middleware.

lanrion avatar lanrion commented on May 28, 2024

weixin_rails_middleware/adapter/weixin_adapter.rb:59: Weixin signature NotMatch

这个才是你要关注的错误信息。

你的签名不匹配。

from weixin_rails_middleware.

hatch-win avatar hatch-win commented on May 28, 2024

应该不是。
我原本是在 V 1.2.6 的时候配置、微信校验可以的了。
然后升级到 V 1.3.2 的时候, 就报错了。

from weixin_rails_middleware.

lanrion avatar lanrion commented on May 28, 2024

出1.2.6,当时微信还没有签名加密这一块,1.3.2是添加了签名这一块的。
具体查看:https://github.com/lanrion/weixin_rails_middleware/wiki/msg-encryption-decipher

from weixin_rails_middleware.

hatch-win avatar hatch-win commented on May 28, 2024

在1.3.2, WeixinRailsMiddleware::WeixinController里面的check_weixin_legality ,render check_result
返回的是check_result={ :plain => "xxxx", :status => "200"}
但在1.2.6是 check_result = { :text => "xxxx", :status => "200"}

为什么在1.3.2就返回:plain => "xxxx"而不是text => "xxxx"呢? 我这边就出现了MissTemplate的错误了。只有把plain改成text才不会报错。


按照加密配置 weixin_rails_middleware.rb ,
config.encoding_aes_key = "xxx" config.app_id = "xxx"
但是校验返回:

INFO -- : Parameters: {"signature"=>"xxxxxxxxxxxxx", "echostr"=>"xxxxxxxxxxxx", "timestamp"=>"1487566558", "nonce"=>"1306893847", "weixin_secret_key"=>"xxxxxxxxxxx"}
INFO -- : Completed 500 Internal Server Error in 1ms
FATAL -- :
ActionView::MissingTemplate (Missing template weixin_rails_middleware/weixin/index with {:locale=>[:"zh-CN", :zh], :formats=>[:html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder, :haml]}

from weixin_rails_middleware.

lanrion avatar lanrion commented on May 28, 2024

晚点我试试,我使用没有遇到过这。有可能跟Rails的版本有关 :d6b7270

你贴一下的的Rails版本。

from weixin_rails_middleware.

hatch-win avatar hatch-win commented on May 28, 2024

rails -v 4.0.0

from weixin_rails_middleware.

lanrion avatar lanrion commented on May 28, 2024

你升级到 1.3.1 版本试试。

from weixin_rails_middleware.

hatch-win avatar hatch-win commented on May 28, 2024

1.3.1 版本 ok的

from weixin_rails_middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.