From c4c0dd3c60b5577a5b147e5f81b5f0ed5a8d2b29 Mon Sep 17 00:00:00 2001 From: txz Date: Wed, 25 May 2016 13:50:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E7=AC=A6=E6=9C=AA=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1234567 | 2 +- public/assets/wechat/blog_detail.html | 2 +- public/assets/wechat/course_discussion.html | 2 +- public/assets/wechat/course_notice.html | 2 +- public/assets/wechat/homework_detail.html | 2 +- public/assets/wechat/issue_detail.html | 2 +- public/assets/wechat/jour_message_detail.html | 2 +- public/assets/wechat/project_discussion.html | 2 +- public/stylesheets/weui/weixin.css | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/1234567 b/1234567 index f2f064de8..ed94d1804 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"gRbIMUYYKFdANxpBGhYc8iauelCeSy3x7wODnZd1crF9upNiANKAdGaMKFLcgPz_0-oJvRtb7Ai0G1WnL_AnVV-tdRlzlCPpgpO9Z9k9EqrGz2iSLCAbQ35qk0f75KWlRRDfCEAVVH","expires_in":7200,"got_token_at":1464053170} \ No newline at end of file +{"access_token":"q51KZUeA6_-CCCH-Buy1m4pR7G9hh-9GT_Vn-h9oFq8qfF9SVVeagJZ7Jeuvv3k12UEXk7IxtAuXkrBlufaanGd81bNEEkXkPyhPveTHenmjj5fQa3GQmxCM9kUPhZjyXMPjCIAKZC","expires_in":7200,"got_token_at":1464146250} \ No newline at end of file diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index 8473b1446..8c5dcb73f 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -24,7 +24,7 @@
-
+

                         
{{journal.lasted_comment}}
回复
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index c790fd5cf..bf450d447 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -30,7 +30,7 @@
-
+

                         
{{journal.lasted_comment}}
回复
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 18f62be1e..ac1f7dcea 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -30,7 +30,7 @@
-
+

                         
{{comments.created_on}}
回复
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 5efa7c54d..41ff56f57 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -36,7 +36,7 @@
-
+

                         
{{journal.lasted_comment}}
回复
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 20c35c664..08eb9a39d 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -34,7 +34,7 @@
-
+

                         
{{journal.created_on}}
回复
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index f9aebd632..f813d19c1 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -22,7 +22,7 @@
-
+

                         
{{journal.lasted_comment}}
回复
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 0c3f9aad3..c0a609bc0 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -30,7 +30,7 @@
-
+

                             
{{journal.lasted_comment}}
回复
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 8b135dbeb..f0e336563 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -3,7 +3,7 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} -h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} +h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} From 921b01e8e3eda778aa56676b000262bf9a40e5b7 Mon Sep 17 00:00:00 2001 From: txz Date: Wed, 25 May 2016 14:26:49 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=87=E5=AD=97=E5=86=85=E5=AE=B9=E6=BB=91=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 7 ++++++- public/stylesheets/weui/weixin.css | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 5d94afca4..0817eaa58 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -136,7 +136,7 @@ app.factory('common', function($http, auth, $routeParams){ url: apiUrl+ "new_comment/"+id, data: userInfo }).then(function successCallback(response) { - alert("提交成功"); + //alert("提交成功"); //数据提交完成,回复按钮启用 data.disabled = false; if(typeof cb === 'function'){ @@ -410,11 +410,16 @@ app.directive('inputAuto',function(){ scope: {}, link: function(scope, element){ var copyContainer = element.parent().children().eq(0); + var sendButton = element.parent().next(); element.on('input',function(){ + console.log(sendButton); copyContainer.html(element[0].value); var textHeight = copyContainer[0].scrollHeight; element.css('height', textHeight + 'px'); }); + sendButton.on('click',function(){ + element.css('height','28px'); + }); } } }); diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index f0e336563..0455c81e3 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -70,7 +70,7 @@ a.underline {text-decoration:underline;} .post-reply-date, .post-reply-trigger {font-size:13px;} .post-input-container {padding-right:2px;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} -.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} .reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} From a3d90df5ce8c666c059ca8d84f25be2f8450b428 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 26 May 2016 10:51:39 +0800 Subject: [PATCH 3/7] delete unuse file --- Client.html | 25 ---- Gemfile.lock~ | 386 -------------------------------------------------- Gemfile~ | 112 --------------- 3 files changed, 523 deletions(-) delete mode 100644 Client.html delete mode 100644 Gemfile.lock~ delete mode 100644 Gemfile~ diff --git a/Client.html b/Client.html deleted file mode 100644 index fbb7cec52..000000000 --- a/Client.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -Client - - - - -
-

这是一张图片

-

photo Share A

-
- -

这是一段视频

-

Text Share B

-
- -

这是一篇文章

-

Text Share C

-
- - - - \ No newline at end of file diff --git a/Gemfile.lock~ b/Gemfile.lock~ deleted file mode 100644 index 7d6563465..000000000 --- a/Gemfile.lock~ +++ /dev/null @@ -1,386 +0,0 @@ -GIT - remote: http://github.com/guange2015/wechat.git - revision: a18c3d6603cb1aa7bd1fe887b17f67426be01f35 - specs: - wechat (0.7.1) - activerecord (>= 3.2, < 5.1.x) - http (~> 1.0, >= 1.0.1) - nokogiri (>= 1.6.0) - thor - -PATH - remote: lib/gitlab-cli - specs: - gitlab (3.2.0) - httparty - terminal-table - -PATH - remote: lib/grack - specs: - grack (2.0.2) - rack (~> 1.4.5) - -PATH - remote: lib/rails_kindeditor - specs: - rails_kindeditor (0.4.5) - carrierwave - mini_magick - -GEM - remote: https://ruby.taobao.org/ - specs: - actionmailer (3.2.22.2) - actionpack (= 3.2.22.2) - mail (~> 2.5.4) - actionpack (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.22.2) - activesupport (= 3.2.22.2) - builder (~> 3.0.0) - activerecord (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - activesupport (3.2.22.2) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) - acts-as-taggable-on (2.4.1) - rails (>= 3, < 5) - addressable (2.4.0) - ansi (1.5.0) - arel (3.0.3) - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) - better_errors (1.1.0) - coderay (>= 1.0.0) - erubis (>= 2.6.6) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) - builder (3.0.0) - byebug (8.2.2) - carrierwave (0.10.0) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - json (>= 1.7) - mime-types (>= 1.16) - chinese_pinyin (1.0.0) - climate_control (0.0.3) - activesupport (>= 3.0) - cocaine (0.5.8) - climate_control (>= 0.0.3, < 1.0) - coderay (1.1.1) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - coffee-rails (3.2.2) - coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - daemons (1.2.3) - debug_inspector (0.0.2) - delayed_job (4.1.1) - activesupport (>= 3.0, < 5.0) - delayed_job_active_record (4.1.0) - activerecord (>= 3.0, < 5) - delayed_job (>= 3.0, < 5) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - diff-lcs (1.2.5) - domain_name (0.5.20160216) - unf (>= 0.0.5, < 1.0.0) - elasticsearch (1.0.15) - elasticsearch-api (= 1.0.15) - elasticsearch-transport (= 1.0.15) - elasticsearch-api (1.0.15) - multi_json - elasticsearch-model (0.1.8) - activesupport (> 3) - elasticsearch (> 0.4) - hashie - elasticsearch-rails (0.1.8) - elasticsearch-transport (1.0.15) - faraday - multi_json - equalizer (0.0.11) - erubis (2.7.0) - execjs (2.6.0) - factory_girl (4.5.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.6.0) - factory_girl (~> 4.5.0) - railties (>= 3.0.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - fastercsv (1.5.5) - grape (0.9.0) - activesupport - builder - hashie (>= 2.1.0) - multi_json (>= 1.3.2) - multi_xml (>= 0.5.2) - rack (>= 1.3.0) - rack-accept - rack-mount - virtus (>= 1.0.0) - grape-entity (0.4.8) - activesupport - multi_json (>= 1.3.2) - grape-swagger (0.10.4) - grape (>= 0.8.0) - grape-entity (< 0.5.0) - hashie (3.4.3) - hike (1.2.3) - htmlentities (4.3.4) - http (1.0.2) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 1.0.1) - http_parser.rb (~> 0.6.0) - http-cookie (1.0.2) - domain_name (~> 0.5) - http-form_data (1.0.1) - http_parser.rb (0.6.0) - httparty (0.13.7) - json (~> 1.8) - multi_xml (>= 0.5.2) - i18n (0.6.11) - ice_nine (0.11.2) - iconv (1.0.4) - journey (1.0.4) - jquery-rails (2.0.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) - json (1.8.3) - kaminari (0.16.3) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - libv8 (3.16.14.13) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - method_source (0.8.2) - mime-types (1.25.1) - mini_magick (4.4.0) - mini_portile2 (2.0.0) - multi_json (1.11.2) - multi_xml (0.5.5) - multipart-post (2.0.0) - mysql2 (0.3.18) - net-ldap (0.3.1) - netrc (0.11.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - paperclip (3.5.4) - activemodel (>= 3.0.0) - activesupport (>= 3.0.0) - cocaine (~> 0.5.3) - mime-types - polyglot (0.3.5) - pry (0.10.3) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.3.0) - byebug (~> 8.0) - pry (~> 0.10) - pry-rails (0.3.4) - pry (>= 0.9.10) - pry-stack_explorer (0.4.9.2) - binding_of_caller (>= 0.7) - pry (>= 0.9.11) - rack (1.4.7) - rack-accept (0.4.5) - rack (>= 0.4) - rack-cache (1.6.1) - rack (>= 0.4) - rack-cors (0.4.0) - rack-mount (0.8.3) - rack (>= 1.0.0) - rack-openid (1.4.2) - rack (>= 1.1.0) - ruby-openid (>= 2.1.8) - rack-raw-upload (1.1.1) - multi_json - rack-ssl (1.3.4) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails (3.2.22.2) - actionmailer (= 3.2.22.2) - actionpack (= 3.2.22.2) - activerecord (= 3.2.22.2) - activeresource (= 3.2.22.2) - activesupport (= 3.2.22.2) - bundler (~> 1.0) - railties (= 3.2.22.2) - railties (3.2.22.2) - actionpack (= 3.2.22.2) - activesupport (= 3.2.22.2) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.5.0) - rdoc (3.12.2) - json (~> 1.4) - redis (3.2.2) - redis-actionpack (3.2.4) - actionpack (~> 3.2.0) - redis-rack (~> 1.4.4) - redis-store (~> 1.1.4) - redis-activesupport (3.2.5) - activesupport (~> 3.2.0) - redis-store (~> 1.1.0) - redis-rack (1.4.4) - rack (~> 1.4.0) - redis-store (~> 1.1.4) - redis-rails (3.2.4) - redis-actionpack (~> 3.2.4) - redis-activesupport (~> 3.2.4) - redis-store (~> 1.1.4) - redis-store (1.1.7) - redis (>= 2.2) - ref (2.0.0) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rich (1.4.6) - jquery-rails - kaminari - mime-types - paperclip - rack-raw-upload - rails (>= 3.2.0) - sass-rails - rspec-core (3.4.3) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - ruby-ole (1.2.12) - ruby-openid (2.1.8) - rubyzip (1.2.0) - sass (3.4.21) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - seems_rateable (1.0.13) - jquery-rails - rails - slop (3.6.0) - spreadsheet (1.1.1) - ruby-ole (>= 1.0) - sprockets (2.2.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - terminal-table (1.5.2) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) - ref - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.46) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.2) - virtus (1.0.5) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - acts-as-taggable-on (= 2.4.1) - ansi - better_errors (~> 1.1.0) - binding_of_caller - builder (= 3.0.0) - chinese_pinyin - coderay (~> 1.1.0) - coffee-rails (~> 3.2.1) - daemons - delayed_job_active_record - elasticsearch-model - elasticsearch-rails - factory_girl_rails - fastercsv (~> 1.5.0) - gitlab! - grack! - grape (~> 0.9.0) - grape-entity - grape-swagger - htmlentities - i18n (~> 0.6.0) - iconv - jquery-rails (~> 2.0.2) - kaminari - mysql2 (= 0.3.18) - net-ldap (~> 0.3.1) - paperclip (~> 3.5.4) - pry-byebug - pry-rails - pry-stack_explorer - rack-cors - rack-openid - rails (~> 3.2) - rails_kindeditor! - redis-rails - rest-client - rich (= 1.4.6) - rspec-rails (~> 3.0) - ruby-ole - ruby-openid (~> 2.1.4) - rubyzip - sass-rails (~> 3.2.3) - seems_rateable (~> 1.0.13) - spreadsheet - therubyracer - uglifier (>= 1.0.3) - wechat! - -BUNDLED WITH - 1.10.6 diff --git a/Gemfile~ b/Gemfile~ deleted file mode 100644 index 24869e72b..000000000 --- a/Gemfile~ +++ /dev/null @@ -1,112 +0,0 @@ -source 'http://rubygems.org/' -### ִbundle config mirror.https://rubygems.org https://gems.ruby-china.org лruby-chinaԴ - -unless RUBY_PLATFORM =~ /w32/ - # unix-like only - gem 'iconv' -end - -gem 'certified' - -gem 'wechat',path: 'lib/wechat' -gem 'grack', path:'lib/grack' -gem 'gitlab', path: 'lib/gitlab-cli' -gem 'rest-client' -gem "mysql2", "= 0.3.18" -gem 'redis-rails' -gem 'rubyzip' -gem 'delayed_job_active_record'#, :group => :production -gem 'daemons' -gem 'grape', '~> 0.9.0' -gem 'grape-entity' -gem 'rack-cors', :require => 'rack/cors' -gem 'seems_rateable', '~> 1.0.13' -gem 'rails', '~> 3.2' -gem "jquery-rails", "~> 2.0.2" -gem "i18n", "~> 0.6.0" -gem 'coderay', '~> 1.1.0' -gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] -gem "builder", "3.0.0" -gem 'acts-as-taggable-on', '2.4.1' -gem 'spreadsheet' -gem 'ruby-ole' -gem 'rails_kindeditor',path:'lib/rails_kindeditor' -#gem "rmagick", ">= 2.0.0" -gem 'binding_of_caller' -gem 'chinese_pinyin' -# gem 'sunspot_rails', '~> 1.3.3' -# gem 'sunspot_solr' -# gem 'sunspot' -# gem 'progress_bar' -gem 'ansi' - -gem 'kaminari' -gem 'elasticsearch-model' -gem 'elasticsearch-rails' - - -### profile -#gem 'oneapm_rpm' - -group :development do - gem 'grape-swagger' - gem 'better_errors', '~> 1.1.0' - # gem "query_reviewer" - # gem 'rack-mini-profiler', '~> 0.9.3' - if RUBY_PLATFORM =~ /w32/ - gem 'win32console' - end -end - -group :development, :test do - unless RUBY_PLATFORM =~ /w32/ - gem 'pry-rails' - if RUBY_VERSION >= '2.0.0' - gem 'pry-byebug' - end - gem 'pry-stack_explorer' - if RUBY_PLATFORM =~ /darwin/ - gem 'puma' - end - end - - gem 'rspec-rails', '~> 3.0' - gem 'factory_girl_rails' -end - -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - gem 'therubyracer', :platforms => :ruby - - gem 'uglifier', '>= 1.0.3' -end - -# Optional gem for LDAP authentication -group :ldap do - gem "net-ldap", "~> 0.3.1" -end - - -# Optional gem for OpenID authentication -group :openid do - gem "ruby-openid", "~> 2.1.4", :require => "openid" - gem "rack-openid" -end - - -database_file = File.join(File.dirname(__FILE__), "config/database.yml") -if File.exist?(database_file) -else - warn("Please configure your config/database.yml first") -end - -# Load plugins' Gemfiles -Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| - puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` - instance_eval File.read(file) -end From c73ce61afe8e60850fc8be696acdc4366c87cfde Mon Sep 17 00:00:00 2001 From: txz Date: Thu, 26 May 2016 10:55:00 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8F=AF=E7=82=B9=E5=87=BB=EF=BC=8Cicon=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 14 +++++++------- public/images/wechat/icon.png | Bin 0 -> 5710 bytes public/images/wechat/icon_list.gif | Bin 0 -> 2780 bytes public/images/wechat/loading.gif | Bin 3878 -> 0 bytes public/stylesheets/weui/weixin.css | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) create mode 100755 public/images/wechat/icon.png create mode 100755 public/images/wechat/icon_list.gif delete mode 100755 public/images/wechat/loading.gif diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 3391506f2..dbf5e8b27 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -5,7 +5,7 @@
-
+
@@ -39,7 +39,7 @@
-
+
@@ -66,7 +66,7 @@
-
+
@@ -109,7 +109,7 @@
-
+
@@ -139,7 +139,7 @@
-
+
@@ -181,7 +181,7 @@
-
+
@@ -208,7 +208,7 @@
-
+
diff --git a/public/images/wechat/icon.png b/public/images/wechat/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..afc7aa639a1a8c5721ed866e851d07cf944e93b4 GIT binary patch literal 5710 zcmb_ec{r49+rK>uk*%^vq$pXkXBo?oC0m#=)+}L^z3jW}6iL~~QVDb0B5LgWknD|} zNw$m-8Y2v!p67eM@929w-tT?CfuKRc1=lMJD>pJf9`kiq%^)=~fIcWg^px4$? zHv#|(^P_Q}hU&-?y4ezYw4CtJGP@4|bf5Yo(ds7`FyQyq6B78+h7XhPVTWC0<*6HGT^`SQnE z3|pA5Uq8mxl^08ym>Bku#ZdTUJnb0uJm2%gh!?T(@AqZ{UpSA{lNNgqsz;TUO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_uT8;ZZ!Qikrm=VlPPs=9JA$e{&Fbci!<^?S+IATbSpbv~qDO zRaAHfg_M68HF(MQMz`D2JHR`n&6mA|-I|y!-Z)`p*w8RL@qPjKuhvoMI~&c^-rgUM zGGS~_K!(4>@VCCjxAb$czHYCOq1_d-& zXLXXNoZtC3!XLVEL|hXB3uA*HT0jgTM$@J!3oNfgV(#|g!le#$_TQnw+j*5xpWjzd4JEO5V0ic(S!x*I+g9u zDl(h<*ujZ5-lOeJsB0Uno8Jgs8wWjLia^aItW+FIZ4jA?QYZ@WtNRuL?(S`DbP_f< z4)E|ph?_An<*qWn*Ee;iaf~KNDZq1>H+$i|a#E6kvuP73-?ZE2nbp~K&`!gxXvP^N z;j-a!=bC3_Wo_X8TX(&El7hgRvdn>@(o!TL^r1)hS;e=yXBE@*&ML|(_|b}pl`P;6 zr7hbVnf72vM5sd~LyoDu&C)?-ZGNpg#hx&DP+eP4J3-@H7qJw|o|X+Z z0slif{tX@ZCyMb~mcOOux9R^C-T5W(7x2GtLZ|JJ5%B8iz$qkjY#uf2fcABL^)jf< GgZ}`HLWBnZ literal 0 HcmV?d00001 diff --git a/public/images/wechat/icon_list.gif b/public/images/wechat/icon_list.gif new file mode 100755 index 0000000000000000000000000000000000000000..1d7dcb061e6f401767d8ada7c18c38ac178fa6f3 GIT binary patch literal 2780 zcmaJ>dpy&7AODSEG+DVW$}DwuPA=PMu|qcIb`B15qE64r*qGR*ZAH#0_e+x0>Egs; zN|}yCh!CT>v?NL>x0y>S)pDKtGdFMd}>U#S0X?}kGjBHUP63xxcO-@c06cjWxG`xQO`dZCE zRaI3*MMZCKFOSE|&dzo^TEpk_TU%SD(+kDL#a>YYdAxY>V({e@Ii;!T*_$g@uGq5f zmNX7O=$>e9ZXTVOt!f>sd^mdX_Vdch%A%s8*sD)^MwF%Ftyi(O~ zN-4d3`SSey{M78?!ooskW+pnQtZ#JEnqDzIwn zRyC;G~=91-K8@mV=IWUyUMFdcTLm0Nm z_tkYsLATY%?ap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Bru~*Bpa-9)j`7t>uC8^qRO zB7CDv>pUB4_V8gHZxD-?3?&8Pvd+JnP4mQ2b8@(=!N;AERg_PAE#1IyGyi$hv5s`V z9iO`&2r3%LP)jH)a`%s`+v|38W%V9`dGhdWra2M{MB)Th%w8|TKiCFH_7;@iE8!}H z+~!6iFjJ>yC_`?jO|V5!4D-+oA4ag6;UCoN zHy9cO(+H4@X0-2M2uQY8ix?<_(LEM?GdPQ%C7nlXeyL9eq8csNdu2w>D!! zViwIy=cOEFa49 zPLpF=+GPz|R6Yl{dxxhO@BVTOaCcVLE~*hdIliA3SI75ro>t$hg2Co;<_ut<+POoR zJMFT<|}?k zO&y{^uO`R!1JNDM`8W5kJG-r}clIX1g>y#MKnV;&b&_sj+>Z|4B=|P_2uKV`HL-fl zxg1Ivs%wQg@(2^ZkW{yC+0<}yZnhUl?q z_kJEL6x-7%ui#|t0xoU7mWW~EVKJ}iV?lS5{KV{S+HXT_i}0sN)C|%51T*nO4jwa? zFf8Eu`#!9IaQdiuP{L^R8&Sq**aHl_lN3X;4fK1flUqQ_ZO{Sj?4Fg_ID+)V@%X!D zHcX@u(RjG2LD4=c^o{k&ZWoHI6p!GAIHl>ZxcxH$E6!?*Ju38%t;9UK|5GC&aA7O) z7_e4-Ckbt2Y*+&u75eA0eq=oTX2J)z^#T9OkZ^F0%-*ctZ^U!un}rP%ozQ7QPfqW) z4pgC+TMIEg?P7{+SbkyS>?FYtTo^P|=1@zlrQ-tnEYh}5Bb)h#s8!Z}bS;(feRc3p zcPik4AG>eDrB<;o-Q{tX-606kjWnQwRI_h#)?`TiQNIe)^Hnd?-VTy`m#6PQk zBn9iYl?Vhhp~VKkmR_YG@b}0mpsFMMBaC zf5I+ZUqM*S#)Pu})M fET*=AWU~c81@IXYd6nZpR-glBGkK`r1T6eFH3|s_ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 0455c81e3..809c3247e 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -72,9 +72,9 @@ a.underline {text-decoration:underline;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} .post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} -.reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praised-icon {background:url(/images/wechat/wechat_icon.gif) -100px -76px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} /* loading 弹框*/ .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;} From e4653426d29534c7ba1ef54b883fced0f8894c8f Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 26 May 2016 12:59:15 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=B0=86openid=E5=AD=98=E5=88=B0session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 155 +++++++++++++++----------- app/views/wechats/create.html.erb | 0 app/views/wechats/login.html.erb | 6 +- 3 files changed, 90 insertions(+), 71 deletions(-) delete mode 100644 app/views/wechats/create.html.erb diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 7ee0552fb..c1d235d75 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -150,87 +150,108 @@ class WechatsController < ActionController::Base end - def get_open_id - begin - raise "非法操作, code不存在" unless params[:code] - openid = get_openid_from_code(params[:code]) - raise "无法获取到openid" unless openid - render :json => {status:0, openid: openid} - rescue Exception=>e - render :json => {status: -1, msg: e.message} - end - end - def bind - begin - raise "非法操作, code不存在" unless params[:code] - openid = get_openid_from_code(params[:code]) - raise "无法获取到openid" unless openid - raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) - user, last_login_on = User.try_to_login(params[:username], params[:password]) - raise "用户名或密码错误,请重新登录" unless user - #补全用户信息 + ### controller method + include Controllers + + module Controllers + def get_open_id + begin - raise "此用户已经绑定了公众号" if user.user_wechat + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) - UserWechat.create!( - openid: openid, - user: user - ) - render :json => {status:0, msg: "绑定成功"} - rescue Exception=>e - render :json => {status: -1, msg: e.message} + + raise "无法获取到微信openid" unless openid + render :json => {status:0, openid: openid} + rescue Exception=>e + render :json => {status: -1, msg: e.message} + end end - end - def login - @code = params[:code] #TODO 安全性 - render 'wechats/login', layout: 'base_wechat' - end + def bind + begin - private - def get_openid_from_code(code) - url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#{Wechat.config.appid}&secret=#{Wechat.config.secret}&code=#{code}&grant_type=authorization_code" - logger.debug url - body = URI.parse(url).read - logger.debug body - JSON.parse(body)["openid"] - end + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) - def user_binded?(openid) - uw = UserWechat.where(openid: openid).first - end + raise "无法获取到openid" unless openid + raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) + + user, last_login_on = User.try_to_login(params[:username], params[:password]) + raise "用户名或密码错误,请重新登录" unless user + #补全用户信息 - def user_activity(user) - @user = user - shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) - @page = params[:page] ? params[:page].to_i + 1 : 0 - user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','Project')" - principal_types = "JournalsForMessage" + raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat - blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" - @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + - "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ - "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + - "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) + UserWechat.create!( + openid: openid, + user: user + ) + render :json => {status:0, msg: "绑定成功"} + rescue Exception=>e + render :json => {status: -1, msg: e.message} + end + end + def login + session[:wechat_code] = params[:code] if params[:code] + render 'wechats/login', layout: 'base_wechat' + end - end + private + def get_openid_from_code(code) + openid = session[:wechat_openid] - def process_activity(user_activity) - act= user_activity.act - case user_activity.container_type.to_s - when 'Course' - when 'Project' - case user_activity.act_type.to_s - when 'Issue' - [act.project.name.to_s+" | 项目问题", act.subject.to_s, url_to_avatar(act.author),"http://wechat.trustie.net/app.html#/issue/#{act.id}"] + unless openid + if code + openid = wechat.web_access_token(code)["openid"] end + end + + if openid + session[:wechat_openid] = openid + end + + return openid + end + + def user_binded?(openid) + uw = UserWechat.where(openid: openid).first + end + + def user_activity(user) + @user = user + shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) + shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) + @page = params[:page] ? params[:page].to_i + 1 : 0 + user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" + course_types = "('Message','News','HomeworkCommon','Poll','Course')" + project_types = "('Message','Issue','Project')" + principal_types = "JournalsForMessage" + + blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" + @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + + "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ + "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + + "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) + + + end + + def process_activity(user_activity) + act= user_activity.act + case user_activity.container_type.to_s + when 'Course' + when 'Project' + case user_activity.act_type.to_s + when 'Issue' + [act.project.name.to_s+" | 项目问题", act.subject.to_s, url_to_avatar(act.author),"http://wechat.trustie.net/app.html#/issue/#{act.id}"] + end + end end end + end diff --git a/app/views/wechats/create.html.erb b/app/views/wechats/create.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 0e6fd8695..dc39b9f23 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -12,19 +12,17 @@
- +
- +
- - From b48b1c97b3ed4368e4d6eeb078f08374e09cd176 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 26 May 2016 13:02:27 +0800 Subject: [PATCH 6/7] weixin --- app/controllers/wechats_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index c1d235d75..43bab082a 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -153,7 +153,7 @@ class WechatsController < ActionController::Base ### controller method - include Controllers + module Controllers def get_open_id @@ -254,4 +254,7 @@ class WechatsController < ActionController::Base end end + + include Controllers + end From 7bb94d9df4aea4c575d43ceed506ae28d2d80003 Mon Sep 17 00:00:00 2001 From: txz Date: Thu, 26 May 2016 13:47:23 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B0=86=E5=86=85=E5=AE=B9=E5=92=8C=E6=A1=86=E6=9E=B6=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 74 +++++++-------- public/assets/wechat/course_discussion.html | 89 ++++++++++--------- public/assets/wechat/course_notice.html | 2 + public/assets/wechat/homework_detail.html | 4 +- public/assets/wechat/issue_detail.html | 2 + public/assets/wechat/jour_message_detail.html | 70 ++++++++------- public/assets/wechat/project_discussion.html | 8 +- 7 files changed, 132 insertions(+), 117 deletions(-) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index ce7945872..fa3a9f341 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -1,46 +1,48 @@ -
-
-
-
{{blog.title}}      
-
{{blog.user.realname}}发表博客
-
-
-
+
+
+
+
+
{{blog.title}}
+
{{blog.user.realname}}发表博客
+
+
+
+
+
+ {{blog.created_at}} +
-
- {{blog.created_at}} -
-
-
-
回复 ({{blog.comment_count}})
-
已赞 ({{blog.praise_count}})
-
赞 ({{blog.praise_count}})
-
-
-
-
-
-
- -

-                        
{{journal.lasted_comment}}
-
回复
+
+
回复 ({{blog.comment_count}})
+
已赞 ({{blog.praise_count}})
+
赞 ({{blog.praise_count}})
+
+
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
-
-
-
-
- -
- - +
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index f464369ae..d1b65e629 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,52 +1,55 @@ -
-
-
-
{{discussion.subject}}      
- - - - - - - -
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
-
-
-
-
- {{discussion.created_on}} -
-
-
-
回复 ({{discussion.replies_count}})
-
已赞 ({{discussion.praise_count}})
-
赞 ({{discussion.praise_count}})
-
-
-
-
-
-
- -

-                        
{{journal.lasted_comment}}
-
回复
+
+
+
+
+
+
{{discussion.subject}}
+ + + + + + + +
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
+
+
+ {{discussion.created_on}} +
-
-
-
-
- -
- - +
+
回复 ({{discussion.replies_count}})
+
已赞 ({{discussion.praise_count}})
+
赞 ({{discussion.praise_count}})
+
+
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
+
+
+
+
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index ac1f7dcea..c10763bf8 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,5 +1,6 @@ +
@@ -51,3 +52,4 @@
+
\ No newline at end of file diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 41ff56f57..2783bd317 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -1,5 +1,6 @@ +
@@ -56,4 +57,5 @@
-
\ No newline at end of file +
+
\ No newline at end of file diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 08eb9a39d..035a7c98d 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -1,5 +1,6 @@ +
@@ -55,3 +56,4 @@
+
\ No newline at end of file diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index f813d19c1..5ccbf6248 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -1,44 +1,46 @@ -
-
-
-
{{message.user.realname}}给您留言了
-
{{message.created_on}}
-
-
-
+
+
+
+
+
{{message.user.realname}}给您留言了
+
{{message.created_on}}
+
+
+
+
+
-
-
-
-
回复 ({{message.reply_count}})
-
已赞 ({{message.praise_count}})
-
赞 ({{message.praise_count}})
-
-
+
+
回复 ({{message.reply_count}})
+
已赞 ({{message.praise_count}})
+
赞 ({{message.praise_count}})
+
+
-
-
-
-
- -

-                        
{{journal.lasted_comment}}
-
回复
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
-
-
-
-
- -
- - +
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 31aa0b16a..be639c1a0 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -1,9 +1,10 @@ +
-
{{discussion.subject}}      
+
{{discussion.subject}}
@@ -38,7 +39,7 @@ -
+
@@ -50,4 +51,5 @@
-
\ No newline at end of file + + \ No newline at end of file
发布者: {{discussion.user.realname}}