加入openid传参

chenlw_dev
guange 9 years ago
parent a6a0681b78
commit 58c1b27600

@ -11,11 +11,12 @@ module Mobile
params do
requires :type, type: String
requires :content, type: String
requires :openid, type: String
end
post ':id' do
type = params[:type]
result = 1
current_user = User.find 8686
current_user = UserWechat.find_by_openid(params[:openid]).user
if params[:content]!="" && current_user
case type
when "HomeworkCommon"

@ -68,10 +68,12 @@ $(document).ready(function(){
replyNum++;
$(".reply-num").text("(" + replyNum + ")");
getOpenId(function(openid) {
//获取并传送回复用户数据
var userInfo = {
"type" : "HomeworkCommon",
"content" : postInput
"type": "HomeworkCommon",
"content": postInput,
openid: openid
};
$.ajax({
@ -85,6 +87,7 @@ $(document).ready(function(){
error: function (err) { //如果执行不成功,那么执行此方法
alert("err:" + err);
}
})
});
}

@ -72,10 +72,12 @@ $(document).ready(function(){
replyNum++;
$(".reply-num").text("(" + replyNum + ")");
getOpenId(function(openid) {
//获取并传送回复用户数据
var userInfo = {
"type" : "Issue",
"content" : postInput
"type": "Issue",
"content": postInput,
openid: openid,
};
$.ajax({
@ -89,6 +91,7 @@ $(document).ready(function(){
error: function (err) { //如果执行不成功,那么执行此方法
alert("err:" + err);
}
})
});
}

Loading…
Cancel
Save