From 8e1624fafe4ca21f7b0172c5d5f9567d24639b28 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 1 Mar 2016 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 937b6af5f..4caf5668f 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -159,7 +159,7 @@ class WechatsController < ActionController::Base def sendBind(request) news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "您还未绑定确实的用户,请先绑定." } } request.reply.news(news) do |article, n, index| # article is return object - url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{login_wechat_url}&response_type=code&scope=snsapi_base&state=#{uw.id}#wechat_redirect" + url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{login_wechat_url}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect" article.item title: "#{n[:title]}", description: n[:content], pic_url: 'http://wechat.trustie.net/images/trustie_logo2.png', @@ -169,7 +169,6 @@ class WechatsController < ActionController::Base def bind begin - raise "非法操作, 用户ID不存在" unless params[:state] raise "非法操作, code不存在" unless params[:code] openid = get_openid(params[:code]) raise "无法获取到openid" unless openid