sinatra-weixin-robot 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra-weixin-robot.rb +1 -1
- data/lib/sinatra/weixin-robot.rb +2 -2
- metadata +1 -1
data/lib/sinatra-weixin-robot.rb
CHANGED
data/lib/sinatra/weixin-robot.rb
CHANGED
@@ -7,7 +7,7 @@ module Sinatra
|
|
7
7
|
module WeiXinRobot
|
8
8
|
module RobotHelpers
|
9
9
|
def generate_signature(token=nil)
|
10
|
-
weixin_token = token || settings.
|
10
|
+
weixin_token = token || settings.weixin_token
|
11
11
|
timestamp, nonce = params[:timestamp], params[:nonce]
|
12
12
|
weixin_sha1 = [weixin_token.to_s, timestamp.to_s, nonce.to_s].sort!.join
|
13
13
|
Digest::SHA1.hexdigest(weixin_sha1)
|
@@ -177,7 +177,7 @@ module Sinatra
|
|
177
177
|
end
|
178
178
|
end #Reply
|
179
179
|
def self.registered(robot)
|
180
|
-
robot.set :weixin_token,
|
180
|
+
robot.set :weixin_token, nil
|
181
181
|
robot.set :weixin_uri, "http://wwww.your-weixin-bot-url.com/"
|
182
182
|
robot.set :weixin_path, URI(robot.settings.weixin_uri).path.to_s
|
183
183
|
robot.helpers RobotHelpers
|