分享修改
This commit is contained in:
parent
c0dc070c15
commit
822ca15c78
|
@ -424,13 +424,14 @@ class WechatsController < ActionController::Base
|
|||
|
||||
session[:wechat_openid] = open_id
|
||||
if params[:code]
|
||||
if params[:userid]
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
|
||||
elsif params[:id]
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
else
|
||||
redirect_to "/wechat/user_activities##{@path}" and return
|
||||
end
|
||||
# if params[:userid]
|
||||
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
|
||||
# elsif params[:id]
|
||||
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
# else
|
||||
# redirect_to "/wechat/user_activities##{@path}" and return
|
||||
# end
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
end
|
||||
# end
|
||||
render 'wechats/user_activities', layout: nil
|
||||
|
|
|
@ -268,12 +268,12 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|||
var urlName = response.data.type_name + "_discussion";
|
||||
link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid +
|
||||
"&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+response.data.data.act_id+
|
||||
"&response_type=code&scope=snsapi_base&state="+urlName+"&connect_redirect=1#wechat_redirect";
|
||||
"&response_type=code&scope=snsapi_info&state="+urlName+"&connect_redirect=1#wechat_redirect";
|
||||
}
|
||||
else{
|
||||
link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid +
|
||||
"&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+response.data.data.act_id+
|
||||
"&response_type=code&scope=snsapi_base&state="+args.urlName+"&connect_redirect=1#wechat_redirect";
|
||||
"&response_type=code&scope=snsapi_info&state="+args.urlName+"&connect_redirect=1#wechat_redirect";
|
||||
}
|
||||
|
||||
console.log("link= "+link);
|
||||
|
|
Loading…
Reference in New Issue