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