Commit bc932a74 by lanrion

修复weixin js sdk 接口 bug

parent b71cbb48
...@@ -48,13 +48,7 @@ module WeixinAuthorize ...@@ -48,13 +48,7 @@ module WeixinAuthorize
def get_jssign_package(url) def get_jssign_package(url)
timestamp = Time.now.to_i timestamp = Time.now.to_i
noncestr = SecureRandom.hex(16) noncestr = SecureRandom.hex(16)
string = { string = "jsapi_ticket=#{js_ticket}&noncestr=#{noncestr}&timestamp=#{timestamp}&url=#{url}";
jsapi_ticket: js_ticket,
noncestr: noncestr,
timestamp: timestamp,
url: url
}.to_param
signature = Digest::SHA1.hexdigest(string) signature = Digest::SHA1.hexdigest(string)
{ {
"appId" => app_id, "nonceStr" => noncestr, "appId" => app_id, "nonceStr" => noncestr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment