This commit is contained in:
parent
2cfd876f2f
commit
1f8ea39765
|
@ -24,7 +24,7 @@ module Mobile
|
||||||
#login mail password
|
#login mail password
|
||||||
openid_length = openid.length
|
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]
|
access_token = session[:access_token]
|
||||||
|
|
||||||
|
|
|
@ -444,21 +444,13 @@ class WechatsController < ActionController::Base
|
||||||
openid = session[:wechat_openid]
|
openid = session[:wechat_openid]
|
||||||
unless openid
|
unless openid
|
||||||
if code
|
if code
|
||||||
|
#不能联系调两次web_access_token 否则会提示请在微信客户端打开次链接
|
||||||
info = wechat.web_access_token(code)
|
info = wechat.web_access_token(code)
|
||||||
openid =info["openid"]
|
openid =info["openid"]
|
||||||
access_token =info["access_token"]
|
access_token =info["access_token"]
|
||||||
if access_token
|
if access_token
|
||||||
session[:access_token] = access_token
|
session[:access_token] = access_token
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue