diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 017886194..a83969d39 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -142,8 +142,9 @@ class WechatsController < ActionController::Base raise "用户名或密码错误,请重新登录" unless user #补全用户信息 - user.user_wechat = UserWechat.find_by_id(params[:openid]) - user.save! + uw = UserWechat.find_by_id(params[:openid]) + uw.user = user + uw.save! rescue Exception=>e @wechat_bind_errors = e.message render :login diff --git a/app/views/wechats/bind.html.erb b/app/views/wechats/bind.html.erb new file mode 100644 index 000000000..e569162b2 --- /dev/null +++ b/app/views/wechats/bind.html.erb @@ -0,0 +1,14 @@ + + + + Ruby China + + + + + + +

恭喜! 绑定成功.

+ + + \ No newline at end of file diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 44fc1da32..cbc476f26 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,3 +1,13 @@ + + + + Ruby China + + + + + +

@@ -29,4 +39,7 @@ <% end %> -

\ No newline at end of file +
+ + + \ No newline at end of file