From 1f8ea3976545032dd51910ca0f767eb065ada4a7 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 12 Aug 2016 14:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/new_comment.rb | 2 +- app/controllers/wechats_controller.rb | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/api/mobile/apis/new_comment.rb b/app/api/mobile/apis/new_comment.rb index a7c944a26..d2c77f5b2 100644 --- a/app/api/mobile/apis/new_comment.rb +++ b/app/api/mobile/apis/new_comment.rb @@ -24,7 +24,7 @@ module Mobile #login mail password openid_length = openid.length - login = openid[0..10]+openid[openid_length-3..openid_length-1] + login = openid[0..10]+openid[openid_length-3..openid_length-1]+Time.now.to_i.to_s access_token = session[:access_token] diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index ed0e2149b..e9da12c38 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -444,21 +444,13 @@ class WechatsController < ActionController::Base openid = session[:wechat_openid] unless openid if code + #不能联系调两次web_access_token 否则会提示请在微信客户端打开次链接 info = wechat.web_access_token(code) openid =info["openid"] access_token =info["access_token"] if access_token session[:access_token] = access_token end - - # openid = wechat.web_access_token(code)["openid"] - # info = wechat.web_access_token(code) - # logger.info "web_access_token!!!!!!!!!!!!" - # logger.info info - # access_token = wechat.web_access_token(code)["access_token"] - # if access_token - # session[:access_token] = access_token - # end end end