From 7e40c2447f2ddabfc1e0c2d423bbc505f2a6711e Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 14 Aug 2016 15:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E5=B8=90?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/users.rb | 4 ++-- app/controllers/wechats_controller.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/api/mobile/apis/users.rb b/app/api/mobile/apis/users.rb index 53884f779..764dc957f 100644 --- a/app/api/mobile/apis/users.rb +++ b/app/api/mobile/apis/users.rb @@ -47,7 +47,7 @@ module Mobile end ws = WechatService.new - ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台。", user.login+"("+user.show_name+")", Time.now.strftime("%Y-%m-%d")) + ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台。", user.show_name+"("+user.login+")", Time.now.strftime("%Y-%m-%d")) present status: 0, message: '您已成功绑定Trustie平台' end @@ -89,7 +89,7 @@ module Mobile end ws = WechatService.new - ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台。", user.login+"("+user.show_name+")", Time.now.strftime("%Y-%m-%d")) + ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台。", user.show_name+"("+user.login+")", Time.now.strftime("%Y-%m-%d")) present :data, user, with: Mobile::Entities::User present :status, 0 end diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 99ec193b0..0226e703c 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -386,7 +386,7 @@ class WechatsController < ActionController::Base user: user ) ws = WechatService.new - ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台!", user.login+"("+user.show_name+")", format_time(Time.now)) + ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台!", user.show_name+"("+user.login+")", format_time(Time.now)) render :json => {status:0, msg: "绑定成功"} rescue Exception=>e render :json => {status: -1, msg: e.message} @@ -416,9 +416,9 @@ class WechatsController < ActionController::Base render 'wechats/open_wechat', layout: nil and return end - # unless user_binded?(open_id) - # @path = '/login' - # else + unless user_binded?(open_id) && params[:state] != "invite_code" && params[:state] != "project_invite_code" && params[:state] != "blog_comment" && params[:state] != "course_notice" && params[:state] != "project_discussion" && params[:state] != "course_discussion" && params[:state] != "homework" && params[:state] != "issues" && params[:state] != "journal_for_message" + @path = '/login' + else if params[:state] == 'myclass' @course_id = params[:id]; elsif params[:state] == 'myproject' @@ -436,7 +436,7 @@ class WechatsController < ActionController::Base end # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end - # end + end render 'wechats/user_activities', layout: nil end