This commit is contained in:
parent
2cfd876f2f
commit
1f8ea39765
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue